douglasdavis / numpydoc.el

Insert NumPy style docstrings in Python functions.
GNU General Public License v3.0
46 stars 7 forks source link

Support classes? #9

Open jdtsmith opened 3 years ago

jdtsmith commented 3 years ago

This looks very nice. I immediately ran into trouble documenting a class, which numpydoc style indicates should contain all normal sections, documenting __init__ parameters, attributes, and (possibly) methods. This would be a great addition. Possibly just __init__ parameters to start and placing a to-be-filled attributes section?

douglasdavis commented 3 years ago

I'd welcome any PR that adds support for classes! I can give it a try but there are no guarantees that I'll find any consistent time to work on it in the immediate future.

lu-pl commented 4 months ago

Any news on this?

I think an interims solution would be to have docstrings for __init__ inserted as the class definition.

Numpydoc says that for classes all sections but Returns can be used and that "[t]he constructor (init) should also be documented here, the Parameters section of the docstring details the constructor’s parameters.

douglasdavis commented 3 months ago

I don't have the bandwidth to work on this, but I'd welcome a PR. Somewhat related: it's on the very bottom of my todo list to investigate using built-in tree-sitter support that landed in Emacs some time ago to improve this package and perhaps make it easier to contribute to.