When one types the name of a module and then hits return, one gets a string like below
import pandas as pd
pd
<module 'pandas' from '....'>
How can I overwrite this string for my own module ? (Please note that I am referring to a module, not to a class) For example adding a text below like
<module 'mymodule' from '....'>
my additional custom text
I tried to add this to mymodule:
def __str__():
print('my additional custom text')
and also
def __str__():
return 'my additional custom text'
def __repr__():
print("my additional custom text")
return "my additional custom text"
but nothing happens
Of course, if I type
mymodule.__str__()
I get 'my additional custom text'