__repr__ python3 code example
Example 1: python __repr__
import datetime
now = datetime.datetime.now()
now.__str__()
#>>> '2020-12-27 22:28:00.324317'
now.__repr__()
#>>> 'datetime.datetime(2020, 12, 27, 22, 28, 0, 324317)'
Example 2: python __repr__ meaning
>>>repr(y)
"'a string'"
>>>y2=eval(repr(y))
>>>y==y2
True