Metaclasses vs. standard Python reflection?

Raymond Hettinger vze4rx4y at verizon.net
Fri May 2 01:30:24 EDT 2003


> I've been looking for examples of metaclasses I can use for a talk I'm
> going to be giving next week, but I've been having trouble finding
> examples that solve problems that wouldn't just as easily be via
> Python's uber-reflective __getattr__/__setattr__ and inheritance.
> Does anyone have a good example of a problem that's solved more
> "beautifully" with metaclasses than with Python's standard reflection
> facilities?

The programming by contract example favors a metaclass solution.


Raymond Hettinger






More information about the Python-list mailing list