As per my understanding __repr__ is used to represent a developer/interpreter friendly representation of the object and should possibly be a valid python code which when passed to eval() recreates an identical object.
From Python Docs:
object.repr(self)
Called by the repr() built-in function and by string conversions (reverse quotes) to compute the “official” string representation of an object. If at all possible, this should look like a valid Python expression that could be used to recreate an object with the same value (given an appropriate environment). If this is not possible, a string of the form <...some useful description...> should be returned. The return value must be a string object. If a class defines repr() but not str(), then repr() is also used when an “informal” string representation of instances of that class is required.
Link: https://docs.python.org/2/reference/datamodel.html#object.repr
E.g:
class tie(object):
def __init__(self, color):
self.color = color
t = tie('green')
repr(t) # prints <tie object at 0x10fdc4c10>
# can the default implementation be improved to tie(color='green')
# based on the parameters passed in the __init__ function
What challenges would be there to change that implementation apart from backward compatibility/ existing behavior?