1

Ok I'm stumped again! This should be easy though ;-)

I'm trying to subclass the pytables class tables.IsDefinition, as follows:

import tables

class doc(tables.IsDescription):
    def __init__(self, data):
        self.data = data

And then I try to instantiate it I get an error:

doc('test')

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

...<ipython console> in <module>()

TypeError: object.__new__() takes no parameters

This is with Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) and IPython 0.10

What am I doing wrong?

tdc
  • 8,219
  • 11
  • 41
  • 63

1 Answers1

2

In case anyone else lands here, the answer is that IsDescription is a "metaclass". More information can be found on this thread

Community
  • 1
  • 1
tdc
  • 8,219
  • 11
  • 41
  • 63