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

[3.10] bpo-44098: Drop ParamSpec from most __parameters__ in typing generics (GH-26013) #26091

Merged
merged 1 commit into from May 13, 2021

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 13, 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.

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

Co-authored-by: Ken Jin 28750310+Fidget-Spinner@users.noreply.github.com

https://bugs.python.org/issue44098

Automerge-Triggered-By: GH:gvanrossum

…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>
@miss-islington
Copy link
Contributor Author

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

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

3 similar comments
@miss-islington
Copy link
Contributor Author

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

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

@miss-islington
Copy link
Contributor Author

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

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

@miss-islington
Copy link
Contributor Author

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

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

@gvanrossum gvanrossum removed the request for review from ilevkivskyi May 13, 2021
@gvanrossum gvanrossum merged commit c55ff1b into python:3.10 May 13, 2021
14 checks passed
@bedevere-bot
Copy link

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

@gvanrossum: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington miss-islington deleted the backport-b2f3f8e-3.10 branch May 13, 2021
@posita
Copy link

@posita posita commented Jan 29, 2022

I know this was merged awhile ago, but should this have included an update to _GenericAlias.copy_with that copied the newly-introduced _typevar_types and _paramspec_tvars properties? I don't know the answer to that, which is why I'm asking.

@gvanrossum
Copy link
Member

@gvanrossum gvanrossum commented Jan 29, 2022

I know this was merged awhile ago, but should this have included an update to _GenericAlias.copy_with that copied the newly-introduced _typevar_types and _paramspec_tvars properties? I don't know the answer to that, which is why I'm asking.

Could you please open a bpo issue about that?

@posita
Copy link

@posita posita commented Jan 30, 2022

Could you please open a bpo issue about that?

bpo-46581 filed.

posita added a commit to posita/cpython that referenced this issue Feb 1, 2022
pythonGH-26091 added the _typevar_types and _paramspec_tvars instance
variables to _GenericAlias. However, they were not propagated
consistently. This commit addresses the most prominent deficiency
identified in bpo-46581 (namely their absence from
_GenericAlias.copy_with), but there could be others.
posita added a commit to posita/cpython that referenced this issue Feb 1, 2022
pythonGH-26091 added the _typevar_types and _paramspec_tvars instance
variables to _GenericAlias. However, they were not propagated
consistently. This commit addresses the most prominent deficiency
identified in bpo-46581 (namely their absence from
_GenericAlias.copy_with), but there could be others.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants