Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'plenty': 0.07; "'no": 0.09; '22,': 0.09; 'comment,': 0.09; 'issue:': 0.09; 'cc:addr :python-list': 0.11; 'anyway': 0.14; '23,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'illustrate': 0.16; 'merely': 0.16; 'name).': 0.16; 'namedtuple': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'trying': 0.19; 'replacing': 0.19; 'seems': 0.21; 'example': 0.22; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'sep': 0.31; 'subject:some': 0.31; 'probably': 0.32; 'quite': 0.32; 'cases': 0.33; 'comment': 0.34; 'could': 0.34; 'agree': 0.35; 'common': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'list': 0.37; 'does': 0.39; 'easy': 0.60; 'most': 0.60; 'numbers': 0.61; 'more': 0.64; '(that': 0.65; 'useful.': 0.68; 'obvious': 0.74; 'subject:!!!': 0.74; 'subject:get': 0.81; 'comment.': 0.84; 'understand,': 0.84; 'subject:Love': 0.91; 'to:none': 0.92 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 :content-type; bh=Zc4bshX89RQjyeKq1+TM6qPHFAdDXsTiWxBkJ+kpaIk=; b=zg0bP+qrcYGLuq5E20E0sm2RsxichjYbm6ibwTYXmecfV5FYQaE77o2MyCjqESQ1xv AxkMHPH6aNjQJ+wYg2LUqZ7F6LQxxwFgmEnPfdkdK/rcQyrhKlZ8LMM7rmB9/4Q7ZvHz 6mgIXzRXLjMbq1wgHba9NfZ6uDlXlnIgfZaChMbKOpf5KzVKiSsLLKjE/C9iBl+G5Wnj Wxs+tMlJEfNdJJlDbTQWh5QGTG5br2ndIVHyBPHBriDhY641QXmMGjzCXstbztgZCxUb rDJ25e9OeYfLdq9kbtlvSaJXN+MZkt1NIEmahjaJ7omRLMfXi+k1fLUqrJEFDDX9oCAl 91Yg== MIME-Version: 1.0 X-Received: by 10.50.102.106 with SMTP id fn10mr16380269igb.14.1411410334054; Mon, 22 Sep 2014 11:25:34 -0700 (PDT) In-Reply-To: References: <1142710437.7070860.1411401142913.JavaMail.root@sequans.com> Date: Tue, 23 Sep 2014 04:25:33 +1000 Subject: Re: Love to get some feedback on my first python app!!! From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1411410342 news.xs4all.nl 2845 [2001:888:2000:d::a6]:45682 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78176 On Tue, Sep 23, 2014 at 4:24 AM, Chris Kaynor wrote: > On Mon, Sep 22, 2014 at 8:52 AM, Jean-Michel Pichavant > wrote: >> >> Anyway it's seems we agree anyway because your example perfectly >> illustrate what I was trying to demonstrate: >> print(cells[2]) is very easy to understand, most of people would say 'no >> need of any comment'. I think it does require a comment. > > > But the thing that requires the comment is the "2", not the "print" or the > "cells". And that comes to a more common issue: any number other than 0 or 1 > in code most likely needs a comment (that comment could be merely a variable > name). Values of 0 or 1 may need a comment, but there are plenty of cases > where they are used quite clearly - its much less likely that other numbers > have obvious meaning. Or in this case, replacing the list with a namedtuple is probably more useful. ChrisA