metaclass and customization with parameters

Ville Vainio ville at
Mon Oct 4 21:40:25 CEST 2004

>>>>> "Carlos" == Carlos Ribeiro <carribeiro at> writes:

    Carlos> During the learning process, more often than not I would
    Carlos> try to solve *all* problems with a metaclass, as if it was
    Carlos> the only tool available.  Now that I'm starting to feel
    Carlos> comfortable, things start to fall back into the correct
    Carlos> perspective once again. But of course, now I'm better
    Carlos> equiped with a powerful addition to my toolset :-) Let's
    Carlos> not abuse it though.

Good idea. If I was to review a piece of code that introduced a
metaclass (as opposed to just using one that came with a framework), I
would be prone to ask the author whether he really exhausted *all* the
other avenues before going the metaclass route. Not documenting
metaclasses in the standard, bundled documentation is a good thing.

Ville Vainio

More information about the Python-list mailing list