A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-April/118810.html below:

[Python-Dev] Suggested addition to PEP 8 for context managers

[Python-Dev] Suggested addition to PEP 8 for context managers [Python-Dev] Suggested addition to PEP 8 for context managersJan Kaliszewski zuo at chopin.edu.pl
Tue Apr 17 15:29:54 CEST 2012
Paul Moore dixit (2012-04-17, 08:14):

> 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:
> >
> > a_list[1:3]
> >
> > But I find it less readable in the case of:
> >
> > a_list[pos + 1:-1]
> >
> > The colon is seemingly lost in the right.
> >
> > Would it be better to read like below?
> >
> > a_list[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]

I'd prefer either:

    a_list[pos+1:-1]

or

    a_list[(pos + 1):-1]

Regards.
*j

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4