Closed Lucas-C closed 3 years ago
I was wondering how come I hadn't thought of that simple solution. Maybe it has some drawbacks I'm no longer aware of, but it seems to work around the issue. :smiley:
Much appreciated!
Ah, right, I remember now what I was thinking. This fix only applies when imported objects are from submodules of the current module, which might be a common, but certainly not the general case.
In terms of #264, the fix "breaks" if observed my_func()
were defined in __init__
and imported/exposed in file1
.
Ideas?
Maybe #264 can be re-opened to track this. In my case this fix was enough to le me edit the docs interactively.
I may have an idea for a fix though:
instead of checking if mod_key.startswith(module.__name__)
,
we could check if mod_key.startswith(base_mod)
where base_mod
is the root module of module.__name__
(extracted with module.__name__.split(".", 1)[0]
for example).
What do you think?
It's not too bad an idea at all. This will then work for all modules within a single package. :+1:
Fixes #264
The fix in
cli.py
was made to avoid this error while pressingF5
in my browser when using--http
: