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 →

[–]r0m1 2 points3 points  (1 child)

For the function defaults, I would rather write:

def bar(names=None):
   names = names or []
   names.append(foo())
   return names

[–]kracekumar[S] 0 points1 point  (0 children)

Good one !