Skip to content

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

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 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 [email protected]

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 <[email protected]>
@miss-islington
Copy link
Contributor Author

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

3 similar comments
@miss-islington
Copy link
Contributor Author

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

@miss-islington
Copy link
Contributor Author

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

@miss-islington
Copy link
Contributor Author

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

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

@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 17:19
@posita
Copy link
Contributor

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

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
Contributor

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 pull request Mar 10, 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.
serhiy-storchaka added a commit that referenced this pull request Mar 10, 2022
GH-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.

Co-authored-by: Ken Jin <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
posita added a commit to posita/cpython that referenced this pull request Mar 11, 2022
…ythonGH-31061)

(Cherry-picked from 32bf359.)

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.

Co-authored-by: Ken Jin <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this pull request Mar 11, 2022
…H-31061) (GH-31821)

(Cherry-picked from 32bf359.)

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

Co-authored-by: Ken Jin <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>

Co-authored-by: Ken Jin <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants