Discussion about this post

User's avatar
Wyrd Smythe's avatar

Good post, and I'm looking forward to part two. I love decorators in Python. They were a bit tricky to figure out from the manual, but doing it sure opened the door to some great tricks. I've used them as timing wrappers for functions, recording both the count of times called and the total time used in the function (or functions). And I love how you can add attributes and methods to the decorator itself, giving some access to its internals (like how @property does).

Expand full comment

No posts