On 2018-08-02 22:49, Eric Fahlgren wrote:

On Thu, Aug 2, 2018 at 1:22 PM MRAB <pyt...@mrabarnett.plus.com <mailto:pyt...@mrabarnett.plus.com>> wrote:

    > policy?.mangle_from_ ?? True
    > True (??? since lhs is None?)
    >
    No, it's not 'policy.mangle_from_' that could be None, it's 'policy'
    that could be None (i.e. there's no policy).


In my example, there is a policy, and the value of policy.mangle_from_ is set to None.  Thus the above should be equivalent to this

>>> None ?? True
True

Unless, of course, I completely misunderstand the way the ?? operator works.  This is not the same as the original code, they are not equivalent.
In the relevant code, is policy.mangle_from_ ever None?

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to