class documentation

A list of types. Used for parameter matching. Attributes: options: Iterable of instances of BaseValue.

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 get_formal_type_parameter Get the class's type for the type parameter.
Method get_inner_types Undocumented
Method getitem_slot Custom __getitem__ implementation.
Method instantiate Create an instance of self.
Method replace Undocumented
Method update_inner_type Undocumented
Instance Variable cls Undocumented
Instance Variable options Undocumented
Method _get_class Undocumented
Method _unique_parameters Get unique parameter subtypes as variables.
Instance Variable _instance_cache Undocumented
Instance Variable _printing Undocumented

Inherited from BaseValue:

Method argcount Returns the minimum number of arguments needed for a call.
Method compute_mro Undocumented
Method default_mro Undocumented
Method get_default_fullhash Undocumented
Method get_default_type_key Gets a default type key. See get_type_key.
Method get_fullhash Undocumented
Method get_instance_type Get the type an instance of us would have.
Method get_instance_type_parameter Get a cfg.Variable of the instance's values for the type parameter.
Method get_own_new Get this value's __new__ method, if it isn't object.__new__.
Method get_special_attribute Fetch a special attribute (e.g., __get__, __iter__).
Method get_type_key Build a key from the information used to perform type matching.
Method has_kwargs Return True if this is a function and has a **kwargs parameter.
Method has_varargs Return True if this is a function and has a *args parameter.
Method init_subclass Allow metaprogramming via __init_subclass__.
Method is_late_annotation Undocumented
Method module.setter Undocumented
Method official_name.setter Undocumented
Method property_get Bind this value to the given self or cls.
Method register_instance Treating self as a class definition, register an instance of it.
Method should_replace_self_annot Undocumented
Method to_annotation_container Undocumented
Method to_binding Undocumented
Method to_pytd_def Get a PyTD definition for this object.
Method to_type Get a PyTD type representing this object, as seen at a node.
Method to_variable Build a variable out of this abstract value.
Method unique_parameter_values Get unique parameter subtypes as bindings.
Method update_official_name Update the official name.
Class Variable formal Undocumented
Instance Variable final Undocumented
Instance Variable from_annotation Undocumented
Instance Variable is_concrete Undocumented
Instance Variable is_decorated Undocumented
Instance Variable mro Undocumented
Instance Variable name Undocumented
Instance Variable slots Undocumented
Property all_template_names Undocumented
Property full_name Undocumented
Property module Undocumented
Property official_name Undocumented
Property template Undocumented
Instance Variable _all_template_names Undocumented
Instance Variable _instance Undocumented
Instance Variable _module Undocumented
Instance Variable _official_name Undocumented
Instance Variable _template Undocumented

Inherited from ContextWeakrefMixin (via BaseValue):

Class Variable __slots__ Undocumented
Instance Variable ctx_weakref Undocumented
Property ctx Undocumented

Inherited from NestedAnnotation (via BaseValue, ContextWeakrefMixin):

Method init_mixin Undocumented
Class Variable overloads Undocumented
Instance Variable processed Undocumented
Instance Variable _seen_for_formal Undocumented

Inherited from HasSlots (via BaseValue, ContextWeakrefMixin, NestedAnnotation):

Method call_pytd Call the (original) pytd version of a method we overwrote.
Method set_native_slot Add a new NativeFunction slot to this value.
Method set_slot Add a new slot to this value.
Instance Variable _slots Undocumented
Instance Variable _super Undocumented
def __eq__(self, other): (source)

Undocumented

def __hash__(self): (source)

Undocumented

def __init__(self, options, ctx): (source)

Basic initializer for all BaseValues.

def __ne__(self, other): (source)

Undocumented

def __repr__(self): (source)
def call(self, node, func, args, alias_map=None): (source)

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).

def get_formal_type_parameter(self, t): (source)

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.

def get_inner_types(self): (source)
def getitem_slot(self, node, slice_var): (source)

Custom __getitem__ implementation.

def instantiate(self, node, container=None): (source)

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.

def replace(self, inner_types): (source)
def update_inner_type(self, key, typ): (source)

Undocumented

def _get_class(self): (source)

Undocumented

def _unique_parameters(self): (source)

Get unique parameter subtypes as variables. This will retrieve 'children' of this value that contribute to the type of it. So it will retrieve type parameters, but not attributes. To keep the number of possible combinations reasonable, when we encounter multiple instances of the same type, we include only one. Returns: A list of variables.

_instance_cache: dict = (source)

Undocumented

_printing: bool = (source)

Undocumented