Generally, I think that griffe
should somehow separate between
a) modules imported
b) modules available because the loaded object is a package
and also
c) .is_package
should be True
whenever the module is, in fact, a package (it doesn't do this for subpackages right now)
Current Behavior:
Anytime a package (a folder with a __init__.py
) is loaded, .modules
will list
a) the other modules in that folder
b) all of the other packages in that folder
b) all of the modules imported
You can traverse the package tree by following .modules
but the .is_package
attribute returns False
for subpackages.
package1/
__init__.py
package2/
__init__.py
...other.pys
Lets say you .load('package1')
, and traverse via .modules
to package2
, griffe
wont recognize it as a package- just a module. However, its .modules
will still show its ...other.pys
, so in some way we know its a package, because those other modules are not imported.
I should note that a package, once imported in python, is really just a module, except named after the folder and containing the contents of __init__.py
, AFAIK. The only time in python I've ever seen the fact that something is a package matter is when using import
since it allows us to traverse directories.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too