Tag Info

New answers tagged

0

Here is one way to do it, which increments a collections.Counter every time a callable attribute is accessed: class LoggingMixIn: def __init__(self, *args, **kwargs): self._log = Counter() super().__init__(*args, **kwargs) def __getattribute__(self, name): attr = super().__getattribute__(name) if callable(attr): ...



Top 50 recent answers are included