Re: newbee I have an object how to check what's his class?

2006-11-10 Thread consternation
I think I know now where my problems come from. I spare you boring implementation code. The case look like this: I parse xml file something a like 1 <\a> 2 <\a> 3 <\a> 4<\b> <\X> <\a> <\a> <\a> <\b> <\X> I suc

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread consternation
bject): > # ... defined as in your post > >>>> x = X('Fred') >>>> x > class X contains: >>>> type(x) is X > True >>>> isinstance(x,X) > True >>>> x.__class__.__name__ > 'X' > > Now for subcl

newbee I have an object how to check what's his class?

2006-11-10 Thread consternation
I can't find neither in tutorial nor with google It's all about isinstance, or __class__. How to test that an object is an instance of my X class?? Do I have this problems because I stre my objects in a dict? I wrote a class X like this : class X(object): def __init__(self,name):