class CallTracer(vm.VirtualMachine): (source)
Virtual machine that records all function calls.
Method | __init__ |
Construct a TypegraphVirtualMachine. |
Method | analyze |
Undocumented |
Method | analyze |
Undocumented |
Method | analyze |
Undocumented |
Method | analyze |
Undocumented |
Method | analyze |
Undocumented |
Method | bind |
Undocumented |
Method | call |
Call a function. |
Method | call |
Undocumented |
Method | call |
Attempt to call the given function with made-up arguments. |
Method | compute |
Undocumented |
Method | create |
Undocumented |
Method | create |
Create arguments for the given method. |
Method | create |
Undocumented |
Method | init |
Instantiate a class, and also call __init__. |
Method | maybe |
Undocumented |
Method | pytd |
Undocumented |
Method | pytd |
Undocumented |
Method | pytd |
Undocumented |
Method | pytd |
Undocumented |
Method | reinitialize |
Undocumented |
Method | trace |
Add an entry into the call trace. |
Method | trace |
Undocumented |
Method | trace |
Undocumented |
Method | trace |
Fired whenever we create a variable containing 'Unknown'. |
Static Method | _call |
Undocumented |
Method | _call |
Undocumented |
Method | _call |
Undocumented |
Method | _call |
Undocumented |
Method | _check |
Undocumented |
Method | _instantiate |
Instantiate a class binding. |
Method | _instantiate |
Build an (dummy) instance from a class, for analyzing it. |
Method | _is |
Undocumented |
Method | _is |
Undocumented |
Method | _mark |
Set maybe_missing_members to True on these values and their type params. |
Method | _maybe |
Undocumented |
Method | _maybe |
Undocumented |
Method | _should |
Undocumented |
Method | _skip |
Undocumented |
Constant | _CONSTRUCTORS |
Undocumented |
Instance Variable | _analyzed |
Undocumented |
Instance Variable | _analyzed |
Undocumented |
Instance Variable | _analyzing |
Undocumented |
Instance Variable | _calls |
Undocumented |
Instance Variable | _initialized |
Undocumented |
Instance Variable | _instance |
Undocumented |
Instance Variable | _interpreter |
Undocumented |
Instance Variable | _interpreter |
Undocumented |
Instance Variable | _maximum |
Undocumented |
Instance Variable | _method |
Undocumented |
Instance Variable | _unknowns |
Undocumented |
Inherited from VirtualMachine
:
Exception |
|
Undocumented |
Method | binary |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the BEFORE_ASYNC_WITH opcode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Build a dictionary. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Call a function. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Pops top-of-stack and uses it to update the dict at stack[op.arg]. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the END_FINALLY opcode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the GET_AITER opcode. |
Method | byte_ |
Implementation of the GET_ANEXT opcode. |
Method | byte_ |
Implementation of the GET_AWAITABLE opcode. |
Method | byte_ |
Get the iterator for an object. |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the GET_YIELD_FROM_ITER opcode. |
Method | byte_ |
IMPORT_FROM is mostly like LOAD_ATTR but doesn't pop the container. |
Method | byte_ |
Import a single module. |
Method | byte_ |
Pops a module and stores all its contents in locals(). |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Pops top-of-stack and uses it to extend the list at stack[op.arg]. |
Method | byte_ |
Convert the list at the top of the stack to a tuple. |
Method | byte_ |
Undocumented |
Method | byte_ |
Pop an object, and retrieve a named attribute from it. |
Method | byte_ |
Undocumented |
Method | byte_ |
Retrieves a value out of either locals or a closure cell. |
Method | byte_ |
Retrieves a value out of a cell. |
Method | byte_ |
Undocumented |
Method | byte_ |
Retrieves a value out of a cell. |
Method | byte_ |
Load a local. Unlike LOAD_NAME, it doesn't fall back to globals. |
Method | byte_ |
Undocumented |
Method | byte_ |
Load a global variable, or fall back to trying to load a builtin. |
Method | byte_ |
Implementation of the LOAD_METHOD opcode. |
Method | byte_ |
Load a name. Can be a local, global, or builtin. |
Method | byte_ |
Undocumented |
Method | byte_ |
Make a function that binds local variables. |
Method | byte_ |
Create a function and push it onto the stack. |
Method | byte_ |
Implements the MAP_ADD opcode. |
Method | byte_ |
Implementation of the MATCH_CLASS opcode. |
Method | byte_ |
Implementation of the MATCH_KEYS opcode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implements POP_FINALLY. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Raise an exception. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Get and check the return value. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Sets up variable annotations in locals(). |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implements the SETUP_FINALLY opcode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Starts a 'with' statement. Will push a block. |
Method | byte_ |
Implementation of the STORE_ANNOTATION opcode. |
Method | byte_ |
Store an attribute. |
Method | byte_ |
Stores a value in a closure cell. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implement obj[subscr] = val. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implement the UNARY_NOT bytecode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Called to finish cleaning up a with block. |
Method | byte_ |
Called to start cleaning up a with block. Calls the exit handlers etc. |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the YIELD_FROM opcode. |
Method | byte_ |
Yield a value from a generator. |
Method | call |
Pop arguments for a function and call it. |
Method | call |
Call a function with the given state. |
Method | compile |
Compile the given source code. |
Method | del |
Delete an attribute. |
Method | del |
Undocumented |
Method | expand |
Common functionality for 'is' and 'is not'. |
Method | flatten |
Undocumented |
Method | generate |
Undocumented |
Method | get |
Undocumented |
Method | get |
Get a real python dict of the globals. |
Method | get |
Get the python variable name corresponding to a Variable. |
Method | import |
Import a module and return the module object or None. |
Method | inplace |
Undocumented |
Method | is |
Undocumented |
Method | is |
Check whether op is equivalent to a SETUP_EXCEPT opcode. |
Method | load |
Try loading an attribute, and report errors. |
Method | load |
Try loading an attribute, ignore errors. |
Method | load |
Undocumented |
Method | load |
Undocumented |
Method | load |
Load an item out of locals, globals, or builtins. |
Method | load |
Undocumented |
Method | load |
Called when a local is loaded onto the stack. |
Method | load |
Undocumented |
Method | make |
Create a new frame object, using the given args, globals and locals. |
Method | pop |
Undocumented |
Method | pop |
Retrieve a kwargs dictionary from the stack. Used by call_function. |
Method | pop |
Retrieve a varargs tuple from the stack. Used by call_function. |
Method | push |
Undocumented |
Method | push |
Undocumented |
Method | remaining |
Undocumented |
Method | resume |
Undocumented |
Method | run |
Run the given bytecode. |
Method | run |
Run a frame (typically belonging to a method). |
Method | run |
Run a single bytecode instruction. |
Method | run |
Run the code and return the CFG nodes. |
Method | set |
Undocumented |
Method | simple |
Get a stack of simple frames. |
Method | stack |
Get a frame stack for the given function for error reporting. |
Method | store |
Set an attribute on an object. |
Method | store |
Undocumented |
Method | store |
Called when a local is written. |
Method | store |
Undocumented |
Method | trace |
Record trace data for other tools to use. |
Method | unary |
Undocumented |
Instance Variable | annotated |
Undocumented |
Instance Variable | ctx |
Undocumented |
Instance Variable | filename |
Undocumented |
Instance Variable | frame |
Undocumented |
Instance Variable | frames |
Undocumented |
Instance Variable | functions |
Undocumented |
Instance Variable | has |
Undocumented |
Instance Variable | late |
Undocumented |
Instance Variable | loaded |
Undocumented |
Instance Variable | local |
Undocumented |
Instance Variable | opcode |
Undocumented |
Property | current |
Undocumented |
Property | current |
Undocumented |
Property | current |
Undocumented |
Property | current |
Undocumented |
Method | _apply |
Applies the type annotation, if any, associated with this object. |
Method | _attribute |
Undocumented |
Method | _call |
Undocumented |
Method | _check |
Narrow the types of variables based on test assertions. |
Method | _cmp |
Implementation of CMP_IN/CMP_NOT_IN. |
Method | _cmp |
Checks if the comparison should always succeed. |
Method | _cmp |
Implementation of relational operators CMP_(LT|LE|EQ|NE|GE|GT). |
Method | _coerce |
Coerce the values in a variable to bools. |
Method | _compare |
Pops and compares the top two stack values and pushes a boolean. |
Method | _convert |
Undocumented |
Method | _data |
Undocumented |
Method | _del |
Called when a local or global is deleted. |
Method | _delete |
Undocumented |
Method | _filter |
Paste the bindings into var, filtering out false positives on None. |
Method | _get |
Get an async iterator from an object. |
Method | _get |
Get closure annotations and defaults from the stack. |
Method | _get |
Get function annotations and defaults from the stack. |
Method | _get |
Get an iterator from a sequence. |
Method | _get |
Helper function for _unpack_sequence. |
Method | _get |
Grabs the __annotations__ dict, if any, with the attribute type. |
Method | _has |
Whether the binding has any possible origins, with None filtering. |
Method | _import |
Import the module and return the module object. |
Method | _instantiate |
Instantiate an exception type. |
Method | _is |
True if var is the first arg of a class method in the current frame. |
Method | _is |
Undocumented |
Method | _load |
Undocumented |
Method | _maybe |
Check if a module path is in the overlay dictionary. |
Method | _name |
Returns a late annotation or returns Any and logs a name error. |
Method | _narrow |
Narrow a variable by removing bindings that do not satisfy pred. |
Method | _pop |
Pop a value off the stack and store it in a variable. |
Method | _process |
Process any type annotations in the named value. |
Method | _record |
Undocumented |
Method | _record |
Record a store_subscr to an __annotations__ dict. |
Method | _record |
Record a type annotation on a local variable. |
Method | _replace |
Replace unknowns added by push_abstract_exception with precise values. |
Method | _restructure |
Collapse the middle part of a tuple into a List variable. |
Method | _retrieve |
Load an attribute from an object. |
Method | _revert |
Undocumented |
Method | _set |
Undocumented |
Method | _set |
Undocumented |
Method | _setup |
Sets up an except block. |
Method | _store |
Assign a new var to a variable in locals. |
Method | _store |
Store 'value' under 'name'. |
Method | _suppress |
Undocumented |
Method | _unpack |
Pops a tuple (or other iterable) and pushes it onto the VM's stack. |
Method | _update |
Undocumented |
Method | _var |
Undocumented |
Method | _with |
Implements WITH_CLEANUP_START before Python 3.8. |
Method | _with |
Implements WITH_CLEANUP_START in Python 3.8+. |
Instance Variable | _branch |
Undocumented |
Instance Variable | _director |
Undocumented |
Instance Variable | _importing |
Undocumented |
Instance Variable | _late |
Undocumented |
Instance Variable | _trace |
Undocumented |
Instance Variable | _var |
Undocumented |
Call a function. Args: node: The given node. val: A cfg.Binding containing the function. args: A function.Args object. Returns: A tuple of (1) a node and (2) a cfg.Variable of the return value.
Create arguments for the given method. Creates Unknown objects as arguments for the given method. Note that we don't need to take parameter annotations into account as InterpreterFunction.call() will take care of that. Args: node: The current node. method: An abstract.InterpreterFunction. use_defaults: Whether to use parameter defaults for arguments. When True, unknown arguments are created with force=False, as it is fine to use Unsolvable rather than Unknown objects for type-checking defaults. Returns: A tuple of a node and a function.Args object.
pytype.vm.VirtualMachine.init_class
Instantiate a class, and also call __init__. Calling __init__ can be expensive, so this method caches its created instances. If you don't need __init__ called, use cls.instantiate instead. Args: node: The current node. cls: The class to instantiate. container: Optionally, a container to pass to the class's instantiate() method, so that type parameters in the container's template are instantiated to TypeParameterInstance. extra_key: Optionally, extra information about the location at which the instantion occurs. By default, this method keys on the current opcode and the class, which sometimes isn't enough to disambiguate callers that shouldn't get back the same cached instance. Returns: A tuple of node and instance variable.
pytype.vm.VirtualMachine.trace_call
Add an entry into the call trace. Args: node: The CFG node right after this function call. func: A cfg.Binding of a function that was called. sigs: The signatures that the function might have been called with. posargs: The positional arguments, an iterable over cfg.Variable. namedargs: The keyword arguments, a dict mapping str to cfg.Variable. result: A Variable of the possible result values.
pytype.vm.VirtualMachine.trace_unknown
Fired whenever we create a variable containing 'Unknown'.
Set maybe_missing_members to True on these values and their type params. Args: values: A list of BaseValue objects. On every instance among the values, recursively set maybe_missing_members to True on the instance and its type parameters.