class Class: (source)
Known subclasses: pytype.abstract._classes.InterpreterClass
, pytype.abstract._classes.ParameterizedClass
, pytype.abstract._classes.PyTDClass
, pytype.overlays.metaclass.WithMetaclassInstance
Mix-in to mark all class-like values.
Method | __new__ |
Prevent direct instantiation. |
Method | bases |
Undocumented |
Method | call |
Undocumented |
Method | call |
Undocumented |
Method | call |
Call init_subclass(cls) for all base classes. |
Method | call |
Call the metaclass's __init__ method if it does anything interesting. |
Method | compute |
Sets combined metadata based on inherited and own attrs. |
Method | compute |
Undocumented |
Method | compute |
Compute the class precedence list (mro) according to C3. |
Method | get |
Undocumented |
Method | get |
Get the abstract methods defined by this class. |
Method | get |
Get the attributes defined by this class. |
Method | get |
Get this value's __new__ method, if it isn't object.__new__. |
Method | get |
Fetch a special attribute. |
Method | has |
Undocumented |
Method | has |
Returns whether this class inherits directly from typing.Protocol. |
Method | init |
Mix-in equivalent of __init__. |
Method | is |
Undocumented |
Method | record |
Records the order of attrs to write in the output pyi. |
Method | update |
Update the official name. |
Class Variable | overloads |
Undocumented |
Instance Variable | abstract |
Undocumented |
Instance Variable | additional |
Undocumented |
Instance Variable | cls |
Undocumented |
Instance Variable | metadata |
Undocumented |
Instance Variable | overrides |
Undocumented |
Instance Variable | protocol |
Undocumented |
Property | all |
Undocumented |
Property | annotations |
Undocumented |
Property | is |
Undocumented |
Property | is |
Undocumented |
Property | is |
Undocumented |
Property | is |
Undocumented |
Method | _call |
Undocumented |
Method | _call |
Call __new__ if it has been overridden on the given value. |
Method | _check |
Report [not-instantiable] if the class cannot be instantiated. |
Method | _get |
Traverse the MRO and collect base class attributes for metadata_key. |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Traverse the MRO and collect base class attributes for metadata_key. |
Method | _has |
Undocumented |
Method | _has |
Whether the class should be considered implicitly abstract. |
Method | _init |
Compute this class's abstract methods. |
Method | _init |
Compute and cache whether the class sets its own boolean value. |
Method | _init |
Compute this class's protocol attributes. |
Method | _load |
Load _all_formal_type_parameters. |
Method | _new |
Returns a (possibly cached) instance of 'self'. |
Method | _recompute |
Traverse the MRO and apply Generic type params to class attributes. |
Instance Variable | _all |
Undocumented |
Instance Variable | _all |
Undocumented |
Instance Variable | _instance |
Undocumented |
Instance Variable | _official |
Undocumented |
pytype.abstract._classes.ParameterizedClass
, pytype.overlays.enum_overlay.EnumBuilder
, pytype.overlays.named_tuple.NamedTupleClassBuilder
, pytype.overlays.special_builtins.ClassMethodTemplate
, pytype.overlays.special_builtins.Dict
, pytype.overlays.special_builtins.PropertyTemplate
, pytype.overlays.special_builtins.StaticMethodTemplate
, pytype.overlays.special_builtins.Super
, pytype.overlays.typed_dict.TypedDictBuilder
Undocumented
Sets combined metadata based on inherited and own attrs. Args: own_attrs: The attrs defined explicitly in this class decorator: The fully qualified decorator name Returns: The list of combined attrs.
pytype.abstract._classes.ParameterizedClass
Compute the class precedence list (mro) according to C3.
pytype.abstract._classes.InterpreterClass
, pytype.abstract._classes.ParameterizedClass
, pytype.abstract._classes.PyTDClass
, pytype.overlays.metaclass.WithMetaclassInstance
Get the abstract methods defined by this class.
pytype.abstract._classes.InterpreterClass
, pytype.abstract._classes.ParameterizedClass
, pytype.abstract._classes.PyTDClass
, pytype.overlays.metaclass.WithMetaclassInstance
Get the attributes defined by this class.
Get this value's __new__ method, if it isn't object.__new__. Args: node: The current node. value: A cfg.Binding containing this value. Returns: A tuple of (1) a node and (2) either a cfg.Variable of the special __new__ method, or None.
pytype.abstract._classes.CallableClass
, pytype.abstract._classes.TupleClass
, pytype.overlays.special_builtins.Object
, pytype.overlays.subprocess_overlay.Popen
Fetch a special attribute.
pytype.abstract._classes.InterpreterClass
, pytype.abstract._classes.ParameterizedClass
, pytype.abstract._classes.PyTDClass
Returns whether this class inherits directly from typing.Protocol. Subclasses that may inherit from Protocol should override this method.