Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
coderdude
on May 21, 2012
|
parent
|
context
|
favorite
| on:
A few things to remember while coding in Python
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.
chernevik
on May 21, 2012
[–]
Thanks for the additional clarity.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: