In python, I'd like to import my_fun()
from mymodule
but I still wish to call it as mymodule.my_fun()
. How can I do that?
So far I know only about the following unsatisfying options:
import mymodule # imports all functions :(
mymodule.my_fun()
from mymodule import my_fun
my_fun() # not referred as mymodule.my_fun() :(
Something like this would be great:
from mymodule import my_fun
mymodule.my_fun()