0

I am not saying that I need to, and I also saw this How do I create a simple metaclass? but what's wrong with this simple implementation:

>>>class one(object):
       def __init__(self):
           class self:pass

After this I did:

>>>rat1=one()
>>>rat2=rat1()
TypeError: 'one' object is not callable
Community
  • 1
  • 1
sumit.viii
  • 11
  • 2

1 Answers1

0

Metaclasses derive from type, not object.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • OK. So I replaced "object" with "type". But then it gives error in first time itself. TypeError: type() takes 1 or 3 arguments – sumit.viii Jul 04 '14 at 05:46