I know that in Python Shell when you type >>> object
it shows the object.__repr__
method and if you type >>> print(object)
it shows the object.__str__
method.
But my question is, is there a short way to print __repr__
while executing a Python file?
I mean, in a file.py if I use print(object)
it will show object.__str__
and if I just type object
it shows nothing.
I have tried using print(object.__repr__)
but it prints <bound method object.__repr__ of reprReturnValue>
Or is this impossible?