
On 11/27/20 6:54 AM, Serhiy Storchaka wrote:
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
27.11.20 13:25, Ned Batchelder пише: 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.