logoalt Hacker News

ojii04/21/20251 replyview on HN

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.


Replies

backprojection04/21/2025

They also don’t have to act on callables, see @dataclass for instance.

show 1 reply