top | item 17743986

(no title)

tomchristie | 7 years ago

It’s okay-ish. You do need to be careful about what falsey values `x` might be tho, as it could introduce edge-case bugs.

Using `x = [] if x is None else x` is more precise.

discuss

order

Asooka|7 years ago

I would really just write `if x is None: x = []`