HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by switch007 | Hacker News Reader
Parent
Full thread
switch007
·
Or even "prettier":
x = [] if x is None else x
View on HN
knite
·
I'm partial to:
x = x or []
acveilleux
·
Only works when x is truthy for all legal x values, excluding x=0.
Reply on news.ycombinator.com