isinstance(obj, type(obj)) == True?

Art grenander at
Wed Jun 24 10:57:23 EDT 2009

I have the following problem:

ipdb> p type(self)
<class 'component.BiasComponent'>

ipdb> isinstance(self, component.BiasComponent)

I thought that isinstance(obj, type(obj)) == True.

The specific problem is when I try to call the super of a class and it
only occurs after 'reload'ing the file in the interpreter. What am I
messing up by reloading? It doesn't occur if I using for the first
time in a fresh interpreter session.

---> 32 class BiasComponent(ModelComponent):
      33     def __init__(self, g, model):
      34         super(BiasComponent, self).__init__(g, model)

TypeError: super(type, obj): obj must be an instance or subtype of

Seems like the self passed to __init__ is messed up in some way.


More information about the Python-list mailing list