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

pydoctor's handling of duplicate names needs a rethink #17

Open
mwhudson opened this issue Jan 12, 2015 · 1 comment
Open

pydoctor's handling of duplicate names needs a rethink #17

mwhudson opened this issue Jan 12, 2015 · 1 comment
Labels
bug Needs more reflexion Triaged This issue has been looked at by a core pydoctor dev it looks valid
Milestone

Comments

@mwhudson
Copy link
Contributor

Originally reported as Twisted issue 2621:

There are several cases, some of which get quite tricky. This is not an exhaustive list, but some examples are:

def foo(): pass
def foo(): pass

class B: pass
class B(B): pass

if quux:
def foo(): pass
else:
def foo(): pass


Imported from Launchpad using lp2gh.

@mwhudson mwhudson added Triaged This issue has been looked at by a core pydoctor dev it looks valid Low labels Jan 12, 2015
@tristanlatr
Copy link
Contributor

Here is my proposition for tackle this issue:

For System.allobjects and for Documentable.contents, we adopt a version of dict that maintains a stack of duplicates objects, that we can request with special methods. Like this one: https://github.com/tristanlatr/pydocspec/blob/main/pydocspec/dupsafedict.py

  • Duplicates classes/modules/package: they could be shown in the same page. It could be a bit weird, but it's better than the current behaviour.
  • For cases where a Function or Attribute overrides a Module or a Class, I don't think it would be an issue to show the documentation properly and not having to rename anything, actually.

The HTML writer should be adapted such that it can show many classes/modules on the same page and iterates over all objects, including duplicates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs more reflexion Triaged This issue has been looked at by a core pydoctor dev it looks valid
Projects
None yet
Development

No branches or pull requests

2 participants