class documentation

Representation of Python 'list' objects.

Method __init__ Initialize a SimpleValue.
Method __repr__ Undocumented
Method get_fullhash Undocumented
Method getitem_slot Implements __getitem__ for List.
Method getslice_slot Implements __getslice__ for List.
Method merge_instance_type_parameter Set the value of a type parameter.
Method str_of_constant Get a string representation of this constant.
Instance Variable is_concrete Undocumented
Method _get_index Helper function for getslice_slot that extracts int or None from data.
Instance Variable _instance_cache Undocumented

Inherited from Instance:

Instance Variable cls Undocumented
Property full_name Undocumented
Property instance_type_parameters Undocumented
Method _load_instance_type_parameters Undocumented
Instance Variable _container Undocumented
Instance Variable _instance_type_parameters Undocumented
Instance Variable _instance_type_parameters_loaded Undocumented

Inherited from SimpleValue (via Instance):

Method argcount Returns the minimum number of arguments needed for a call.
Method call Call this abstract value with the given arguments.
Method cls.setter Undocumented
Method get_instance_type_parameter Get a cfg.Variable of the instance's values for the type parameter.
Method get_type_key Build a key from the information used to perform type matching.
Method has_instance_type_parameter Check if the key is in `instance_type_parameters`.
Method instantiate Create an instance of self.
Method maybe_missing_members.setter Undocumented
Method set_class Set the __class__ of an instance, for code that does "x.__class__ = y.
Method update_caches Undocumented
Instance Variable members Undocumented
Property maybe_missing_members Undocumented
Method _call_helper Undocumented
Method _get_changestamps Undocumented
Method _get_class Undocumented
Method _unique_parameters Get unique parameter subtypes as variables.
Instance Variable _cached_changestamps Undocumented
Instance Variable _cls Undocumented
Instance Variable _fullhash Undocumented
Instance Variable _maybe_missing_members Undocumented
Instance Variable _type_key Undocumented

Inherited from BaseValue (via Instance, SimpleValue):

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_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_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 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_decorated Undocumented
Instance Variable mro Undocumented
Instance Variable name Undocumented
Instance Variable slots Undocumented
Property all_template_names 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 Instance, SimpleValue, BaseValue):

Class Variable __slots__ Undocumented
Instance Variable ctx_weakref Undocumented
Property ctx Undocumented

Inherited from HasSlots (via Instance, SimpleValue, BaseValue, ContextWeakrefMixin):

Method call_pytd Call the (original) pytd version of a method we overwrote.
Method init_mixin Undocumented
Method set_native_slot Add a new NativeFunction slot to this value.
Method set_slot Add a new slot to this value.
Class Variable overloads Undocumented
Instance Variable _slots Undocumented
Instance Variable _super Undocumented

Inherited from PythonConstant (via Instance, SimpleValue, BaseValue, ContextWeakrefMixin, HasSlots):

Instance Variable pyval Undocumented
Instance Variable _printing Undocumented
def __init__(self, content, ctx): (source)

Initialize a SimpleValue. Args: name: Name of this value. For debugging and error reporting. ctx: The abstract context.

def get_fullhash(self, seen=None): (source)
def getitem_slot(self, node, index_var): (source)

Implements __getitem__ for List. Arguments: node: The current CFG node. index_var: The Variable containing the index value, the i in lst[i]. Returns: Tuple of (node, return_variable). node may be the same as the argument. return_variable is a Variable with bindings of the possible return values.

def getslice_slot(self, node, start_var, end_var): (source)

Implements __getslice__ for List. Arguments: node: The current CFG node. start_var: A Variable containing the i in lst[i:j]. end_var: A Variable containing the j in lst[i:j]. Returns: Tuple of (node, return_variable). node may be the same as the argument. return_variable is a Variable with bindings of the possible return values.

def merge_instance_type_parameter(self, node, name, value): (source)

Set the value of a type parameter. This will always add to the type parameter unlike set_attribute which will replace value from the same basic block. This is because type parameters may be affected by a side effect so we need to collect all the information regardless of multiple assignments in one basic block. Args: node: Optionally, the current CFG node. name: The name of the type parameter. value: The value that is being used for this type parameter as a Variable.

def str_of_constant(self, printer): (source)

Get a string representation of this constant. Args: printer: A BaseValue -> str function that will be used to print abstract values. Returns: A string of self.pyval.

def _get_index(self, data): (source)

Helper function for getslice_slot that extracts int or None from data. If data is an Instance of int, None is returned. Args: data: The object to extract from. Usually a ConcreteValue or an Instance. Returns: The value (an int or None) of the index. Raises: abstract_utils.ConversionError: If the data could not be converted.

_instance_cache: dict = (source)

Undocumented