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

Get class parameters from parent's __init__ #205

Closed
machow opened this issue Aug 28, 2023 · 2 comments
Closed

Get class parameters from parent's __init__ #205

machow opened this issue Aug 28, 2023 · 2 comments
Labels
feature New feature or request

Comments

@machow
Copy link
Contributor

machow commented Aug 28, 2023

Is your feature request related to a problem? Please describe.

Currently, griffe checks Class.members, when fetching Class.parameters. When the __init__ is inherited from the parent class, this means that an empty set of parameters gets returned.

Describe the solution you'd like

WDYT of checking in Class.inherited_members as well, in order to get parameters for classes that don't override __init__?

@pawamoy
Copy link
Member

pawamoy commented Aug 28, 2023

Yep, good idea! We can check both at once using Class.all_members 🙂 Feel free to send a PR, otherwise I'll get to it soon (it's an easy change, shouldn't take long).

@pawamoy
Copy link
Member

pawamoy commented Aug 28, 2023

(by the way, I think mkdocstrings-python also checks only in members for __init__ when merging docstring, will open an issue there tomorrow)

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

No branches or pull requests

2 participants