Am 16.04.21 um 03:21 schrieb Barry Warsaw:
Actually, I think it’s time for a comprehensive guide to type
annotations. Just anecdotally, I was trying to annotate a library of
mine and was having an impossible time of it, until a chat with Guido
lead me to @typing.overload. That solved my problem intuitively and
easily, but I just didn’t know about it. Right now, there’s
information spread out all over the place, the stdlib documentation,
tool documentation, StackOverflow :D etc. It’s a complicated topic
that I think a comprehensive guide, a tutorial, etc. could really help
with.
As a typeshed maintainer, I agree. Currently, the typing documentation
is spread over various PEPs, the typing module documentation, and the
mypy documentation. We also have a style guide for stub in the typeshed
documentation. That said, at least for type stubs, we are working on a
PEP (still looking for a sponsor) that is supposed to be a comprehensive
document. [1][2]
- Sebastian
[1]
https://mail.python.org/archives/list/typing-...@python.org/message/VNMC3JPWWP3O4TNMJZMSEH6UU5BPN4ZJ/
[2] https://github.com/srittau/type-stub-pep/blob/type-stub-pep/pep-9999.rst
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/SDEQGGWKL5MHBPZURDVQSV6VC22MWY3E/
Code of Conduct: http://python.org/psf/codeofconduct/