flask def __repr__(self) code example
Example 1: python __repr__ meaning
>>>x=4
>>>repr(x)
'4'
>>>str(x)
'4'
>>>y='stringy'
>>>repr(y)
"'stringy'"
>>>str(y)
'stringy'
Example 2: python __repr__ meaning
>>>repr(y)
"'a string'"
>>>y2=eval(repr(y))
>>>y==y2
True