Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

submodule containing a function or class of the same name as the submodule won't be identified #452

Open
mivanit opened this issue Aug 19, 2024 · 0 comments

Comments

@mivanit
Copy link

mivanit commented Aug 19, 2024

Expected Behavior/Steps to reproduce

if we have a submodule something with a function something inside that submodule, both the function and submodule should appear in the generated docs.

Actual Behavior

only the function appears in the docs. this is because in the self.doc dict of a pdoc.Module, they will have the same key and thus the module will never be added.

on line 755 we have:

for root in iter_modules(self.obj.__path__):
  # Ignore if this module was already doc'd.
  if root in self.doc:
    continue

but this erroneously skips adding the submodule.

the fix might be as simple as appending :module to the root key before we store it in the dict, but I'm not sure if this would break things downstream.

Additional info

  • pdoc version: 0.11.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant