Opened 17 years ago

Closed 17 years ago

#6808 closed (wontfix)

Coding style: docstring inconsistency with pep8 and pep257

Reported by: anonymous Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: pep257 coding style
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

PEP257 advises a docstring as "It prescribes the function or method's effect as a command ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ..."."

PEP8 also mentions PEP257 and gives example """Return a foobang [...]

But Django Coding Style advises to use exactly the opposite in http://www.djangoproject.com/documentation/contributing/#coding-style .
If this is unadvertedly, we should go for the PEP257 convention; if this is by intent, someone who knows it should add the reason for not following the PEP247 convention.

Change History (2)

comment:1 by anonymous, 17 years ago

comment:2 by Malcolm Tredinnick, 17 years ago

Resolution: wontfix
Status: newclosed

The reason we do it the current way is for consistency with all the other code in Django (and because it reads quite nicely). It's documented in contributing.txt that we prefer active versions of docstrings ("Returns...") rather than passive versions ("Return..."). There's nothing that really needs to be added here.

Note: See TracTickets for help on using tickets.
Back to Top