Understanding Decorators in Python(bas.codes)
bas.codes
Understanding Decorators in Python
https://bas.codes/posts/python-decorators/
4 comments
> they could just use OOP composition to get the same thing and not have to invent a new kind of thing: it would all just be objects referencing objects.
Aren't decorators just syntactic sugar for composition?
Aren't decorators just syntactic sugar for composition?
True, it's hard to just throw everything out and start over, but at least recognize the problem so that next generation of languages can solve/avoid it.
Removing or softening the distinction between object and class is perhaps a start.