Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73989

Re: PEP8 and 4 spaces

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <travisgriggs@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.058
X-Spam-Evidence '*H*': 0.88; '*S*': 0.00; 'anyway.': 0.05; 'problem?': 0.07; 'pep': 0.09; 'spaces': 0.09; 'cc:addr:python- list': 0.11; 'foo,': 0.16; 'indent': 0.16; 'lie': 0.16; 'pep8': 0.16; 'tabs': 0.16; 'travis': 0.16; 'wrote:': 0.18; 'code.': 0.18; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'looks': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'header:In-Reply-To:1': 0.27; 'mix': 0.30; 'along': 0.30; "i'm": 0.30; 'code': 0.31; '>>>>': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'supposed': 0.32; 'quite': 0.32; 'up.': 0.33; 'reader': 0.33; 'style': 0.33; 'problem': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'ryan': 0.36; 'method': 0.36; 'charset:us-ascii': 0.36; 'message-id:@gmail.com': 0.38; 'whatever': 0.38; 'issue': 0.38; 'does': 0.39; 'either': 0.39; 'space': 0.40; 'trading': 0.61; 'lost': 0.61; 'course': 0.61; 'first': 0.61; 'header:Message-Id:1': 0.63; 'fashion': 0.64; 'different': 0.65; 'talking': 0.65; 'to:addr:gmail.com': 0.65; 'brain': 0.68; 'jul': 0.74; '"modern"': 0.84; '2014,': 0.84; 'alone.': 0.84; 'picture.': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=YOMyaygy1z9cRB6n6D+XE5jTo3NGZHVozQmQITP+mtw=; b=0sFchbP06CAycG22AoOkxS2rz1sg7ubuqs0yGONdxNOoOArYgyOdtcFSEjKSfP+Ber NeosIt5yUbeVnk2n/un3/E0DS3sy7k59eYqRxxl+ZsA9UeXfzROQX4G1n5AfISt3ZXL8 4KBae/nHz0fMr3TU6N7/UL7sPJyT5B8ss20rmkE6Noh078AZz60VIfbOV9qKrh6XVKpO 5XOhfmPvm5rkHpUBkGthKvsu7xokyy/XEcYYcjavHgG4SrGmsSJb9IagSFNcpVriSJc9 D3CSd3PmPBNwvKovF/Qy+Oaa+YacbHF7LBDRUcSAz1mSMjljztg2Rp6+D97cd93QLPyb JqtA==
X-Received by 10.70.14.227 with SMTP id s3mr14726201pdc.88.1404546708200; Sat, 05 Jul 2014 00:51:48 -0700 (PDT)
References <53B59358.2040404@tobiah.org> <CAPTjJmqv_-89sV+X3VX03yAEXT43RgfBbcYL0W3GOLRCWGwYjQ@mail.gmail.com> <mailman.11466.1404410853.18130.python-list@python.org> <53b6019f$0$29985$c3e8da3$5496439d@news.astraweb.com> <c1n1fbFi6omU1@mid.individual.net> <lp6rqg$7ei$1@ger.gmane.org>
Mime-Version 1.0 (1.0)
In-Reply-To <lp6rqg$7ei$1@ger.gmane.org>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding quoted-printable
X-Mailer iPhone Mail (11D201)
From Travis Griggs <travisgriggs@gmail.com>
Subject Re: PEP8 and 4 spaces
Date Sat, 5 Jul 2014 00:51:32 -0700
To Lie Ryan <lie.1296@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.11517.1404546716.18130.python-list@python.org> (permalink)
Lines 43
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1404546716 news.xs4all.nl 2908 [2001:888:2000:d::a6]:36022
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:73989

Show key headers only | View raw


> On Jul 4, 2014, at 11:29, Lie Ryan <lie.1296@gmail.com> wrote:
> 
>> On 04/07/14 07:55, Gregory Ewing wrote:
>> Steven D'Aprano wrote:
>> 
>>>> That's exactly the problem with tabs - whatever you think your code
>>>> looks like with tabs, other people will see quite different picture.
>>> 
>>> Why do you consider this a problem?
>> 
>> It's a problem if you try to use tabs for lining things
>> up in a tabular fashion in your source code.
>> 
>> The solution is not to use tabs for that -- only use
>> tabs for indentation, and use spaces for everything
>> else. Or, as PEP 8 suggests, don't try to line things
>> up in the first place.
> 
> PEP8 suggests using this style of method invocation:
> 
>    obj.method(foo,
>               bar,
>               baz)
> 
> which is an effect impossible to do correctly with tabs alone. If you want to follow this style strictly, you end up having to either mix tabs and spaces, or just use spaces, or as I prefer it, avoid the issue altogether:
> 
>    obj.method(
>        foo,
>        bar,
>        baz,
>    )

Ok, here's irony. I'm looking at that thinking "what the heck is he talking about?!?". And then my brain catches up. My mail reader is of course "modern" and does not use a mono space font. So the value of the along ed indent is lost anyway. But wasn't that what spaces were supposed to give us over tabs, some separation from the trading betwixt different editors? Chuckle.

Travis Griggs

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: PEP8 and 4 spaces Paul Sokolovsky <pmiscml@gmail.com> - 2014-07-03 21:07 +0300
  Re: PEP8 and 4 spaces wxjmfauth@gmail.com - 2014-07-03 12:22 -0700
  Re: PEP8 and 4 spaces Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-04 01:21 +0000
    Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-04 11:30 +1000
      Re: PEP8 and 4 spaces Roy Smith <roy@panix.com> - 2014-07-03 21:37 -0400
    Re: PEP8 and 4 spaces Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-07-04 18:55 +1200
      Re: PEP8 and 4 spaces Lie Ryan <lie.1296@gmail.com> - 2014-07-04 19:29 +0100
        Re: PEP8 and 4 spaces Roy Smith <roy@panix.com> - 2014-07-04 15:04 -0400
          Re: PEP8 and 4 spaces Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-04 20:50 +0100
        Re: PEP8 and 4 spaces Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-07-05 11:17 +1200
          Re: PEP8 and 4 spaces Tim Chase <python.list@tim.thechases.com> - 2014-07-04 18:35 -0500
      Re: PEP8 and 4 spaces Travis Griggs <travisgriggs@gmail.com> - 2014-07-05 00:51 -0700

csiph-web