I am newbie to python and trying to understand repr method. I have written small piece of code below :
>>> class myobj():
... def __repr__(self):
... return "the repr is myobj({})".format(self.__arg)
... def __init__(self):
... self.__arg = None
...
>>> p1 = myobj()
>>> p1
the repr is myobj(None)
>>> print(p1)
the repr is myobj(None)
>>> repr(p1)
'the repr is myobj(None)'
>>>
Correct me if I am wrong here : when I do p1, it calls "repr" I implemented.
I am not able to understand when I call repr(p1), why I am seeing single quotes around the repr is myobj(None).
Can someone explain? Appreciated