Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  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.


Thanks for the additional clarity.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: