On 11/26/20 11:45 PM, Guido van Rossum wrote:
On Thu, Nov 26, 2020 at 7:45 PM MRAB <pyt...@mrabarnett.plus.com
<mailto:pyt...@mrabarnett.plus.com>> wrote:
> It's not discarded, it's still referenced by d in the outer scope.
>
No, it's not any more, and that's the point. It was _moved_ into the
function, and although the function returned it, it was discarded
because the caller didn't bind it to keep hold of it.
Sounds like one of you is describing current semantics and the other
is explaining the proposed new semantics. :-)
Yes, I see that now. As Chris points out elsewhere in the thread, this
proposal would have the type annotations change the actual behavior of
the code. Has this been done before? It also seems that it has to
change the behavior of the caller of the function, when the compiler
won't have access to the definition of the function. This proposal
seems to run counter to a number of fundamental Python dynamics.
--Ned.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/CWOPSXXHEBTVI66SRBQFN7W6AD4ZASQZ/
Code of Conduct: http://python.org/psf/codeofconduct/