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. It is discussable how much useful this feature is. Python is not C++, and some microoptimizations important in C++ are not worth in Python. _______________________________________________ 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/BJVO7KXR6KHCPAWMVMBILFWMOZTMJHFN/ Code of Conduct: http://python.org/psf/codeofconduct/