| This oft-repeated quote is always relevant on Python metaclass posts: “[Metaclasses] are deeper magic than 99% of users should ever worry about. If you wonder whether you need them, you don’t (the people who actually need them know with certainty that they need them, and don’t need an explanation about why).” Tim Peters, Inventor of the timsort algorithm and prolific Python contributor https://www.oreilly.com/library/view/fluent-python/978149194... https://en.m.wikipedia.org/wiki/Tim_Peters_(software_enginee... I would then also concur with the other comment that if you “know” you need metaclasses, 99% of the time actually you only need __subclass_init__. A lot of online literature about Python meta programming misses out __subclass_init__ as it was only added to Python 3.6 in 2015 via PEP 487. https://peps.python.org/pep-0487/ |
I was only around for one of them while he did it but it seemed pretty clear that he was insecure and trying to prove that he was a more experienced programmer by using the most advanced features.
I call it "the advanced beginner metaclass trap".