In <[EMAIL PROTECTED]>, consternation wrote:

> Thank You for reply but ....
> I found solution suggested by You in a tutorial yesterday. For some reason
> it doesn't work in my case.
> 
> code:
> #mem-dictionary in Y class for storing objects
> #Y doesn't inherit from X
>       for (i,v) in self.mem.items(): 
>       print " isinstance(x,X)"
>       print  isinstance(v,X)
>       print "type(x) is X"
>       print type(v) is X
>       print v.__class__.__name__
>       print v.__class__
> 
> result:
> isinstance(x,X)
> False
> type(x) is X
> False
> <type 'list'>
> list

Define "doesn't work".  Obviously lists are not instances of your `X`
class.  So where's the problem?  What did you expect and why?

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to