diff --git a/README.md b/README.md index ecb4bec..6112552 100644 --- a/README.md +++ b/README.md @@ -152,12 +152,7 @@ On multi-threaded apps identify which thread are snooped in output: PySnooper supports decorating generators. -If the decorator is applied to a class, PySnooper will decorate all of its instance methods. If you use this feature, you should be aware -of the behaviour when snooping on decorated functions: - -* If any methods have existing decorators, and those decorators return functions, it is the decorated method that will be snooped. -* Some decorators do not return functions (rather, they return an instance of a class with a `__call__` method). - This includes the `@property` builtin. In these cases, the decorated method will not be snooped at all. +If you decorate a class with `snoop`, it'll automatically apply the decorator to all the methods. (Not including properties and other special cases.) You can also customize the repr of an object: diff --git a/pysnooper/tracer.py b/pysnooper/tracer.py index 0be0bba..6d76685 100644 --- a/pysnooper/tracer.py +++ b/pysnooper/tracer.py @@ -225,7 +225,7 @@ class Tracer: def __call__(self, function_or_class): if DISABLED: - return function + return function_or_class if inspect.isclass(function_or_class): return self._wrap_class(function_or_class)