title: how to select an object from a list of objects by its attribute in python
body: <p>Apologies if this question has already been asked but I do not think I know the correct terminology to search for an appropriate solution through google.</p>
  
  <p>I would like to select an object from a list of objects by the value of it's attribute, for example:</p>
  
  <pre><code>class Example():
      def __init__(self):
          self.pList = []
      def addPerson(self,name,number):
          self.pList.append(Person(self,name,number))
  
  class Person():
      def __init__(self,name,number):
          self.nom = name
          self.num = number
  
  
  a = Example()
  a.addPerson('dave',123)
  a.addPerson('mike',345)
  
  a.pList #.... somehow select dave by giving the value 123
  </code></pre>
  
  <p>in my case the number will always be unique</p>
  
  <p>Thanks for the help</p>