[Python-ideas] Proposal: Use mypy syntax for function annotations

Joseph Martinot-Lagarde joseph.martinot-lagarde at m4x.org
Fri Aug 15 01:43:33 CEST 2014


Le 14/08/2014 22:12, Juancarlo Añez a écrit :
>
> On Thu, Aug 14, 2014 at 1:15 PM, Steven D'Aprano
> <steve at pearwood.info
> <mailto:steve at pearwood.info>> wrote:
>
>     Yes. You say that as if it were a bad thing. It is not. Python 3 is
>     here to stay and we should be promoting Python 3 only code. There is
>     absolutely no need to apologise for that fact. If people are happy with
>     Python the way it is in 2.7, or 1.5 for that matter, that's great, they
>     can stay on it for ever, but all new features are aimed at 3.x and not
>     2.x or 1.x.
>
>
> That's reasonable..., in theory.
>
> Reality is that most of the people most supportive of the migration
> towards Python 3 are currently writing code that is compatible with both
> 3.x and 2.[67].
>
> You don't leave your people behind (not without a lifeboat).
>
> Since its decided there will not be a 2.8, the right thing to do is to
> delay decisions about static typing (or restrictions on annotations)
> till 4.0. It would be "a bad thing" to break or deprecate existing 3.x
> code with 3.5.

It breaks nothing since it's optional. What you say is true for every 
new feature in python: using a feature present in on version of python 
prevents the code to be compatible with previous versions.

I mostly write code compatible with 2.7 and 3.x, I won't use annotations 
the same way I won't use asyncio or yield from...

>
> Cheers,
> --
> Juancarlo *Añez*
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>




More information about the Python-ideas mailing list