[Python-Dev] PEP 526 ready for review: Syntax for Variable and Attribute Annotations

Sven R. Kunze srkunze at mail.de
Tue Aug 30 18:05:48 EDT 2016


Thanks Guido, also to the rest of the PEP team (4 people) :)


On 30.08.2016 23:20, Guido van Rossum wrote:
> I'm happy to present PEP 526 for your collective review:
> https://www.python.org/dev/peps/pep-0526/ (HTML)
> https://github.com/python/peps/blob/master/pep-0526.txt (source)
>
> There's also an implementation ready:
> https://github.com/ilevkivskyi/cpython/tree/pep-526
>
> I don't want to post the full text here but I encourage feedback on
> the high-order ideas, including but not limited to
>
> - Whether (given PEP 484's relative success) it's worth adding syntax
> for variable/attribute annotations.

I'd say no, especially because of the negative feedback by not a few 
thread participants.

> - Whether the keyword-free syntax idea proposed here is best:
>    NAME: TYPE
>    TARGET: TYPE = VALUE

If it will come, it's the best because of its similarity with parameter 
annotations and IIRC there are languages that already do it like this.

> Note that there's an extensive list of rejected ideas in the PEP;
> please be so kind to read it before posting here:
> https://www.python.org/dev/peps/pep-0526/#rejected-proposals-and-things-left-out-for-now

I find everything else well covered in the PEP especially corner-cases 
like variables without initialization, scopes etc.


Sven


More information about the Python-Dev mailing list