3 ms·
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
by tomchristie 8y 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.
- Asooka 8y agoI would really just write `if x is None: x = []`