Hacker News new | ask | show | jobs
by switch007 3825 days ago
Or even "prettier":

  x = [] if x is None else x
1 comments

I'm partial to:

x = x or []

Only works when x is truthy for all legal x values, excluding x=0.