4 ms·
I don't see how this is duct-tabing, decorators are very straightforward syntax sugar over Python's everything-is-an-object mentality @decorator some_func is
by Banana699 5y ago
I don't see how this is duct-tabing, decorators are very straightforward syntax sugar over Python's everything-is-an-object mentality
@decorator
some_func
is simply
some_func = decorator(some_func)
There is no C++style "Here is 100 more arcane rules and 1000 exceptions and meta-rules that govern their interaction and application". It's all consistent additions to the language that does nothing but abstract out what you could do by hand but more verbose-ly and error-prone-ly. In fact, nothing in the above comments except type annotations are "language features" at all, they are libraries, and not even implicitly imported at that.
- formerly_proven 5y agoAnd almost nothing of these are actually language features but in the library.