For Kenny Tilton: Why do I need macros revisited.

Michele Simionato mis6 at pitt.edu
Sat Aug 23 03:59:46 EDT 2003


"Andrew Dalke" <adalke at mindspring.com> wrote in message news:<8dk1b.2825$Ej6.1159 at newsread4.news.pas.earthlink.net>...
> Kenny Tilton:
> > You are absolutely right. Metaclasses are killer. I am surprised
> > Pythonistas afraid of macros let them into the language!
> 
> Speaking personally, I still haven't wrapped my head around
> them, and despite seeing Alex's talk about them, don't fully
> understand when to use them.  I've seen David Mertz' xml_pickle
> code which makes good use of them, but don't yet follow
> how it works.

I was in your situation some time ago and actually I was sceptical
about the usefulness of metaclasses. Then, I got the metaclass book.
It made the click. Notice that it is a C++ book, of little use to a 
Pythonista, nevertheless it provides lots of use case and compelling
(at least for me) motivations for metaclasses. It is easier to
study something if you understand what is for ;)

BTW, I got it used from Amazon.com, $10. It is cited in the
references of http://www-106.ibm.com/developerworks/library/l-pymeta.html
so you should be able to find it.

Alex Martelli has a very advanced set of slides on metaclass, but I haven't
the URL here (Alex, do you here me ?)


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