Cleanup: avoid risky list as default argument in keymap

This commit is contained in:
Campbell Barton 2021-03-14 18:00:17 +11:00
parent 06245d0d94
commit 8dd9bb1749
2 changed files with 4 additions and 4 deletions

View File

@ -352,12 +352,12 @@ def _template_items_tool_select_actions(operator, *, type, value):
# This could have a more generic name, for now use for circle select.
def _template_items_tool_select_actions_simple(operator, *, type, value, properties=[]):
def _template_items_tool_select_actions_simple(operator, *, type, value, properties=()):
kmi_args = {"type": type, "value": value}
return [
# Don't define 'SET' here, take from the tool options.
(operator, kmi_args,
{"properties": properties}),
{"properties": [*properties]}),
(operator, {**kmi_args, "shift": True},
{"properties": [*properties, ("mode", 'ADD')]}),
(operator, {**kmi_args, "ctrl": True},

View File

@ -161,12 +161,12 @@ def _template_items_tool_select_actions(operator, *, type, value):
# This could have a more generic name, for now use for circle select.
def _template_items_tool_select_actions_simple(operator, *, type, value, properties=[]):
def _template_items_tool_select_actions_simple(operator, *, type, value, properties=()):
kmi_args = {"type": type, "value": value}
return [
# Don't define 'SET' here, take from the tool options.
(operator, kmi_args,
{"properties": properties}),
{"properties": [*properties]}),
(operator, {**kmi_args, "shift": True},
{"properties": [*properties, ("mode", 'ADD')]}),
(operator, {**kmi_args, "ctrl": True},