KEMBAR78
Erase typevars of generic types when used in Type[C] by OddBloke · Pull Request #3833 · python/mypy · GitHub
Skip to content

Conversation

OddBloke
Copy link
Contributor

Prior to this commit, when generic types are used as the C in a Type[C]
expression, they don't have their typevars substituted; this leads to
the internal type variables of their implementations leaking out in a
way that makes them difficult to use.

Instead, we now erase those typevars to Any. This fixes #3824.

Prior to this commit, when generic types are used as the C in a Type[C]
expression, they don't have their typevars substituted; this leads to
the internal type variables of their implementations leaking out in a
way that makes them difficult to use.

Instead, we now erase those typevars to Any.  This fixes python#3824.
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

Help genericising a class

2 participants