Python and Django coding style (PEP)
NickName:aemdy Ask DateTime:2011-10-27T16:26:22

Python and Django coding style (PEP)

I write code with Python using Django framework. Now I have read about all these coding style advices, but encountered a vague thing.

In djangoproject section here https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#python-style it says that function comments should say like:

Does that, returns that.

However, here http://www.python.org/dev/peps/pep-0257/#one-line-docstrings it says that it should say like:

Do that, return that.

So, which option is true?

Copyright Notice:Content Author:「aemdy」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7913386/python-and-django-coding-style-pep

Answers
minhee 2011-10-27T08:32:36

PEP 8 follows the first person singular. Django documentation standard follows the third person singular. The former one is standard.",


More about “Python and Django coding style (PEP)” related questions

Python and Django coding style (PEP)

I write code with Python using Django framework. Now I have read about all these coding style advices, but encountered a vague thing. In djangoproject section here https://docs.djangoproject.com/e...

Show Detail

Redundant Character scape PEP8 Coding Style in Python

The following function is working fine, but I am struggling to learn and solve some PEP8 coding rules and write it properly: import re stringtext= " I don't care the following expression 10/1...

Show Detail

use pep8 to check the coding style in jupyter notebook

I have a problem in using pep8 to check the coding style in jupyter notebook. install by: in[1] %install_ext https://raw.githubusercontent.com/SiggyF/notebooks/master/pep8_magic.py out Inst...

Show Detail

How to get PyCharm to check PEP8 code style?

I'm using PyCharm (v 2.7.2) to develop a Django app, but I can't get it to check PEP8 style violations. I have enabled "PEP8 coding style violation" in the "Inspctions" section of the settings, but

Show Detail

Vim and PEP 8 -- Style Guide for Python Code

Could you recommend, how to configure Vim to stick to : PEP 8 -- Style Guide for Python Code when editing python2/3 files, and only those (I'd like to leave configuration as it is for all other

Show Detail

Common coding style for Python?

I'm pretty new to Python, and I want to develop my first serious open source project. I want to ask what is the common coding style for python projects. I'll put also what I'm doing right now. 1.-...

Show Detail

Does Elixir have coding standards or an authoritative style guide published by the language developers, like PEP8 or the Erlang Programming Rules?

I'm pretty sure that I can just use the Erlang style guide, but if Elixir has evolved to the point of something like PEP8, I would like to enforce it* as soon as possible. If it's just a matter of

Show Detail

Where to use camelCase in Python according to PEP 8?

Recently I have started working on machine learning with Python, however I'm very new to this language. I know that "Readability counts", so I have been trying to get myself familiar with...

Show Detail

Are there any published coding style guidelines for SQL?

Often I will end up with very complex SQL statements and I wondered if there was style guideline out there that dictates a common way of laying various aspects of a query out. I am look for someth...

Show Detail

Django Form Coding Style Guide

As we know, the Django authors provide a coding style guide, to use as guidance when writing Django applications. However, the document provided mentions nothing specifically about forms. Is there

Show Detail