Code

Opened 6 years ago

Closed 6 years ago

#6808 closed (wontfix)

Coding style: docstring inconsistency with pep8 and pep257

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

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.

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.