Skip to content

Comment on Metaprogramming in Pythonparent

Comments

Yes, also for anything else than subclass registration, there are things like the descriptor protocol or class decorators that are likely to be easier to use, debug and understand.

And metaclasses can be any callable, not just class. It's usually better to use a simple function.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.