For Kenny Tilton: Why do I need macros revisited.

Michele Simionato mis6 at pitt.edu
Sat Aug 23 09:40:48 CEST 2003


mertz at gnosis.cx (David Mertz) wrote in message news:<mailman.1061594769.30646.python-list at python.org>...
> "Andrew Dalke" <adalke at mindspring.com> wrote previously:
> |I've seen David Mertz' xml_pickle code which makes good use of
> |[metaclasses], but don't yet follow how it works.
> 
> I'm afraid I must insist here that the use of metaclasses in
> gnosis.xml.pickle is utterly trivial, and just for show.  You'll
> have to look elsewhere for "good use" of them :-).
> 
> Yours, David...

For instance Psyco was using metaclasses to wrap the methods to
"speed-up", at least when I looked at version 0.4. 
This was a quite clean usage, simple and effective.
When you need to wrap many methods in a class (for instance for
logging purposes or other reasons) a metaclass is most probably 
the best solution you have at your disposal.

Michele Simionato, Ph. D.
MicheleSimionato at libero.it
http://www.phyast.pitt.edu/~micheles
--- Currently looking for a job ---




More information about the Python-list mailing list