Skip to content

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

Open
@mivanit

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions