This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python Tutorial, Section 3, Minor PEP 8 adjustment
Type: Stage: resolved
Components: Documentation Versions: Python 3.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Nebelhom, benjamin.peterson, docs@python, loewis, ncoghlan
Priority: normal Keywords:

Created on 2011-11-16 22:48 by Nebelhom, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg147777 - (view) Author: (Nebelhom) Date: 2011-11-16 22:48
Python Tutorial 3.3a

3. An informal introduction to python

example:

-------------------------------------------------------------
# this is the first comment
SPAM = 1                 # and this is the second comment
                         # ... and now a third!
STRING = "# This is not a comment."
-------------------------------------------------------------

Comment: It is probably best to use PEP 8 straight from the start.
Therefore variable names should be all lowercase with connecting underscores (if necessary)

i.e. spam = 1 and string = "#This is not a comment." instead of all uppercase.
msg147779 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-11-16 23:12
It's fine as it is; constants are often denoted with capital letters.
msg147980 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-11-20 10:02
Indeed, PEP 8 mandates that constants be written in all uppercase, so changing it would actually make it deviate from PEP 8. Also, using a lower-case variable name "string" would be a bad choice because it collides with a module name.
History
Date User Action Args
2022-04-11 14:57:23adminsetgithub: 57625
2011-11-20 10:02:04loewissetnosy: + loewis
messages: + msg147980
2011-11-17 08:44:40ezio.melottisetstage: resolved
2011-11-16 23:12:10benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg147779

resolution: rejected
2011-11-16 22:48:12Nebelhomcreate