spadarian / docblock-python

Atom plugin to insert documentation blocks for python functions
GNU General Public License v2.0
22 stars 9 forks source link

Add support for dataclasses #33

Closed urscion closed 5 years ago

urscion commented 5 years ago

PEP 557 -- Data Classes introduced data classes (new in Python 3.7), a different way to define a class with type hinting and default parameters.

Add support for properly generating docblocks for classes using the dataclass decorator.

spadarian commented 5 years ago

Thanks for the suggestion.

Given that the new way to define the class is partially self-documented (type and default value), probably it a good idea to leave the type and default value out of the docblock.

The package has the options use_types and use_defaults, which can be forced to be false when generating the docblock.