Getting back an Object

David Anderson zerty.david at
Fri Mar 28 02:40:41 CET 2008

Well, I've got a little problem, I have a list that contains objects from
the class C, then I use those objects.__str__ to generate a ListCtrl, A
wxPython widget that makes a list of strings and then you can handle events
when selected, and returns the string selcted, how can I access the "parent"
of that string?
I tried to search on the array like this:
def search(self, string):
      for obj in self.list:
           if string == obj.__str__:
                 return obj
       return None

But I always get None... What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list