module documentation
Translate an Expression to a Type value.
Exception |
|
Exception raised when an expression is not valid as a type. |
Function | expr |
Translate an expression to the corresponding type. |
Function | _extract |
Undocumented |
def expr_to_unanalyzed_type(expr:
Expression
, options: Options|None
= None, allow_new_syntax: bool
= False, _parent: Expression|None
= None) -> ProperType
:
(source)
¶
Translate an expression to the corresponding type. The result is not semantically analyzed. It can be UnboundType or TypeList. Raise TypeTranslationError if the expression cannot represent a type. If allow_new_syntax is True, allow all type syntax independent of the target Python version (used in stubs).