inheriting variables

Alex Martelli aleax at aleax.it
Fri Apr 18 02:19:44 EDT 2003


Haran Shivanan wrote:

> module "Alex Martelli" core dumped with the following output:
> [snipped informative stuff]
>> 
>> This prints 11, as apparently required by your specs.  I hope
>> this can help you make the custom metaclass you need to
>> implement your actual, exact specifications, of course.
> Thanks *a lot* for your help.

You're welcome!

> Do you know of any on-line resources where I can get info
> on metaclasses and using them?

In your shoes, I'd use Advanced Groups Search in Google,
looking for 'metaclass' in comp.lang.python -- I've posted
a few examples &c, and so have others.  Mertz and Simionato
have an article online, at
http://www-106.ibm.com/developerworks/linux/library/l-pymeta.html

Regular Google for:
   python custom metaclass 
shows the M & S article as well as archival copies of some 
of my posts all within the first 10 of 450 hits.  In general, 
whenever you are looking for information on a subject, a try
with google is worth it -- asking around is fine too, of
course, but google is truly helpful more often than not.


> I was only dimly aware of their presence until your post.

That's a widespread issue -- mostly because very few people
really NEED to build classes with peculiar semantics, and
that's what custom metaclasses are for, after all.  But when
one does have such a need, a custom metaclass should be the
first possibility considered -- and clearly such a need is
exactly what you believe you're facing here.


Alex





More information about the Python-list mailing list