class AnnotationContainer(AnnotationClass): (source)
Known subclasses: pytype.overlays.typing_overlay.TypingContainer
Implementation of X[...] for annotations.
Method | __init__ |
Initialize a SimpleValue. |
Method | __repr__ |
Undocumented |
Method | call |
Call this abstract value with the given arguments. |
Instance Variable | base |
Undocumented |
Method | _build |
Undocumented |
Method | _get |
Get information about the container's inner values. |
Method | _sub |
Apply type parameter substitutions to an annotation. |
Method | _validate |
Check that the passed inner values are valid for the given template. |
Inherited from AnnotationClass
:
Method | getitem |
Custom __getitem__ implementation. |
Method | _build |
Build the list of parameters. |
Method | _get |
Undocumented |
Inherited from SimpleValue
(via AnnotationClass
):
Method | argcount |
Returns the minimum number of arguments needed for a call. |
Method | cls |
Undocumented |
Method | get |
Undocumented |
Method | get |
Get a cfg.Variable of the instance's values for the type parameter. |
Method | get |
Build a key from the information used to perform type matching. |
Method | has |
Check if the key is in `instance_type_parameters`. |
Method | instantiate |
Create an instance of self. |
Method | maybe |
Undocumented |
Method | merge |
Set the value of a type parameter. |
Method | set |
Set the __class__ of an instance, for code that does "x.__class__ = y. |
Method | update |
Undocumented |
Instance Variable | members |
Undocumented |
Property | cls |
Undocumented |
Property | instance |
Undocumented |
Property | maybe |
Undocumented |
Method | _call |
Undocumented |
Method | _get |
Undocumented |
Method | _unique |
Get unique parameter subtypes as variables. |
Instance Variable | _cached |
Undocumented |
Instance Variable | _cls |
Undocumented |
Instance Variable | _fullhash |
Undocumented |
Instance Variable | _instance |
Undocumented |
Instance Variable | _maybe |
Undocumented |
Instance Variable | _type |
Undocumented |
Inherited from BaseValue
(via AnnotationClass
, SimpleValue
):
Method | compute |
Undocumented |
Method | default |
Undocumented |
Method | get |
Undocumented |
Method | get |
Gets a default type key. See get_type_key. |
Method | get |
Get the class's type for the type parameter. |
Method | get |
Get the type an instance of us would have. |
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 | 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 | official |
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 |
Instance Variable | slots |
Undocumented |
Property | all |
Undocumented |
Property | full |
Undocumented |
Property | module |
Undocumented |
Property | official |
Undocumented |
Property | template |
Undocumented |
Instance Variable | _all |
Undocumented |
Instance Variable | _instance |
Undocumented |
Instance Variable | _module |
Undocumented |
Instance Variable | _official |
Undocumented |
Instance Variable | _template |
Undocumented |
Inherited from ContextWeakrefMixin
(via AnnotationClass
, SimpleValue
, BaseValue
):
Class Variable | __slots__ |
Undocumented |
Instance Variable | ctx |
Undocumented |
Property | ctx |
Undocumented |
Inherited from HasSlots
(via AnnotationClass
, SimpleValue
, BaseValue
, ContextWeakrefMixin
):
Method | call |
Call the (original) pytd version of a method we overwrote. |
Method | init |
Undocumented |
Method | set |
Add a new NativeFunction slot to this value. |
Method | set |
Add a new slot to this value. |
Class Variable | overloads |
Undocumented |
Instance Variable | _slots |
Undocumented |
Instance Variable | _super |
Undocumented |
pytype.overlays.typing_overlay.TypingContainer
Initialize a SimpleValue. Args: name: Name of this value. For debugging and error reporting. ctx: The abstract context.
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).
Tuple[ Tuple[ _Union[ int, str], ...], Tuple[ _base.BaseValue, ...], Type[ _classes.ParameterizedClass]]
:
(source)
¶
pytype.overlays.typing_overlay.Callable
, pytype.overlays.typing_overlay.Generic
, pytype.overlays.typing_overlay.Tuple
Get information about the container's inner values. Args: inner: The list of parameters from _build_inner(). ellipses: The set of ellipsis indices from _build_inner(). allowed_ellipses: Optionally, a set of indices at which ellipses are allowed. If omitted, ellipses are assumed to be never allowed. Returns: A tuple of the template, the parameters, and the container class.
_base.BaseValue
, subst: Mapping[ str, _base.BaseValue]
) -> _base.BaseValue
:
(source)
¶
Apply type parameter substitutions to an annotation.