I've always thought that Jupyter simply printed out the repr
of an object, but that is not the case.
Here is an example. If I evaluate this in a notebook:
obj = type(2)
obj
I just get: int
.
If I do instead
print(obj)
I get: <class 'int'>
.
So: what is the Python instruction to simulate what the notebook does during the evaluation of a variable?