title: Python: Find Instance of a class by value
body: <p>i created much instances of a class. Then I want to find one instance by its name. But I get the error message <code>TypeError: get() missing 1 required positional argument: 'value'</code>.</p>
  
  <pre><code>class Test(object):
      def __init__(self, value):
          self.value = value
  
      def get(self, value):
          if self.value == value:
              return self
          else:
              return None
  
  test_obj = Test('foobar')
  
  print(test_obj.value)
  
  instance = Test.get('foobar')
  
  if instance:
      print(instance.value)
  </code></pre>