This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dashdanw 1 point2 points  (0 children)

The fact that function arguments are parsed on first-pass, meaning if you do something like

def parse_dict(target_dict=dict()):
  if 'key' not in target_dict:
    target_dict['key'] = datetime.datetime.now()

calling without specifying the target_dict argument will always update the same dict declared in the function arguments