Skip to content
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

bpo-44098: Drop ParamSpec from most __parameters__ in typing generics #26013

Merged
merged 2 commits into from May 13, 2021

Conversation

@Fidget-Spinner
Copy link
Contributor

@Fidget-Spinner Fidget-Spinner commented May 10, 2021

Added two new attributes to _GenericAlias:

  • _typevar_types, a single type or tuple of types indicating what types are treated as a TypeVar. Used for isinstance checks.
  • _paramspec_tvars , a boolean flag which guards special behavior for dealing with ParamSpec. Setting it to True means this class deals with ParamSpec.

https://bugs.python.org/issue44098

Automerge-Triggered-By: GH:gvanrossum

Lib/typing.py Outdated Show resolved Hide resolved
Copy link
Member

@gvanrossum gvanrossum left a comment

Thanks. Is this back port worthy?

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 13, 2021

@Fidget-Spinner: Status check is done, and it's a success .

@miss-islington miss-islington merged commit b2f3f8e into python:main May 13, 2021
12 checks passed
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 13, 2021

Thanks @Fidget-Spinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒🤖

miss-islington added a commit to miss-islington/cpython that referenced this issue May 13, 2021
…rics (pythonGH-26013)

Added two new attributes to ``_GenericAlias``:
* ``_typevar_types``, a single type or tuple of types indicating what types are treated as a ``TypeVar``. Used for ``isinstance`` checks.
* ``_paramspec_tvars ``, a boolean flag which guards special behavior for dealing with ``ParamSpec``. Setting it to ``True`` means this  class deals with ``ParamSpec``.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit b2f3f8e)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented May 13, 2021

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

@Fidget-Spinner
Copy link
Contributor Author

@Fidget-Spinner Fidget-Spinner commented May 13, 2021

Thanks. Is this back port worthy?

Yep (only to 3.10), I added the backport label for that. We need to backport it otherwise the typing generics and builtin generics will have different behaviors.

@Fidget-Spinner Fidget-Spinner deleted the no_paramspec_params branch May 13, 2021
gvanrossum pushed a commit that referenced this issue May 13, 2021
…rics (GH-26013) (#26091)

Added two new attributes to ``_GenericAlias``:
* ``_typevar_types``, a single type or tuple of types indicating what types are treated as a ``TypeVar``. Used for ``isinstance`` checks.
* ``_paramspec_tvars ``, a boolean flag which guards special behavior for dealing with ``ParamSpec``. Setting it to ``True`` means this  class deals with ``ParamSpec``.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit b2f3f8e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants