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: expand on meaning of 'string literals that rely on significant trailing whitespace'
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ezio.melotti, georg.brandl, tshepang
Priority: normal Keywords:

Created on 2013-01-13 10:43 by tshepang, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg179861 - (view) Author: Tshepang Lekhonkhobe (tshepang) * Date: 2013-01-13 10:43
In PEP 8, there is:

> Don't write string literals that rely on significant trailing whitespace

It's not clear to me what this means, and therefore likely needs further explanation, or maybe an example.
msg179862 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2013-01-13 10:47
It means not write 

a = "abc    "

as

a = """abc    
"""

with the four spaces trailing at the end of the line.  I don't think there is a more concise way of putting it in the PEP.
msg179876 - (view) Author: Tshepang Lekhonkhobe (tshepang) * Date: 2013-01-13 14:21
> I don't think there is a more concise way of putting it in the PEP.

Is it not more important to be clear than to be concise? Can't you put
this info that PEP, or at least a link to this issue?
msg179879 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-01-13 14:38
I think the sentence is already clear enough --- editors often remove trailing spaces, so if they are significant (e.g. if they are in a string literal) they are at risk.  This is actually more a general advice than a styling guideline, so I'm not even sure it belongs to the PEP 8.
History
Date User Action Args
2022-04-11 14:57:40adminsetgithub: 61155
2013-01-13 14:38:20ezio.melottisetnosy: + ezio.melotti
messages: + msg179879
2013-01-13 14:21:34tshepangsetmessages: + msg179876
2013-01-13 10:47:36georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg179862

resolution: works for me
2013-01-13 10:43:21tshepangcreate