Thanks for your suggestions. They are very usefull and indeed bypass my
problem. However, I've found a (perhaps) more elegant way to get the
same result using metaclasses. My idea is to define my classes as
follows:

>>> class meta_A(type):
....      def __new__(cls, classname, bases, classdict):
             # define here all special methods
             newdict = { #special methods dict}
             classdict.update(newdict) # any suggestion on
automatically build newdict?
             return type.__new__(cls, classname, bases, classdict)

>>> class B(object):
          __metaclass__ = meta_A
          # More methods here

I know metaclasses are a complete different beast, anyway I find this
approach more pythonic. Any comment? Suggestion?

Thanks,
 Andrea.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to