@overload with multiple Generic[Any]
#2157
Replies: 2 comments
-
|
The alternative of not preserving |
Beta Was this translation helpful? Give feedback.
-
|
The short answer is that Python’s current static typing system does not support inferring a generic return type from an “indirect factory” method unless that type variable is explicitly connected to the function signature. This limitation arises because Python’s type checkers (e.g., Why this limitation exists
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Am I missing something, or is it impossible to annotate
opin a way that satisfies theassert_typetest-suite in the example below?The schema is relevant for type hinting numeric types that interact with
math.nan/ nullable values.Beta Was this translation helpful? Give feedback.
All reactions