On Fri, Feb 17, 2017 at 9:34 PM, David Mertz <me...@gnosis.cx> wrote:
> On Fri, Feb 17, 2017 at 6:20 PM, Nathaniel Smith <n...@pobox.com> wrote:
>>
>> value = delayed: some_dict.get("whatever")
>> if value is None:
>>     ...
>>
>> I.e., the question is, how does 'is' work on delayed objects? I guess
>> it has to force the promise and walk the proxy chain in each input and
>> then do an 'is' on the base objects?
>
>
> You've explained the semantics exactly.  That's not confusing at all.

Okay... so what if I want to check if two objects refer to the same
delayed computation? I guess you can say that's just not supported,
but that's *extraordinarily weird* for Python.

And at the implementation level... so you just added two type checks
and two branches to every 'is' call; this seems concerning. And now
'is' can raise an error, which it never could before. You also AFAICT
have to modify every single C extension function to check for and
handle these things, which is probably impossible even if the overhead
of all the checks is acceptable, which isn't obvious. I'm just not
seeing how this could be implemented.

-n

-- 
Nathaniel J. Smith -- https://vorpus.org
_______________________________________________
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