class documentation
class Bool(BaseNode, InvertCondMixin): (source)
Bool wrapper normally used when in Boolean context (e.g. the conditions in `if` stmt). Python implicitly called bool() on the boolean context, in the inference systems, we'll need to know when is the value should be use in boolean context. The Bool is created during rewriting of the tree.
Class Method | wrap |
Undocumented |
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | postinit |
Undocumented |
Instance Variable | value |
Undocumented |
Class Variable | _fields |
Undocumented |
Class Variable | _other |
Undocumented |
Inherited from BaseNode
:
Static Method | get |
Undocumented |
Method | __contains__ |
Undocumented |
Method | accept |
Undocumented |
Method | dunder |
try to resolve the dunder method |
Method | generic |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
find the definition of `var` from outer scope recursively. Skip param will determine how many parent scope to skip :param var: variable of interest :param skip: how many layer of parent scope to skip :return:... |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
get the assigning target instance rather than scope(). See #mr68u a.b.c = node calling node.get_target_instance() will return `a.b.c.instance()` |
Method | is |
check if the given node is part of 'self' or children |
Method | iter |
Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` that is present on *node*. |
Method | prepare |
Undocumented |
Method | scope |
return the first containing scope |
Method | statement |
Undocumented |
Instance Variable | col |
Undocumented |
Instance Variable | explicit |
Undocumented |
Instance Variable | lineno |
Undocumented |
Instance Variable | parent |
Undocumented |
Instance Variable | refer |
Undocumented |
Inherited from InvertCondMixin
(via BaseNode
):
Method | invert |
Invert the condition of this node. wrap the node in `not()` |
Method | wrap |
Undocumented |