Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > abstract metaclass

Thread Tools

abstract metaclass

Roald de Vries
Posts: n/a
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,

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metaclass of a metaclass Steven D'Aprano Python 1 06-05-2012 03:30 PM
About abstract class and abstract method Sameer Java 4 08-31-2005 12:59 AM
metaclass that inherits a class of that metaclass? ironfroggy Python 16 06-03-2005 10:00 AM
Deriving abstract class from non-abstract class Matthias Kaeppler Java 1 05-22-2005 01:28 PM
Abstract Classes w/o abstract methods DaKoadMunky Java 4 04-20-2004 04:53 AM