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

[BUG] Enum's __class__ etc. are pulled in when inherited_members is true #107

Open
yi2020 opened this issue May 17, 2021 · 3 comments
Open

Comments

@yi2020
Copy link

yi2020 commented May 17, 2021

Describe the bug
I've set inherited_memberse to true in my selector to pull in members that are inherited from classes that I've built. Essentially, I have a class Mergeable, that has some methods and attributes, and many classes inherit from it. However, this is also applying to Enum and is pulling in noise.

Screen Shot 2021-05-17 at 11 36 28 AM

Screen Shot 2021-05-17 at 11 41 10 AM

To Reproduce
Use mkdocs+mkdocstring on a Python file that has an Enum in it, and set inherited_members to true.

Expected behavior
The class and similar aspects shouldn't be collected. There's no point in documenting these are part of mkdocs.

System (please complete the following information):

  • pytkdocs version 0.11.1
  • Python version: 3.8.2
  • OS: MacOS
@yi2020
Copy link
Author

yi2020 commented May 17, 2021

BTW - workaround was to filter anything that starts with __, but the default behavior shouldn't require this.

@pawamoy
Copy link
Member

pawamoy commented May 18, 2021

Whether we should filter out members starting with __ is up to discussion 🙂
Personally I want my documented special methods to appear in the docs (__init__). But I agree it can quickly become noisy with inherited members.

@yi2020
Copy link
Author

yi2020 commented May 18, 2021

Agree, though maybe special handling there? Does it make sense to pull __bool__ and __class__, for example? __init__ may be a special one, and only if it's non empty?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants