class ParameterizedClass(_base.BaseValue, class_mixin.Class, mixin.NestedAnnotation): (source)
Known subclasses: pytype.abstract._classes.CallableClass
, pytype.abstract._classes.LiteralClass
, pytype.abstract._classes.TupleClass
A class that contains additional parameters. E.g. a container. Attributes: base_cls: The base type. formal_type_parameters: An iterable of BaseValue, one for each type parameter.
Method | __contains__ |
Undocumented |
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __init__ |
Basic initializer for all BaseValues. |
Method | __ne__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | call |
Call this abstract value with the given arguments. |
Method | cls |
Undocumented |
Method | compute |
Compute the class precedence list (mro) according to C3. |
Method | get |
Get the class's type for the type parameter. |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Get the abstract methods defined by this class. |
Method | get |
Get the attributes defined by this class. |
Method | has |
Returns whether this class inherits directly from typing.Protocol. |
Method | instantiate |
Create an instance of self. |
Method | official |
Undocumented |
Method | replace |
Undocumented |
Method | set |
Undocumented |
Method | type |
Throw exception for invalid type parameters. |
Method | update |
Undocumented |
Instance Variable | base |
Undocumented |
Instance Variable | is |
Undocumented |
Instance Variable | module |
Undocumented |
Instance Variable | slots |
Undocumented |
Property | cls |
Undocumented |
Property | formal |
Undocumented |
Property | members |
Undocumented |
Property | official |
Undocumented |
Method | _is |
Undocumented |
Method | _load |
Undocumented |
Method | _raw |
Undocumented |
Instance Variable | _cls |
Undocumented |
Instance Variable | _formal |
Undocumented |
Instance Variable | _formal |
Undocumented |
Instance Variable | _hash |
Undocumented |
Instance Variable | _template |
Undocumented |
Inherited from BaseValue
:
Method | argcount |
Returns the minimum number of arguments needed for a call. |
Method | default |
Undocumented |
Method | get |
Undocumented |
Method | get |
Gets a default type key. See get_type_key. |
Method | get |
Undocumented |
Method | get |
Get the type an instance of us would have. |
Method | get |
Get a cfg.Variable of the instance's values for the type parameter. |
Method | get |
Get this value's __new__ method, if it isn't object.__new__. |
Method | get |
Fetch a special attribute (e.g., __get__, __iter__). |
Method | get |
Build a key from the information used to perform type matching. |
Method | has |
Return True if this is a function and has a **kwargs parameter. |
Method | has |
Return True if this is a function and has a *args parameter. |
Method | init |
Allow metaprogramming via __init_subclass__. |
Method | is |
Undocumented |
Method | module |
Undocumented |
Method | property |
Bind this value to the given self or cls. |
Method | register |
Treating self as a class definition, register an instance of it. |
Method | should |
Undocumented |
Method | to |
Undocumented |
Method | to |
Undocumented |
Method | to |
Get a PyTD definition for this object. |
Method | to |
Get a PyTD type representing this object, as seen at a node. |
Method | to |
Build a variable out of this abstract value. |
Method | unique |
Get unique parameter subtypes as bindings. |
Method | update |
Update the official name. |
Class Variable | formal |
Undocumented |
Instance Variable | final |
Undocumented |
Instance Variable | from |
Undocumented |
Instance Variable | is |
Undocumented |
Instance Variable | is |
Undocumented |
Instance Variable | mro |
Undocumented |
Instance Variable | name |
Undocumented |
Property | all |
Undocumented |
Property | full |
Undocumented |
Property | template |
Undocumented |
Method | _unique |
Get unique parameter subtypes as variables. |
Instance Variable | _all |
Undocumented |
Instance Variable | _instance |
Undocumented |
Instance Variable | _module |
Undocumented |
Instance Variable | _official |
Undocumented |
Inherited from ContextWeakrefMixin
(via BaseValue
):
Class Variable | __slots__ |
Undocumented |
Instance Variable | ctx |
Undocumented |
Property | ctx |
Undocumented |
Inherited from Class
(via BaseValue
, ContextWeakrefMixin
):
Method | __new__ |
Prevent direct instantiation. |
Method | bases |
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 | get |
Undocumented |
Method | has |
Undocumented |
Method | init |
Mix-in equivalent of __init__. |
Method | is |
Undocumented |
Method | record |
Records the order of attrs to write in the output pyi. |
Class Variable | overloads |
Undocumented |
Instance Variable | abstract |
Undocumented |
Instance Variable | additional |
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 |
Inherited from NestedAnnotation
(via BaseValue
, ContextWeakrefMixin
, Class
):
Instance Variable | processed |
Undocumented |
Instance Variable | _seen |
Undocumented |
Union[ PyTDClass, InterpreterClass]
, formal_type_parameters: Union[ abstract_utils.LazyFormalTypeParameters, Dict[ str, _base.BaseValue]]
, ctx: _ContextType
, template: Optional[ Tuple[ _TypeParamType, ...]]
= None):
(source)
¶
pytype.abstract._base.BaseValue.__init__
pytype.abstract._classes.CallableClass
, pytype.abstract._classes.LiteralClass
, pytype.abstract._classes.TupleClass
Basic initializer for all BaseValues.
pytype.abstract._base.BaseValue.__repr__
pytype.abstract._classes.CallableClass
, pytype.abstract._classes.LiteralClass
, pytype.abstract._classes.TupleClass
Undocumented
pytype.abstract._base.BaseValue.call
Call this abstract value with the given arguments. The posargs and namedargs arguments may be modified by this function. Args: node: The CFGNode calling this function func: The cfg.Binding containing this function. args: Arguments for the call. alias_map: A datatypes.UnionFind, which stores all the type renaming information, mapping of type parameter name to its representative. Returns: A tuple (cfg.Node, cfg.Variable). The CFGNode corresponds to the function's "return" statement(s). Raises: function.FailedFunctionCall Make the call as required by this specific kind of atomic value, and make sure to annotate the results correctly with the origins (val and also other values appearing in the arguments).
pytype.abstract._classes.TupleClass
Compute the class precedence list (mro) according to C3.
Get the class's type for the type parameter. Treating self as a class_mixin.Class, gets its formal type for the given type parameter. For the real implementation, see ParameterizedClass.get_formal_type_parameter. Args: t: The name of the type parameter. Returns: A formal type.
Returns whether this class inherits directly from typing.Protocol. Subclasses that may inherit from Protocol should override this method.
Create an instance of self. Note that this method does not call __init__, so the instance may be incomplete. If you need a complete instance, use self.ctx.vm.init_class instead. Args: node: The current node. container: Optionally, the value that contains self. (See TypeParameter.) Returns: The instance.
pytype.abstract._base.BaseValue.slots
pytype.abstract._classes.TupleClass
Undocumented