title: what is the significance of `__repr__` function over normal function
body: <p>I am trying to learn python with my own and i stucked at <code>__repr__</code> function. Though i have read lots of post on <code>__repr__</code> along with the python document. so i have decided to ask this Question here. The code bellow explains my confusion. </p>
  
  <pre><code>class Point:
  
      def __init__(self,x,y):
              self.x, self.y = x,y
  
      def __repr__(self):
          return 'Point(x=%s, y=%s)'%(self.x, self.y)
  
      def print_class(self):
          return 'Point(x=%s, y=%s)'%(self.x, self.y)
  
  
  
  p = Point(1,2)
  
  print p
  print p.print_class()
  
  
  Point(x=1, y=2)
  Point(x=1, y=2)
  </code></pre>
  
  <p>If a normal function can also perform  similar task then what is the extra advantage of <code>__repr__</code> over <code>print_class()</code> (in my case a normal function) function. </p>