Type hinting a class decorator that returns a subclass #1529
Unanswered
BojieSheng
asked this question in
Q&A
Replies: 1 comment
|
What you're doing here is too dynamic for static typing — at least for today's static type system. There has been some discussion of adding intersection types to the type system, and that could be used to approximate the type of the value returned by this function, but even that would be only an approximation. In general, this function can't be made type safe because it's overriding attributes |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Anyone knows who to annotate "cls" and return type for below function "examle_a"?
cls can be any class.
All reactions