-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-46494: Mention the typing_extensions pkg in typing docs #31260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 🚀
Doc/library/typing.rst
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have been
-> are
?
(not a native speaker)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "have been" is right. "are" would imply that we keep adding new features to each version, which has been true so far but isn't something we can promise will remain true :)
But separately, I think "major version" is wrong. Python 3 is a major version, but here we're talking about 3.9, 3.10, etc. Those are minor versions.
New features have been added to the typing module in each major version of | |
New features have been added to the typing module in each version of |
Doc/library/typing.rst
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are couple of questions I have after reading this sentence:
- What are "all supported versions"?
- Why "almost all features"? Which ones are not backported? Why?
Maybe we can rephrase it like so?
The typing_extensions package provides backports of new ``typing`` features to older versions of Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your rephrasing is good since it avoids these problems. "All supported versions" is supposed to mean all Python 3 versions that are still supported, and "almost all features" is because there's some things that can't be backported (e.g., PEP 604, PEP 585).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you apply Nikita's and my suggestions?
Yeah I'll work on this tonight, thanks for the insightful comments
…On Fri, Feb 11, 2022, 9:50 AM Jelle Zijlstra ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Could you apply Nikita's and my suggestions?
—
Reply to this email directly, view it on GitHub
<#31260 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALCRFYVNQ4FTV7GMB3PP5FTU2RTPTANCNFSM5OAZEGLQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@@ -32,6 +32,9 @@ 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. | |||
|
|||
The `typing_extensions <https://pypi.org/project/typing-extensions/>`_ package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you fully removed the first sentence? I'd like to make it more explicit that the fact that all these new things were added to recent versions doesn't mean you can't use them in older versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I read the rephrasing and felt that it covered the important points from both sentences so I thought that the intention was to have only the rephrased sentence, but it seems that I misunderstood what you meant. Is the following what was intended -
New features have been added to the typing module in each version of Python. The typing_extensions package provides backports of new ``typing`` features to older versions of Python.
Edit: I realized I missed your first comment about the versions of Python - updated the text above, based on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you didn't push any more changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed now. Sorry, this time I thought I would get feedback before pushing
Doc/library/typing.rst
Outdated
@@ -32,6 +32,10 @@ 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 version of Python. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New features have been added to the typing module in each version of Python. | |
New features are frequently added to the ``typing`` module. |
So this doesn't go out of date if we don't end up adding anything to 3.12 or something.
Doc/library/typing.rst
Outdated
@@ -32,6 +32,10 @@ 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 version of Python. | |||
The `typing_extensions <https://pypi.org/project/typing-extensions/>`_ package | |||
provides backports of new ``typing`` features to older versions of Python. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provides backports of new ``typing`` features to older versions of Python. | |
provides backports of these new features to older versions of Python. |
Don't repeat "typing"
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again |
Thanks for making the requested changes! @JelleZijlstra: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! @gvanrossum planning to merge this typing docs change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM too.
Thanks @meersuri for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @meersuri for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
GH-31746 is a backport of this pull request to the 3.9 branch. |
GH-31747 is a backport of this pull request to the 3.10 branch. |
https://bugs.python.org/issue46494