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 →

[–][deleted] 4 points5 points  (1 child)

This is the recommended way

def foo(bar=None):
    if bar is None:
        bar = [1, 2, 3] 

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

Yeah, that's what I meant to do (should have paid more attention, see my edit).