Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent docstring formatting #93

Open
jc0n opened this issue Jan 30, 2012 · 0 comments
Open

Inconsistent docstring formatting #93

jc0n opened this issue Jan 30, 2012 · 0 comments

Comments

@jc0n
Copy link
Member

jc0n commented Jan 30, 2012

I know documentation is another huge project in itself but it seems there are several different formatting schemes in docstrings all over the code base. I don't understand some of the more common docs using formatting such as:

Update a Power Reg persistent object

:param id: Primary key for the object to update.
:type id: int
:param value_map: A map attributes to update and their new values.
        For a "many" end of a relationship, you may
        provide a list of foreign keys to be added, or
        you may provide a struct with two lists of keys
        indexed as 'add' and 'remove'.
:type value_map: dict

I have never seen types documented like this in python and it should not be necessary since python is duck typed. The docstrings are also not well formatted for use in the python interpreter. (ie. help()). I find the formatting very hard to read as opposed to:

Update a Power Reg persistent object

Args:
   id: the object's primary key
   value_map: dictionary of attributes to update and their new values.
        For a "many" end of a relationship, you may
        provide a sequence of foreign keys to be added, or
        you may provide a dictionary with two lists of keys
        indexed as 'add' and 'remove'.

I'm not sure how the documentation is currently being generated or why the awkward formatting is required.

For a python project I think restructured text formatting is the way to go. Full documentation can be generated with Sphinx and the formatting is readable as regular pydoc, or with help().

This is an important issue regardless of whether or not we change existing docstrings to at least make sure that new ones are written properly. (or for me to understand why they are as is).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant