[issue35712] Make NotImplemented unusable in boolean context

Guido van Rossum report at bugs.python.org
Mon Nov 9 13:06:55 EST 2020


Guido van Rossum <guido at python.org> added the comment:

> list(filter(None.__ne__, L))

I assume you've been recommending this? To me it looks obfuscated. People should just use a comprehension, e.g.

[x for x in L if x is not None]

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35712>
_______________________________________


More information about the Python-bugs-list mailing list