Calculate some properties of classes. These happen after semantic analysis and before type checking.
Function | add |
Setup extra, ad-hoc subtyping relationships between classes (promotion). |
Function | calculate |
Calculate abstract status of a class. |
Function | calculate |
Try to infer additional class variables. |
Function | check |
Check that all classes in MRO of a protocol are protocols |
Constant | TYPE |
Undocumented |
TypeInfo
, module_names: SymbolTable
, options: Options
, builtin_names: SymbolTable
):
(source)
¶
Setup extra, ad-hoc subtyping relationships between classes (promotion). This includes things like 'int' being compatible with 'float'.
Calculate abstract status of a class. Set is_abstract of the type to True if the type has an unimplemented abstract attribute. Also compute a list of abstract attributes. Report error is required ABCMeta metaclass is missing.
Try to infer additional class variables. Subclass attribute assignments with no type annotation are assumed to be classvar if overriding a declared classvar from the base class. This must happen after the main semantic analysis pass, since this depends on base class bodies having been fully analyzed.