Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
eru
on Feb 20, 2011
|
parent
|
context
|
favorite
| on:
Python's Mutable Default Problem
Make yourself a function.
dilap
on Feb 20, 2011
[–]
Not so helpful in a strict language (since you want y to be evaluated only when x is None)
eru
on Feb 21, 2011
|
parent
[–]
Yes, that's true. You would need to wrap it in a lambda, but then that's looks horrible and you might as well use an if.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: