You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's VarsPrinter and VarsSnooper but they can't handle well this usecase: find out when a specific field or variable changes, perhaps even to a certain value.
There is a question of disallowing name and object at the same time. Perhaps allow it but make it mean "if object is object and variable name is name".
Another problem is if type is a string or the actual type.
Trigger condition: state[<criteria>] != new_id and (value(new_value) if callable(value) else value == new_value). Need to note that value == new_value is a potentially dangerous side-effect incurring operation.
Activity
ionelmc commentedon Mar 30, 2020
Idea 1 - implement an ID tracker (don't poke around in objects):
state[event.code, name] = id(event.locals[name])state[event.code, name, attr] = id(event.locals[name].__dict__[attr])for name in event.locals: if type(event.locals[name]).__name__ == klass: state[klass, attr] = id(event.locals[name].__dict__[attr])for name in event.locals: state[event.code, name] = id(event.locals[name])state[id(inst), attr] = id(inst.__dict__[attr])Trigger condition:
state[<criteria>] != new_id and (value(new_value) if callable(value) else value == new_value). Need to note thatvalue == new_valueis a potentially dangerous side-effect incurring operation.