[Python-Dev] Suggested addition to PEP 8 for context managers (original) (raw)
Paul Moore p.f.moore at gmail.com
Tue Apr 17 09:14:11 CEST 2012
- Previous message: [Python-Dev] Suggested addition to PEP 8 for context managers
- Next message: [Python-Dev] Suggested addition to PEP 8 for context managers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 16 April 2012 17:10, Nam Nguyen <bitsink at gmail.com> wrote:
PEP 8 suggests no extra spaces after and before square brackets, and colons. So code like this is appropriate:
alist[1:3] But I find it less readable in the case of: alist[pos + 1:-1] The colon is seemingly lost in the right. Would it be better to read like below? alist[pos + 1 : -1] Any opinion?
It says no space before a colon, not after. So the following should be OK (and is what I'd use):
a_list[pos + 1: -1]
Paul.
- Previous message: [Python-Dev] Suggested addition to PEP 8 for context managers
- Next message: [Python-Dev] Suggested addition to PEP 8 for context managers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]