class _Eq(BooleanTerm): (source)
An equality constraint. This declares an equality between a variable and a value, or a variable and a variable. External code should use Eq rather than creating an _Eq instance directly. Attributes: left: A string; left side of the equality. This is expected to be the string with the higher ascii value, so e.g. strings starting with "~" (ascii 0x7e) should be on the left. right: A string; right side of the equality. This is the lower ascii value.
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __init__ |
Initialize an equality. |
Method | __ne__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | extract |
Find all equalities that appear in this term. |
Method | extract |
Extract the pivots. See BooleanTerm.extract_pivots(). |
Method | simplify |
Simplify this equality. |
Class Variable | __slots__ |
Undocumented |
Instance Variable | left |
Undocumented |
Instance Variable | right |
Undocumented |
Initialize an equality. Args: left: A string. Left side of the equality. right: A string. Right side of the equality.
Find all equalities that appear in this term. Returns: A sequence of tuples of a string (variable name) and a string (value or variable name).
pytype.pytd.booleq.BooleanTerm.simplify
Simplify this equality. This will try to look up the values, and return FALSE if they're no longer possible. Also, when comparing two variables, it will compute the intersection, and return a disjunction of variable=value equalities instead. Args: assignments: Variable assignments (dict mapping strings to sets of strings). Used to determine whether this equality is still possible, and to compute intersections between two variables. Returns: A new BooleanTerm.