spadarian / docblock-python

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

ignore the keyword-only argument separator #31

Closed SKalt closed 5 years ago

SKalt commented 5 years ago

As of PEP 3102 landing in python 3, , *, can separate normally-handled arguments from keyword-only arguments. While neither the google nor numpy styleguide covers how to document keyword-only arguments, docblock-python's current behavior is to treat them like an argument to be documented. At very least, the separator shouldn't have a suggested type and description.

Current behavior ```python def foo(*, **kwargs): """Short summary. Args: * (type): Description of parameter `*`. **kwargs (type): Description of parameter `**kwargs`. Returns: type: Description of returned object. """ pass ```
Desired behavior ```python def foo(*, **kwargs): """Short summary. Args: **kwargs (type): Description of parameter `**kwargs`. Returns: type: Description of returned object. """ pass ```
References - [language spec including keyword-only separator](https://docs.python.org/3.7/reference/compound_stmts.html#index-22)