metaclass and customization with parameters

Carlos Ribeiro carribeiro at gmail.com
Mon Oct 4 23:52:52 CEST 2004


On 04 Oct 2004 22:40:25 +0300, Ville Vainio <ville at spammers.com> wrote:
> >>>>> "Carlos" == Carlos Ribeiro <carribeiro at gmail.com> 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.

While we agree on the use of metaclasses, I hav to strongly disagree
with your opinion regarding documentation. Advanced stuff doesn't need
to be explained in the tutorials, of course, but the reference manual
should contain more information -- after al, it's *the* reference
manual, isn't it?

(btw some people consider the source code to be the authoritative
source of information. I don't agree, I believe that source code,
independent of how well crafted and beautiful, is not a substitute for
good documentation. Even the best code sometimes fails to give
important metainformation, such as the context, history or intentions
of the programmer. Literate programming is a good way to get the two
concepts -- source code and docs -- together, though.)

-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list