[Python-ideas] PEP 505: None-aware operators

Mark E. Haase mehaase at gmail.com
Mon Jul 23 09:37:44 EDT 2018


On Mon, Jul 23, 2018 at 2:23 AM Nicholas Cole <nicholas.cole at gmail.com>
wrote:

> One issue for me is that the trivial case is already a one-liner:
>
> if a is None: a = 10
>

Yes, if you have no indentation and a 1-character name, then it fits on a
single line. If you have a longer expression and/or side effects, then it's
not a one-liner anymore.


> And that leads to a simple question: how many times does this actually
> occur in real-world by python code? -- i.e. how many times do I want
> to check the value of an existing label, and, finding it is None (and
> None specifically), then assign it a value?
>
> What does a scan through the existing core library say?


Please read the PEP before you shoot it down. It answers this _exact_
question.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180723/53f97bab/attachment-0001.html>


More information about the Python-ideas mailing list