This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Mention typing_extensions in the typing documentation
Type: Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: AlexWaygood, JelleZijlstra, docs@python, kj, meersuri, miss-islington, sobolevn, srittau
Priority: normal Keywords: easy, newcomer friendly, patch

Created on 2022-01-24 00:51 by JelleZijlstra, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31260 merged meersuri, 2022-02-10 13:50
PR 31746 merged miss-islington, 2022-03-08 04:05
PR 31747 merged miss-islington, 2022-03-08 04:05
Messages (10)
msg411434 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-01-24 00:51
I've often seen people say things like "I can't use TypeGuard yet, I'm stuck on 3.9". That's not true, because the typing_extensions package backports all typing features to all supported Python versions.

To help make people aware of this option, we should mention typing_extensions in https://docs.python.org/3.10/library/typing.html.

Perhaps this can go in the "Relevant PEPs" section, or at the end of the intro section.

Suggested wording:

"New features have been added to the typing module in each major version of Python. The typing extensions (link to GitHub) package provides backports to all supported versions of Python 3 for almost all of these features."
msg411435 - (view) Author: Alex Waygood (AlexWaygood) * (Python triager) Date: 2022-01-24 01:00
Sounds like a great idea. I like the idea of putting it in the "Relevant PEPs" section, as that section already details how the typing module has evolved over the past few major versions of Python.
msg411457 - (view) Author: Sebastian Rittau (srittau) * Date: 2022-01-24 09:48
Sounds like a good idea. I would put it into the introduction. I hear it will easily be missed in other sections.

Wouldn't a link to PyPI make more sense than a GitHub link?
msg411487 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2022-01-24 16:13
Yes please, this is a great idea.
msg412915 - (view) Author: Meer Suri (meersuri) * Date: 2022-02-09 15:35
(First time contributor looking for guidance) Is this diff okay? I'm not sure if the package name should be typing-extensions, or if the formatting is okay

diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 94a46b01a1..c0fe656c1c 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -32,6 +32,11 @@ In the function ``greeting``, the argument ``name`` is expected to be of type
 :class:`str` and the return type :class:`str`. Subtypes are accepted as
 arguments.

+New features have been added to the typing module in each major version of
+Python. The `typing_extensions <https://pypi.org/project/typing-extensions/>`_
+package provides backports to all supported versions of Python 3 for almost
+all of these features.
+
 .. _relevant-peps:

 Relevant PEPs
msg412925 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-02-09 17:16
Welcome to this project, Meer!

That looks pretty good, feel free to submit a PR. We can then perhaps get feedback from more people to improve the wording.
msg414716 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-03-08 04:04
New changeset 8debeed3075bf4d7e568e65da16bec63cf276f4f by Meer Suri in branch 'main':
bpo-46494: Mention the typing_extensions pkg in typing docs (GH-31260)
https://github.com/python/cpython/commit/8debeed3075bf4d7e568e65da16bec63cf276f4f
msg414717 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-03-08 04:04
Thanks for the patch!
msg414721 - (view) Author: miss-islington (miss-islington) Date: 2022-03-08 04:25
New changeset e053f0e9f41791095a924e2aceaaa025a058ed57 by Miss Islington (bot) in branch '3.10':
bpo-46494: Mention the typing_extensions pkg in typing docs (GH-31260)
https://github.com/python/cpython/commit/e053f0e9f41791095a924e2aceaaa025a058ed57
msg414722 - (view) Author: miss-islington (miss-islington) Date: 2022-03-08 04:29
New changeset 0c718e02f60f98275c62e8a2a152f086650e88ea by Miss Islington (bot) in branch '3.9':
bpo-46494: Mention the typing_extensions pkg in typing docs (GH-31260)
https://github.com/python/cpython/commit/0c718e02f60f98275c62e8a2a152f086650e88ea
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90652
2022-03-08 04:29:40miss-islingtonsetmessages: + msg414722
2022-03-08 04:25:50miss-islingtonsetmessages: + msg414721
2022-03-08 04:05:07miss-islingtonsetpull_requests: + pull_request29863
2022-03-08 04:05:01miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request29862
2022-03-08 04:04:25JelleZijlstrasetstatus: open -> closed
resolution: fixed
messages: + msg414717

stage: patch review -> resolved
2022-03-08 04:04:10JelleZijlstrasetmessages: + msg414716
2022-02-10 13:50:10meersurisetkeywords: + patch
stage: patch review
pull_requests: + pull_request29426
2022-02-09 17:16:17JelleZijlstrasetmessages: + msg412925
2022-02-09 15:35:13meersurisetnosy: + meersuri
messages: + msg412915
2022-01-24 16:45:51gvanrossumsetnosy: - gvanrossum
2022-01-24 16:13:31kjsetkeywords: + easy, newcomer friendly

messages: + msg411487
2022-01-24 09:48:58srittausetmessages: + msg411457
2022-01-24 01:00:03AlexWaygoodsetmessages: + msg411435
2022-01-24 00:51:36JelleZijlstracreate