Avoid default mutable values in arguments
Mutable values shouldn't be used as default values in function arguments [1]. [1] http://docs.python-guide.org/en/latest/writing/gotchas/ Change-Id: I3c7f915f0409c77f4c430467365eb1bcfd7757b3
This commit is contained in:
parent
a87bd58fb4
commit
885b1149c3
@ -16,7 +16,7 @@ import six
|
|||||||
def get_osc_show_columns_for_sdk_resource(
|
def get_osc_show_columns_for_sdk_resource(
|
||||||
sdk_resource,
|
sdk_resource,
|
||||||
osc_column_map,
|
osc_column_map,
|
||||||
invisible_columns=[]
|
invisible_columns=None
|
||||||
):
|
):
|
||||||
"""Get and filter the display and attribute columns for an SDK resource.
|
"""Get and filter the display and attribute columns for an SDK resource.
|
||||||
|
|
||||||
@ -40,6 +40,7 @@ def get_osc_show_columns_for_sdk_resource(
|
|||||||
# Build the OSC column names to display for the SDK resource.
|
# Build the OSC column names to display for the SDK resource.
|
||||||
attr_map = {}
|
attr_map = {}
|
||||||
display_columns = list(resource_dict.keys())
|
display_columns = list(resource_dict.keys())
|
||||||
|
invisible_columns = [] if invisible_columns is None else invisible_columns
|
||||||
for col_name in invisible_columns:
|
for col_name in invisible_columns:
|
||||||
if col_name in display_columns:
|
if col_name in display_columns:
|
||||||
display_columns.remove(col_name)
|
display_columns.remove(col_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user