logoalt Hacker News

maleldil04/23/20252 repliesview on HN

This is about Python decorators: https://docs.python.org/3/glossary.html#term-decorator. In summary, they are functions that return functions, which allow you to wrap their behaviour (e.g. add a cache, transform a function into an HTTP API handler, etc.)

As far as I can tell, they're not related to the design pattern, but I never had to use that.


Replies

F-W-M04/23/2025

They implement the design pattern.

show 1 reply
pipes04/25/2025

Thanks