8000 bpo-46494: Mention the typing_extensions pkg in typing docs by meersuri · Pull Request #31260 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 4 commits into from
Mar 8, 2022

Conversation

meersuri
Copy link
Contributor
@meersuri meersuri commented Feb 10, 2022

Copy link
Member
@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🚀

@@ -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
Copy link
Member

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)

Copy link
Member

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.

Suggested change
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

@@ -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
Copy link
Member
@sobolevn sobolevn Feb 10, 2022

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.

Copy link
Member

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).

Copy link
Member
@JelleZijlstra JelleZijlstra left a 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?

@meersuri
Copy link
Contributor Author
meersuri commented Feb 11, 2022 via email

@@ -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
Copy link
Member

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.

Copy link
Contributor Author
@meersuri meersuri Feb 13, 2022
edited
Loading

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

Copy link
Member

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.

Copy link
Contributor Author

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

@JelleZijlstra JelleZijlstra self-assigned this Feb 19, 2022
@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"

@bedevere-bot
Copy link

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@meersuri
Copy link
Contributor Author
meersuri commented Mar 2, 2022

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@JelleZijlstra: please review the changes made to this pull request.

Copy link
Member
@JelleZijlstra JelleZijlstra left a 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

A3E2
Copy link
Member
@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too.

@JelleZijlstra JelleZijlstra merged commit 8debeed into python:main Mar 8, 2022
@JelleZijlstra JelleZijlstra added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Mar 8, 2022
@miss-islington
Copy link
Contributor

Thanks @meersuri for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @meersuri for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 8, 2022
…-31260)

(cherry picked from commit 8debeed)

Co-authored-by: Meer Suri <46469858+meersuri@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 8, 2022
…-31260)

(cherry picked from commit 8debeed)

Co-authored-by: Meer Suri <46469858+meersuri@users.noreply.github.com>
@bedevere-bot
Copy link

GH-31746 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Mar 8, 2022
@bedevere-bot
Copy link

GH-31747 is a backport of this pull request to the 3.10 branch.

miss-islington added a commit that referenced this pull request Mar 8, 2022
(cherry picked from commit 8debeed)

Co-authored-by: Meer Suri <46469858+meersuri@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Mar 8, 2022
(cherry picked from commit 8debeed)

Co-authored-by: Meer Suri <46469858+meersuri@users.noreply.github.com>
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…-31260)

(cherry picked from commit 8debeed)

Co-authored-by: Meer Suri <46469858+meersuri@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants
0