[Python-Dev] PEP 484
rymg19 at gmail.com
Thu Jul 5 00:21:09 EDT 2018
Type hints like in PEP 484 work on all Python 3 versions, and something
similar to your proposal is already supported on Python 2 .
On July 4, 2018 11:08:27 PM Shawn Chen <shawnchen1996 at outlook.com> wrote:
> Here, I am proposing a change on python type annotation.
> Python was born to be a simple and elegant language. However recent change
> has again introduce new incompatibility to python.
> The PEP 484 is proposing a type hint which can annotate the type of each
> parameters. How ever code written in this format can not be run for
> python3.5 and below.
> It is an exciting new feature to be able to know the data type from the
> code, But I am afraid this is not worth such a incompatibility.
> Here I want to propose a new way of annotation in python as follows
> def reportAge(name, age):
> ''' this a a greeting function and some other comment...
> !str, int -> str
> return name+' is ' + age
> we can put the annotation in the comment block and use a symbol '!' or
> other symbol suitable to lead a annotation line.
> the annotation should be positionally corresponding to the parameters.
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> Python-Dev mailing list
> Python-Dev at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev