abstract metaclass

Discussion in 'Python' started by Roald de Vries, Aug 5, 2010.

  1. 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
     
    Roald de Vries, Aug 5, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DaKoadMunky
    Replies:
    4
    Views:
    572
    Lee Weiner
    Apr 20, 2004
  2. Matthias Kaeppler
    Replies:
    1
    Views:
    470
    R.F. Pels
    May 22, 2005
  3. Sameer
    Replies:
    4
    Views:
    632
    Roedy Green
    Aug 31, 2005
  4. ironfroggy
    Replies:
    16
    Views:
    447
    Michele Simionato
    Jun 3, 2005
  5. Steven D'Aprano

    Metaclass of a metaclass

    Steven D'Aprano, Jun 5, 2012, in forum: Python
    Replies:
    1
    Views:
    322
Loading...

Share This Page