pytkdocs icon indicating copy to clipboard operation
pytkdocs copied to clipboard

Enable the inheritance of classmethod for docstrings

Open cgarciae opened this issue 4 years ago • 4 comments

Currently the docstrings for inherited classmethods are completely ignored, this forces the user make trivial reimplementation of methods such as __init__ just to show proper documentation.

Original disscutions: https://github.com/pawamoy/mkdocstrings/issues/78#issuecomment-664537828

cgarciae avatar Jul 27 '20 18:07 cgarciae

Are there any news about this? Being able to inherit __init__ docstrings would be super helpful! It also seems like even docstrings of reimplemented __init__methods are not displayed for subclasses.

joschif avatar Dec 11 '20 15:12 joschif

Is there any news on this ?

samsja avatar Mar 17 '23 14:03 samsja

Hello, no news unfortunately! Pull requests are welcome if you want to try and fix this. It seems to happen here: https://github.com/mkdocstrings/pytkdocs/blob/master/src/pytkdocs/loader.py#L911. I'm not sure why inspect.getdoc does not look up into base classes since it's supposed to: https://docs.python.org/3/library/inspect.html#inspect.getdoc

pawamoy avatar Mar 19 '23 13:03 pawamoy

@pawamoy Thanks. I will try to take a look and maybe do a PR if a find a fix

samsja avatar Mar 20 '23 08:03 samsja