[Python-ideas] PEP 505: None-aware operators: operators ?= and ?? and OR

Jonathan Fine jfine2358 at gmail.com
Thu Aug 2 15:20:47 EDT 2018


Hi Eric

[Steve Dower: Eric seems to have found a bug in the PEP. Where to report?]

You quoted, from PEP 505,

Before
> mangle_from_ = True if policy is None else policy.mangle_from_

After
> mangle_from_ = policy?.mangle_from_ ?? True

You then remarked
> I cannot see how these are equivalent

I don't see the equivalence either. If `policy.mangle_from_ is None`
then surely Before gives None, while After gives True.

Here's the process for filing bugs in a PEP
https://www.python.org/dev/peps/pep-0001/#reporting-pep-bugs-or-submitting-pep-updates

As we seem to be in early draft stage, perhaps communicate first with
PEP author (Steve Dower, copied).

-- 
Jonathan


More information about the Python-ideas mailing list