The type structure of a single class.
Each TypeInfo corresponds one-to-one to a ClassDef, which represents the AST of the class.
In type-theory terms, this is a "type constructor", and if the class is generic then it will be a type constructor of higher kind. Where the class is used in an actual type, it's in the form of an Instance, which amounts to a type application of the tycon to the appropriate number of arguments.
Class Method | deserialize |
Undocumented |
Method | __bool__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Initialize a TypeInfo. |
Method | __repr__ |
Undocumented |
Method | __str__ |
Return a string representation of the type. |
Method | add_type_vars |
Undocumented |
Method | calculate_metaclass_type |
Undocumented |
Method | direct_base_classes |
Return a direct base classes. |
Method | dump |
Return a string dump of the contents of the TypeInfo. |
Method | get |
Undocumented |
Method | get_containing_type_info |
Undocumented |
Method | get_method |
Undocumented |
Method | has_base |
Return True if type has a base type with the specified name. |
Method | has_readable_member |
Undocumented |
Method | is_generic |
Is the type generic (i.e. does it have type variables)? |
Method | is_metaclass |
Undocumented |
Method | serialize |
Undocumented |
Constant | FLAGS |
Undocumented |
Class Variable | __slots__ |
Undocumented |
Instance Variable | abstract_attributes |
Undocumented |
Instance Variable | assuming |
Undocumented |
Instance Variable | assuming_proper |
Undocumented |
Instance Variable | bad_mro |
Undocumented |
Instance Variable | bases |
Undocumented |
Instance Variable | declared_metaclass |
Undocumented |
Instance Variable | defn |
Undocumented |
Instance Variable | deletable_attributes |
Undocumented |
Instance Variable | fallback_to_any |
Undocumented |
Instance Variable | inferring |
Undocumented |
Instance Variable | is_abstract |
Undocumented |
Instance Variable | is_enum |
Undocumented |
Instance Variable | is_final |
Undocumented |
Instance Variable | is_intersection |
Undocumented |
Instance Variable | is_named_tuple |
Undocumented |
Instance Variable | is_newtype |
Undocumented |
Instance Variable | is_protocol |
Undocumented |
Instance Variable | metaclass_type |
Undocumented |
Instance Variable | metadata |
Undocumented |
Instance Variable | module_name |
Undocumented |
Instance Variable | mro |
Undocumented |
Instance Variable | names |
Undocumented |
Instance Variable | runtime_protocol |
Undocumented |
Instance Variable | slots |
Undocumented |
Instance Variable | tuple_type |
Undocumented |
Instance Variable | type_vars |
Undocumented |
Instance Variable | typeddict_type |
Undocumented |
Property | fullname |
Undocumented |
Property | name |
Short name. |
Property | protocol_members |
Undocumented |
Instance Variable | _fullname |
Undocumented |
Instance Variable | _mro_refs |
Undocumented |
Instance Variable | _promote |
Undocumented |
Inherited from Node
(via SymbolNode
):
Method | accept |
Undocumented |
Inherited from Context
(via SymbolNode
, Node
):
Method | get_column |
Don't use. Use x.column. |
Method | get_line |
Don't use. Use x.line. |
Method | set_line |
If target is a node, pull line (and column) information into this node. If column is specified, this will override any column information coming from a node. |
Instance Variable | column |
Undocumented |
Instance Variable | end_line |
Undocumented |
Instance Variable | line |
Undocumented |
mypy.nodes.Context.__init__
mypy.nodes.FakeInfo
Parameters | |
names:SymbolTable | Undocumented |
defn:ClassDef | Undocumented |
module_name:str | Undocumented |
mypy.nodes.Node.__str__
Return a string representation of the type.
This includes the most important information about the type.
Returns | |
str | Undocumented |
Return a direct base classes.
Omit base classes of other base classes.
Returns | |
List[ | Undocumented |
Parameters | |
str_conv:Optional[ | Undocumented |
type_str_conv:Optional[ | Undocumented |
Returns | |
str | Undocumented |
Return True if type has a base type with the specified name.
This can be either via extension or via implementation.
Parameters | |
fullname:str | Undocumented |
Returns | |
bool | Undocumented |
Undocumented
Value |
|