On Sun, Sep 4, 2016 at 8:52 PM, Mark Shannon <m...@hotpy.org> wrote: > The key difference is in placement. > PEP 484 style > variable = value # annotation > > Which reads to me as if the annotation refers to the value. > PEP 526 > variable: annotation = value > > Which reads very much as if the annotation refers to the variable. > That is a change in terms of semantics and a change for the worse, in terms > of expressibility.
So what you have is actually a change in *implication* (since the PEP doesn't stipulate semantics); and the old way (the comment) implies something contrary to the semantics of at least one of the type checkers that uses it (MyPy). Are there any current type checkers that actually do associate that with the value? That is, to have "variable = func() # str" indicate the same type check as "def func() -> str"? If not, this is a strong argument in favour of the PEP, since it would synchronize the syntax with the current best-of-breed checkers. ChrisA _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com