ModificationTracker

A simple class to wrap an object to track when it is accessed or modified

 

__init__(self, obj, handlers=<ModificationTypeHandler.Log: 'log'>, logger=None): 

 

@property
handler_dispatch(self): 

 

log_modification(self, obj, handler_type, *args, **kwargs): 

Logs on modification

  • obj: Any
  • handler_type: Any
  • args: Any
  • kwargs: Any
  • :returns: _

 

raise_modification(self, obj, handler_type, *args, **kwargs): 

Raises an error on modification

  • obj: Any
  • handler_type: Any
  • args: Any
  • kwargs: Any
  • :returns: _

 

__getattr__(self, item): 

Handler to intercept getattr requests

  • item: Any
  • :returns: _

 

__setattr__(self, item, val): 

Handler to intercept setattr requests

  • item: Any
  • val: Any
  • :returns: _

 

__iadd__(self, other): 

Handler to intercept add requests

  • item: Any
  • val: Any
  • :returns: _

 

__isub__(self, other): 

Handler to intercept sub requests

  • item: Any
  • val: Any
  • :returns: _

 

__imul__(self, other): 

Handler to intercept div requests

  • item: Any
  • val: Any
  • :returns: _

 

__idiv__(self, other): 

Handler to intercept div requests

  • item: Any
  • val: Any
  • :returns: _

 

__imatmul__(self, other): 

Handler to intercept matmul requests

  • item: Any
  • val: Any
  • :returns: _

Feedback

Examples

Templates

Documentation