2 ms·
I honestly love macros, so I would probably use that feature much more frequently than decorators (if it's even approved, I would expect a lot of macro requests
by ddragon 6y ago
I honestly love macros, so I would probably use that feature much more frequently than decorators (if it's even approved, I would expect a lot of macro requests for Python over it's history), but this seems like something that should have done early and instead of all those mechanisms created for metaprogramming already that would now compete for usage (unless they are implicitly deprecated and macros become the "one obvious way of doing"). And will they tempt changes to the already mature interface of so many libraries like flask, django, numpy, pandas, tensorflow 2 making yet another way of doing stuff (since they can't break all past code)?
And in general, non-lisp languages with macros like Elixir even recommend never using them until exhausting all alternatives. Macros always break expectations (if it didn't you wouldn't use them), compose poorly, hard to debug without adequate tools and requires a lot more documentation. Great for removing boilerplate though, which is my main usage.