class documentation

Representation of unknown values. These are e.g. the return values of certain functions (e.g. eval()). They "adapt": E.g. they'll respond to get_attribute requests by creating that attribute. Attributes: members: Attributes that were written or read so far. Mapping of str to cfg.Variable. owner: cfg.Binding that contains this instance as data.

Method __init__ Basic initializer for all BaseValues.
Method argcount Returns the minimum number of arguments needed for a call.
Method call Call this abstract value with the given arguments.
Method compute_mro Undocumented
Method get_fullhash Undocumented
Method get_special_attribute Fetch a special attribute (e.g., __get__, __iter__).
Method instantiate Create an instance of self.
Method to_structural_def Convert this Unknown to a pytd.Class.
Method to_variable Build a variable out of this abstract value.
Constant IGNORED_ATTRIBUTES Undocumented
Instance Variable class_name Undocumented
Instance Variable members Undocumented
Instance Variable owner Undocumented
Class Method _make_params Convert a list of types/variables to pytd parameters.
Class Method _to_pytd Undocumented
Class Variable _current_id Undocumented
Instance Variable _calls Undocumented

Inherited from BaseValue:

Method __repr__ 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_formal_type_parameter Get the class's type for the type parameter.
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_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 unique_parameter_values Get unique parameter subtypes as bindings.
Method update_official_name Update the official name.
Class Variable formal Undocumented
Instance Variable cls 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
Method _unique_parameters Get unique parameter subtypes as variables.
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
def __init__(self, ctx): (source)

Basic initializer for all BaseValues.

def argcount(self, _): (source)

Returns the minimum number of arguments needed for a call.

def call(self, node, _, 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 compute_mro(self): (source)
def get_fullhash(self, seen=None): (source)
def get_special_attribute(self, node, name, valself): (source)

Fetch a special attribute (e.g., __get__, __iter__).

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 to_structural_def(self, node, class_name): (source)

Convert this Unknown to a pytd.Class.

def to_variable(self, node): (source)

Build a variable out of this abstract value. Args: node: The current CFG node. Returns: A cfg.Variable.

IGNORED_ATTRIBUTES: list[str] = (source)

Undocumented

Value
['__get__', '__set__', '__getattribute__']
class_name = (source)

Undocumented

Undocumented

Undocumented

@classmethod
def _make_params(cls, node, args): (source)

Convert a list of types/variables to pytd parameters.

@classmethod
def _to_pytd(cls, node, v): (source)

Undocumented

_current_id: int = (source)

Undocumented

Undocumented