pg.Diff¶
Accessible via pg.Diff
, pg.symbolic.Diff
.
- class Diff(left=MISSING, right=MISSING, children={})[source]¶
Bases:
pg.PureSymbolic
,pg.Object
A value diff between two objects: a ‘left’ object and a ‘right’ object.
If one of them is missing, it may be represented by pg.Diff.MISSING
For example:
>>> pg.Diff(3.14, 1.618) Diff(left=3.14, right=1.618) >>> pg.Diff('hello world', pg.Diff.MISSING) Diff(left='hello world', right=MISSING)
Methods:
format
([compact, verbose, root_indent])Override format to conditionally print the shared value or the diff.
sym_eq
(other)Override symbolic equality.
Attributes:
Returns True if current Diff does not contain inner Diff object.
Returns the value if left and right are the same.