Skip to content

Get class parameters from parent's __init__ #205

Closed

Description

@machow

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__?

Activity

  1. pawamoy commented on Aug 28, 2023

    @pawamoy
    Member

    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).

  2. pawamoy commented on Aug 28, 2023

    @pawamoy
    Member

    (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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions