abstract metaclass

Roald de Vries downaold at gmail.com
Thu Aug 5 15:46:29 CEST 2010

Hi all,

I'm trying to create a metaclass that keeps track of its objects, and  
implement this as a collections.MutableMapping. That is, something  
like this:

class type2(type, MutableMapping):

python2.6/abc.pyc in __new__(mcls, name, bases, namespace)
      83                      if getattr(value,  
"__isabstractmethod__", False))
      84         for base in bases:
---> 85             for name in getattr(base, "__abstractmethods__",  
      86                 value = getattr(cls, name, None)
      87                 if getattr(value, "__isabstractmethod__",  

TypeError: Error when calling the metaclass bases
     'getset_descriptor' object is not iterable

Anybody knows why? Every type is just an object, isn't it?

Thanks in advance, cheers,


More information about the Python-list mailing list