Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
coderdude
· 14y ago · 0 comments
def f(x=None): x = x if x is not None else [] return x
Now it will assign that value back to x. Otherwise it would just evaluate the expression.
Comments
[–]
chernevik
14y ago
Thanks for the additional clarity.