-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
class decorator could change type of the decorated class #7614
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
Comments
Yeah, we basically don't do any typechecking of class decorators at all. This is definitely a bug (and a duplicate of #3135) but mostly it hasn't seemed to be a problem! I think it is somewhat unlikely we will ever understand complicated class decorator behaviors, but we could certainly do better here. I think we'd be more likely to just reject this call than to turn C into a variable of type |
Sorry for the duplicate, I couldn't find similar issues. |
Can a class decorator "change" the type of the decorated class?
My issue is with a "wrapper" class that I created, but I can replicate with even this example:
if I launch mypy I see
while C, actually, has became a
str
!The text was updated successfully, but these errors were encountered: