Function | infer_bool |
Understand bool calls. |
Function | infer_callable |
Understand callable calls |
Function | infer_dict |
Try to infer a dict call to a Dict node. |
Function | infer_dict_fromkeys |
Infer dict.fromkeys |
Function | infer_getattr |
Understand getattr calls |
Function | infer_hasattr |
Understand hasattr calls |
Function | infer_int |
Infer int() calls |
Function | infer_isinstance |
Infer isinstance calls |
Function | infer_issubclass |
Infer issubclass() calls |
Function | infer_len |
Infer length calls |
Function | infer_property |
Understand property class |
Function | infer_slice |
Understand slice calls. |
Function | infer_str |
Infer str() calls |
Function | infer_super |
Understand super calls. |
Function | infer_type |
Understand the one-argument form of type. |
Function | register_builtin_transform |
Register a new transform function for the given builtin_name. |
Constant | BYTES_CLASS |
Undocumented |
Constant | OBJECT_DUNDER_NEW |
Undocumented |
Constant | STR_CLASS |
Undocumented |
Variable | infer_frozenset |
Undocumented |
Variable | infer_list |
Undocumented |
Variable | infer_set |
Undocumented |
Variable | infer_tuple |
Undocumented |
Function | _builtin_filter_predicate |
Undocumented |
Function | _class_or_tuple_to_container |
Undocumented |
Function | _container_generic_inference |
Undocumented |
Function | _container_generic_transform |
Undocumented |
Function | _extend_builtins |
Undocumented |
Function | _extend_string_class |
function to extend builtin str/unicode class |
Function | _get_elts |
Undocumented |
Function | _infer_builtin_container |
Undocumented |
Function | _infer_getattr_args |
Undocumented |
Function | _infer_object__new__decorator |
Undocumented |
Function | _infer_object__new__decorator_check |
Predicate before inference_tip |
Understand callable calls
This follows Python's semantics, where an object is callable if it provides an attribute __call__, even though that attribute is something which can't be called.
Parameters | |
node | Undocumented |
context | Undocumented |
nodes.Call node | dict.fromkeys() call to infer |
context.InferenceContext context | node context |
Returns | |
a Dictionary containing the values that astroid was able to infer. In case the inference failed for any reason, an empty dictionary will be inferred instead. | Undocumented |
Understand getattr calls
If one of the arguments is an Uninferable object, then the result will be an Uninferable object. Otherwise, the normal attribute lookup will be done.
Understand hasattr calls
This always guarantees three possible outcomes for calling hasattr: Const(False) when we are sure that the object doesn't have the intended attribute, Const(True) when we know that the object has the attribute and Uninferable when we are unsure of the outcome of the function call.
Parameters | |
node | Undocumented |
context | Undocumented |
nodes.Call node | int() call to infer |
context.InferenceContext | node context |
Returns | |
a Const containing the integer value of the int() call | Undocumented |
Parameters | |
callnode | Undocumented |
context | Undocumented |
nodes.Call callnode | an isinstance call |
InferenceContext context | context for call (currently unused but is a common interface for inference) |
Returns | |
Boolean Const value of isinstance call | Undocumented |
Raises | |
UseInferenceDefault | If the node cannot be inferred |
Parameters | |
callnode | Undocumented |
context | Undocumented |
nodes.Call callnode | an issubclass call |
InferenceContext context | the context for the inference |
Returns | |
Boolean Const value of the issubclass call | Undocumented |
Raises | |
UseInferenceDefault | If the node cannot be inferred |
Parameters | |
node | Undocumented |
context | Undocumented |
nodes.Call node | len call to infer |
context.InferenceContext | node context |
Returns | |
a Const node with the inferred length, if possible | Undocumented |
Understand property
class
This only infers the output of property
call, not the arguments themselves.
Parameters | |
node | Undocumented |
context | Undocumented |
nodes.Call node | str() call to infer |
context.InferenceContext | node context |
Returns | |
a Const containing an empty string | Undocumented |
Understand super calls.
There are some restrictions for what can be understood:
- unbounded super (one argument form) is not understood.
- if the super call is not inside a function (classmethod or method), then the default inference will be used.
- if the super arguments can't be inferred, the default inference will be used.
Register a new transform function for the given builtin_name.
The transform function must accept two parameters, a node and an optional context.
Undocumented
Value |
|
Undocumented
Value |
|