News for hackers. Stuff that matters.
Re:PEP 505: Bringing None-Aware Operators to Python by agumonkey on Sunday August 12, 2018 @07:50AM (#17743963)
do people use

    x = x or []
or is it considered non idiomatic in python ?
Re:PEP 505: Bringing None-Aware Operators to Python by tomchristie on Sunday August 12, 2018 @08:00AM (#17743986)
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.

Re:PEP 505: Bringing None-Aware Operators to Python by Asooka on Sunday August 12, 2018 @09:16AM (#17744219)
I would really just write `if x is None: x = []`