Skip to content

Commit 885b114

Browse files
author
Rodolfo Alonso Hernandez
committed
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
1 parent a87bd58 commit 885b114

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

openstackclient/network/sdk_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def get_osc_show_columns_for_sdk_resource(
1717
sdk_resource,
1818
osc_column_map,
19-
invisible_columns=[]
19+
invisible_columns=None
2020
):
2121
"""Get and filter the display and attribute columns for an SDK resource.
2222
@@ -40,6 +40,7 @@ def get_osc_show_columns_for_sdk_resource(
4040
# Build the OSC column names to display for the SDK resource.
4141
attr_map = {}
4242
display_columns = list(resource_dict.keys())
43+
invisible_columns = [] if invisible_columns is None else invisible_columns
4344
for col_name in invisible_columns:
4445
if col_name in display_columns:
4546
display_columns.remove(col_name)

0 commit comments

Comments
 (0)