-
-
Notifications
You must be signed in to change notification settings - Fork 63
submodules overshadow imports of the same name #124
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
If a module's __init__.py has a submodule, foo.py. Then importing a function of the same name from it, seems to keep the module name, rather than the function. This seems like a slight mismatch from dynamically importing, which keeps the function instead.
from griffe.loader import GriffeLoader
loader = GriffeLoader()
mod = loader.load_module("some_package")
mod.members
# output:
# {'foo': <Module(PosixPath('some_package/foo.py'))>}Example files
some_package/__init__.py
from foo import foo
some_package/foo.py
def foo(): pass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working