Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Guido sees the light: PEP 8 updated Date: Sat, 16 Apr 2016 19:30:21 +1000 Lines: 49 Message-ID: References: <5711c1b3$0$1596$c3e8da3$5496439d@news.astraweb.com> <87shym6kpo.fsf@elektro.pacujo.net> <87h9f26ioa.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Ikoced1K4SNO4sGlHGneLAGOyeJgmuGGak7ri77txZzw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '16,': 0.03; '"""': 0.05; 'false.': 0.07; 'subject:PEP': 0.07; 'cc:addr:python-list': 0.09; 'consistency.': 0.09; 'python': 0.10; 'subsequent': 0.15; '2016': 0.16; 'advice,': 0.16; 'compliant,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mean,': 0.16; 'pep8': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'rule.': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'library': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; "aren't": 0.22; 'names.': 0.22; 'code.': 0.23; 'decide': 0.23; 'sat,': 0.23; 'examples': 0.24; 'header:In-Reply-To:1': 0.24; 'module': 0.25; "doesn't": 0.26; 'chris': 0.26; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'looks': 0.29; 'another.': 0.29; 'consistency': 0.29; 'pep': 0.29; 'sure,': 0.29; 'code': 0.30; 'programmers': 0.30; 'probably': 0.31; 'post': 0.31; 'maybe': 0.33; 'point': 0.33; 'received:google.com': 0.35; 'ones': 0.35; 'important.': 0.35; 'sometimes': 0.35; 'but': 0.36; 'should': 0.36; 'project': 0.36; 'lines': 0.36; 'tool': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'subject:the': 0.39; 'along': 0.39; 'easily': 0.39; 'your': 0.60; 'back': 0.62; 'skip:n 10': 0.62; 'matter': 0.63; 'more': 0.63; 'within': 0.64; 'believe': 0.66; 'compliant': 0.66; 'remember,': 0.66; 'hesitate': 0.71; 'carried': 0.76; 'applicable.': 0.84; 'chrisa': 0.84; 'compliant.': 0.84; 'mountain?': 0.84; 'stone': 0.84; 'to:none': 0.91; 'why?': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=YktEUL71Zy3ZW/w4hzvmQjeWVbChb9/6UVHU3evYZR4=; b=f3TDCAynTuViD5DLmHiNzU7E7Skr9MTvYnkzirhrc643yuTr5eK3M2k0O0+VbtfEv7 TeYaHG90L58qmk15Kl8B+8e1dib6DBE6nMCm8ih+3c5g1MXGxTNciQZ9K5tlrpsvHTDo /uqok7HwOxJG725XRA88vuesq+g4RpiUP1vATmrhdM1fajKs1R1Bw0kPWoLRoFwSubLG NFh7HYeZk6ASlCJSj+c8XSrsDr0gGU5uIUjr7lmUyyMT9kJUqdqgB9mYoy3JaO9Td4Uj D8GxtRH8++YO0DuzTFJkDQX7+KuYYXMWOUqpwSlILKTXdQmXbMsmgDS7HMd7Iiawf7vr pbJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=YktEUL71Zy3ZW/w4hzvmQjeWVbChb9/6UVHU3evYZR4=; b=bovCrlkzzkKT2+k03HB4b3yGNcMvgRzRSVJuiksthBF6rZAvTMlG0BWQW7H9XoOIxq H80MRLcnoZCDyhgB10TtyYDIEcIDhaPMh8A9P0k/tpB84DETPQh8yPSReI6SUzcJ3af7 Hii41jQ2u02XC3KESyIJA8Gt0ptXlu9h08bsua8qVka50rMwKZlwM38EfqJWFYzm+EB7 G0oLa4I6oZjcXeX4f7NBK+pk3Ekw4oKgLdh65dkd8EHyYK0Qz2SX5LWmN2iTpamOYAEQ bxoH/vyh0LoDLnWa0NcnsjJs5vRkRrdGlBqz+xocM6EtAbMs6RNdBXS3qVY9s+Ton9KZ J3SA== X-Gm-Message-State: AOPr4FU6Xso+fGGqtE35kgtVQWLNgulomp4QkFwG94cOWggO9lmdnBnWyQg2/3niYIJByY2oNvUSgOypCIViTA== X-Received: by 10.50.112.169 with SMTP id ir9mr9637058igb.92.1460799021563; Sat, 16 Apr 2016 02:30:21 -0700 (PDT) In-Reply-To: <87h9f26ioa.fsf@elektro.pacujo.net> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <5711c1b3$0$1596$c3e8da3$5496439d@news.astraweb.com> <87shym6kpo.fsf@elektro.pacujo.net> <87h9f26ioa.fsf@elektro.pacujo.net> Xref: csiph.com comp.lang.python:107091 On Sat, Apr 16, 2016 at 6:51 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Sat, Apr 16, 2016 at 6:06 PM, Marko Rauhamaa wrote: >>> It doesn't really matter one way or another. The true WTF is that it's >>> been changed. >> >> Why? Was PEP 8 inscribed on stone tablets carried down from a mountain? > > In a way, yes. > > I don't follow PEP 8 to the tee; probably nobody does. However, I don't > see the point of turning truckloads of exemplary Python code into > truckloads of substandard Python code. Let me quote to you from the most important section of PEP 8. """ A style guide is about consistency. Consistency with this style guide is important. Consistency within a project is more important. Consistency within one module or function is the most important. However, know when to be inconsistent -- sometimes style guide recommendations just aren't applicable. When in doubt, use your best judgment. Look at other examples and decide what looks best. And don't hesitate to ask! """ (from the section "A Foolish Consistency is the Hobgoblin of Little Minds") Maybe we need a blog post "Falsehoods Programmers Believe About PEP 8", along the lines of the ones about time and names. Remember, every one of these is false. * All Python code should follow PEP 8. * If you use a tool named pep8, your code will be PEP 8 compliant. * If your code is PEP 8 compliant, a tool named pep8 will accept it. * The Python Standard Library is PEP 8 compliant. * Okay, at least the new parts of the standard library are PEP 8 compliant. * PEP 8 compliant code is inherently better than non-compliant code. * PEP8-ing existing code will improve it. * Once code is PEP 8 compliant, it can easily be kept that way through subsequent edits. * PEP 8 never changes. * Well, it never materially changes. * I mean, new advice, sure, but it'll never actually go back on a rule. Contributions welcomed. ChrisA