News for hackers. Stuff that matters.
Re:PEP 505: Bringing None-Aware Operators to Python by Doxin on Monday August 13, 2018 @08:10AM (#17749444)
That's generally considered unpythonic though. A more pythonic way to write that is

    for child in node.children if node.children else []:
        for attrib in child.attributes if child.attributes else []:
            ...
Which, granted, is a lot more verbose and probably not any more readable but at least it's not abusing the or operator.

There are no comments on this comment yet.