title: Python TypeError: sort() takes no positional arguments
body: <p>I try to write a small class and want to sort the items based on the weight. The code is provided, </p>
  
  <pre><code>class Bird:
  
      def __init__(self, weight):
          # __weight for the private variable
          self.__weight = weight
  
      def weight(self):
          return self.__weight
  
      def __repr__(self):
          return "Bird, weight = " + str(self.__weight)
  
  
  if __name__ == '__main__':
  
      # Create a list of Bird objects.
      birds = []
      birds.append(Bird(10))
      birds.append(Bird(5))
      birds.append(Bird(200))
  
      # Sort the birds by their weights.
      birds.sort(lambda b: b.weight())
  
      # Display sorted birds.
      for b in birds:
          print(b)
  </code></pre>
  
  <p>When I run the program, I get the error stack of <code>Python TypeError: sort() takes no positional arguments</code>. Whats the issue here?    </p>