Skip to content

Commit

Permalink
Fix mutable default.
Browse files Browse the repository at this point in the history
  • Loading branch information
pp-mo committed Jun 17, 2022
1 parent ac6d1bf commit 0f9a1e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/iris/fileformats/netcdf/saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,9 @@ def _get_dim_names(self, cube_or_mesh):
"""

def record_dimension(names_list, dim_name, length, matching_coords=[]):
def record_dimension(
names_list, dim_name, length, matching_coords=None
):
"""
Record a file dimension, its length and associated "coordinates"
(which may in fact also be connectivities).
Expand All @@ -1284,6 +1286,8 @@ def record_dimension(names_list, dim_name, length, matching_coords=[]):
matches the earlier finding.
"""
if matching_coords is None:
matching_coords = []
if dim_name not in self._existing_dim:
self._existing_dim[dim_name] = length
else:
Expand Down

0 comments on commit 0f9a1e6

Please sign in to comment.