6 ms·
One tiny correction: > decorators are functions that take a callable argument and return a new callable there's nothing forcing a decorator to return a callab
by ojii 1y ago
One tiny correction:
> decorators are functions that take a callable argument and return a new callable
there's nothing forcing a decorator to return a callable. A decorator _could_ return anything it wants. I don't know why you would want that, but Python won't stop you.
- backprojection 1y agoThey also don’t have to act on callables, see @dataclass for instance.