On Nov 27, 2019, at 09:13, Serhiy Storchaka <email@example.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:
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.