Shared definitions used by different parts of semantic analysis.
Class |
|
Undocumented |
Class |
|
A core abstract interface to generic semantic analyzer functionality. |
Class |
|
A limited abstract interface to some generic semantic analyzer pass 2 functionality. |
Function | calculate |
Calculate a precise item type for the fallback of a tuple type. |
Function | find |
Find the dataclass transform spec for the given node, if any exists. |
Function | has |
Check if a type contains any placeholder types (recursively). |
Function | paramspec |
Undocumented |
Function | paramspec |
Undocumented |
Function | require |
Attempt to interpret an expression as a boolean literal, and fail analysis if we can't. |
Function | set |
Undocumented |
Constant | ALLOW |
Undocumented |
Constant | PRIORITY |
Undocumented |
Class | _ |
Undocumented |
Calculate a precise item type for the fallback of a tuple type. This must be called only after the main semantic analysis pass, since joins aren't available before that. Note that there is an apparent chicken and egg problem with respect to verifying type arguments against bounds. Verifying bounds might require fallbacks, but we might use the bounds to calculate the fallbacks. In practice this is not a problem, since the worst that can happen is that we have invalid type argument values, and these can happen in later stages as well (they will generate errors, but we don't prevent their existence).
Find the dataclass transform spec for the given node, if any exists. Per PEP 681 (https://peps.python.org/pep-0681/#the-dataclass-transform-decorator), dataclass transforms can be specified in multiple ways, including decorator functions and metaclasses/base classes. This function resolves the spec from any of these variants.
str
, fullname: str
, id: TypeVarId|int
, *, named_type_func: _NamedTypeCallback
, line: int
= -1, column: int
= -1, prefix: Parameters|None
= None) -> ParamSpecType
:
(source)
¶
Undocumented
str
, fullname: str
, id: TypeVarId|int
, *, named_type_func: _NamedTypeCallback
, line: int
= -1, column: int
= -1, prefix: Parameters|None
= None) -> ParamSpecType
:
(source)
¶
Undocumented
SemanticAnalyzerInterface|SemanticAnalyzerPluginInterface
, expression: Expression
, name: str
, default: Literal[ True]|Literal[ False]
) -> bool
:SemanticAnalyzerInterface|SemanticAnalyzerPluginInterface
, expression: Expression
, name: str
, default: None
= None) -> bool|None
:Attempt to interpret an expression as a boolean literal, and fail analysis if we can't.