On Nov 27, 2019, at 09:13, Serhiy Storchaka <storch...@gmail.com> wrote:
> 
> PEP 8 is the stdlib style guide, and the type annotations are not
> used in the stdib.

PEP 8 already has guidelines for annotations. For example:

> Function annotations should use the normal rules for colons and always have 
> spaces around the ->arrow if present. (See Function Annotations below for 
> more about function annotations.)

The linked section also says:

The Python standard library should be conservative in adopting such 
annotations, but their use is allowed for new code and for big refactorings.

More generally, everyone knows PEP 8 is not just the style guideline for the 
stdlib, but the default style for external projects. It devotes quite a bit of 
wording to the fact that it’s only a default, implicitly (and in a few cases 
explicitly) acknowledging that it is one.

And it already offers guides for a number of things the stdlib never does, like 
relative imports and coding declarations.

There is a plausible reason not to mandate style more explicitly here—in fact, 
it’s already given in the text: Type hinting is still relatively new, so it’s 
worth encouraging large projects to experiment within the rules of PEP 484.

The question is whether that’s still true, or whether PEP 484 usage is explored 
well enough by now to start offering guides rather than an invitation to 
experiment further.

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/WTKPJRYZT7XBU2AELDLSQWANY3C3ELS4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to