Hacker News new | ask | show | jobs
by dajonker 3825 days ago
That will get you into trouble as well, please use:

    if x is None:
        x = []
... etc.
1 comments

Or even "prettier":

  x = [] if x is None else x
I'm partial to:

x = x or []

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