[Python-Dev] Please reject or postpone PEP 526

Ivan Levkivskyi levkivskyi at gmail.com
Fri Sep 2 13:51:17 EDT 2016


On 2 September 2016 at 17:59, Guido van Rossum <guido at python.org> wrote:
> On Fri, Sep 2, 2016 at 6:47 AM, Mark Shannon <mark at hotpy.org> wrote:
> > Quoting from the PEP:
> > ```
> > a: int
> > a: str # Static type checker will warn about this.
> > ```
> > In other words, it is illegal for a checker to split up the variable,
even
> > though it is straightforward to do so.
>
> One of my co-authors has gone too far here. The intent is not to
legislate what should happen in this case but to leave it to the checker.
In mypy, the equivalent syntax using type comments is currently indeed
rejected, but we're considering a change here (
https://github.com/python/mypy/issues/1174). The PEP 526 syntax will not
make a difference here.

If I remember correctly, I added this example. At that time the intention
was to propose to "loosen" the behaviour of type checkers (note it is a
warning, not an error like in mypy). But now I agree with Guido that we
should be even more liberal. We could left this to type checker to decide
what to do (they could even have options like -Werror or -Wignore).

--
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160902/9d178638/attachment.html>


More information about the Python-Dev mailing list