What the __ repr __ function does with a function code example
Example 1: __repr__ in python
def __repr__(self) -> str:
return
Example 2: python __repr__ meaning
>>>repr(y)
"'a string'"
>>>y2=eval(repr(y))
>>>y==y2
True
def __repr__(self) -> str:
return
>>>repr(y)
"'a string'"
>>>y2=eval(repr(y))
>>>y==y2
True