pg.track_origin#
Accessible via pg.track_origin
, pg.symbolic.track_origin
.
- track_origin(enabled=True)[source]#
Returns a context manager to enable or disable origin tracking.
track_origin is thread-safe and can be nested. For example:
a = pg.Dict(x=1) with pg.track_origin(False): with pg.track_origin(True): # b's origin will be tracked, which can be accessed by `b.sym_origin`. b = a.clone() # c's origin will not be tracked, `c.sym_origin` returns None. c = a.clone()
- Return type:
- Parameters:
enabled – If True, the origin of symbolic values will be tracked during object cloning and retuning from functors under current scope.
- Returns:
A context manager for enable or disable origin tracking.