4 ms·
All true. But also: > It just turns out that homoiconicity is not hugely useful the large percentage of the time that you don't need metaprogramming, It turn
by zephen 10mo ago
All true.
But also:
> It just turns out that homoiconicity is not hugely useful the large percentage of the time that you don't need metaprogramming,
It turns out that metaprogramming, like anything else, has many possible levels, and that for the shallower levels, Python's reflection, magic methods, and metaclasses suffice without too much heartburn.
- zahlman 10mo agoHonestly I feel like even metaclasses are overused, where class decorators would often suffice.
- zephen 10mo agoThat's probably true, but there are a few reasons for it: - Face it, decorator syntax is kinda ugly - History. Decorator syntax is new - For things which will be repeatedly subclassed, the metaclass automagically tags along But it's almost certainly easier for a maintainer to look at a decorated class and figure out what's going on.