On 11/27/20 6:54 AM, Serhiy Storchaka wrote:
27.11.20 13:25, Ned Batchelder пише:
On 11/26/20 11:45 PM, Guido van Rossum wrote:
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.
No, it will not change the runtime behavior. But it can make a
restriction which was in the documentation only to be enforced by the
linter.

If it is documented, that you should never use a dict after passing it
as argument to f(), the code that uses it has a bug. With the proposed
feature MyPy could warn you about this bug.

If I understand what you are saying, this would be a dramatic change in Python semantics which 1) would break many projects, and 2) wouldn't need a type annotation because it isn't something you could turn on and off.  So mypy wouldn't warn you about it, pylint would.

I think I mistook this proposal for a simple thing, when it is far from simple. Thanks for the clarification.

--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/6IXS6CE6VK7GWUPVYXTZN5QIMDC3M2TI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to