abstract metaclass

Roald de Vries downaold at gmail.com
Thu Aug 5 09:46:29 EDT 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):
     ...

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
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__",  
set()):
      86                 value = getattr(cls, name, None)
      87                 if getattr(value, "__isabstractmethod__",  
False):

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,

Roald



More information about the Python-list mailing list