Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'computing,': 0.04; 'instance,': 0.05; 'subject:Python': 0.05; 'python': 0.08; '16-bit': 0.09; '>>>>': 0.09; 'braces': 0.09; 'readable': 0.09; 'am,': 0.12; 'c++': 0.12; '16,': 0.15; '10:59': 0.16; 'declaration': 0.16; 'delimit': 0.16; 'from:addr:alec.taylor6': 0.16; 'from:name:alec taylor': 0.16; 'inclusive.': 0.16; 'infinitely': 0.16; 'odd,': 0.16; 'perhaps,': 0.16; 'scopes': 0.16; 'cc:addr:python-list': 0.16; 'syntax': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'sfxlen:2': 0.19; 'programming': 0.20; 'memory': 0.21; 'cc:no real name:2**0': 0.21; 'maybe': 0.21; 'header:In- Reply-To:1': 0.22; 'indices': 0.23; 'literal': 0.23; 'object,': 0.24; 'cc:2**0': 0.26; '(in': 0.26; 'code': 0.26; 'work.': 0.27; 'url:mailman': 0.27; 'function': 0.27; 'code,': 0.28; 'work,': 0.28; 'mainly': 0.28; 'variable': 0.28; 'language.': 0.28; 'described': 0.28; "i'm": 0.28; 'message-id:@mail.gmail.com': 0.29; 'explicit': 0.29; 'far.': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'fairly': 0.30; 'coding.': 0.30; 'object.': 0.30; 'chris': 0.30; 'pretty': 0.31; 'usually': 0.31; 'url:listinfo': 0.32; 'note,': 0.32; 'returning': 0.32; 'thu,': 0.32; "i've": 0.32; 'does': 0.32; 'that,': 0.32; 'list': 0.32; 'languages': 0.32; 'there': 0.33; 'instead': 0.33; 'fri,': 0.34; 'someone': 0.34; 'integer': 0.34; 'nested': 0.34; 'however,': 0.35; 'something': 0.35; 'url:python': 0.35; 'element': 0.37; 'variables': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'using': 0.37; 'received:209.85': 0.38; 'uses': 0.38; 'could': 0.38; 'relatively': 0.39; 'url:org': 0.39; 'received:209.85.215': 0.39; 'received:209': 0.39; 'everyone': 0.39; 'being': 0.40; 'back': 0.60; 'range': 0.61; "you'll": 0.61; 'john': 0.61; "you've": 0.61; 'your': 0.61; 'fact,': 0.63; 'piece': 0.66; 'special': 0.66; 'bible': 0.67; 'on...': 0.67; 'amazing': 0.68; 'benefit': 0.69; 'soon': 0.72; 'learned': 0.73; 'hand,': 0.76; 'lose': 0.84; 'difference.': 0.84; 'inclusive': 0.84; 'intervals': 0.84; 'passage': 0.84; 'pcs': 0.84; 'ranks': 0.84; 'easy!': 0.91; 'to:addr:mail.python.org': 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:to :cc:content-type:content-transfer-encoding; bh=BAEuZrrw+vPpyW+uvkr/t2J4ki6A2vvA6LNYo/dHzF8=; b=g4RBcmbgjN8gk9XfEZ/XPrWjjX51MBzr3GSx4xkDuvzcA2/IW2kt7zeOhwPH0ZeMTC zILaI0h/OlmtM40QbleuPGl2BEv8oTpJRp+E5lQzd0AnVFl5npvbp/HO5UToangL5tuA uxA2GrnFnt3Zf9gI/WtJVfcbpS8f7jrYpFacRMfp396ToPJc1hhrX4E+p7qDEQISaLbL q3+82mvYsgMmXCe+5+c0SzgHRsFJHSzHDbCnvjrTebFG3DObAKiFSKonnc4SyIYkeDOy z/DBT/dRMW5GXY1hrqNnHNWT7f0+NRGqvCfaLDSkp1PAKiv5LocNYJjpX6GUTjEquM5g cKpg== MIME-Version: 1.0 In-Reply-To: <4f61f9bf$0$1381$4fafbaef@reader2.news.tin.it> References: <4f612b19$0$1379$4fafbaef@reader2.news.tin.it> <8e72d74f-c844-4de3-8a37-f6b1fdc2291f@y27g2000yqy.googlegroups.com> <50e9ceec-40f1-4ead-b2b6-87328b30d084@ow8g2000pbc.googlegroups.com> <4f61c828$0$1390$4fafbaef@reader2.news.tin.it> <4f61d221$0$1375$4fafbaef@reader2.news.tin.it> <4f61d9a2$0$1377$4fafbaef@reader2.news.tin.it> <4f61f9bf$0$1381$4fafbaef@reader2.news.tin.it> Date: Fri, 16 Mar 2012 03:01:42 +1100 Subject: Re: Python is readable From: Alec Taylor To: Kiuhnm Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 97 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1331827305 news.xs4all.nl 6889 [2001:888:2000:d::a6]:35480 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21691 On Fri, Mar 16, 2012 at 1:16 AM, Kiuhnm wrote: > On 3/15/2012 13:21, Chris Angelico wrote: >> >> On Thu, Mar 15, 2012 at 10:59 PM, Kiuhnm >> =A0wrote: >>> >>> On 3/15/2012 12:47, Chris Angelico wrote: >>>> >>>> It's a little odd, perhaps, if seen in a vacuum. But everything counts >>>> from zero - list indices, etc - so it makes sense for range(len(lst)) >>>> to return indices valid for lst. >>> >>> >>> Maybe range uses [...) intervals? So range(a,b) is a,a+1,a+2,...,b-1 an= d >>> range(b) is just short-hand for range(0,b)? >> >> >> Yup. It's amazing how accurate your conjectures are - it's almost like >> you've been reading the docs! :D > > > Come on... that was easy! :) > > >> But yeah, that's pretty logical IMHO; >> and having gotten used to [) intervals in many areas of computing, >> I've come to find [] intervals disconcerting. Bible passages are >> described as, for instance, John 14:5-7, which is a three-verse >> passage (5, 6, 7), even though 7-5=3D2. > > > Common people use mainly inclusive intervals as far as I can tell. > For instance, "from" and "to" are inclusive. > They could tell you they don't like your intervals because 8-5+1 =3D 4 in= stead > of 3. > > >> However, inclusive-inclusive intervals have the benefit that they >> don't require the element "beyond the last" to be indexable. This is >> important if you're working with something that takes up all of >> addressable memory - going back to the IBM PCs on which I learned to >> code, you could use one 64KB segment for an array, but then there's no >> way for a 16-bit integer to indicate "past the end". > > > But you lose the empty interval (a,a). You're forced to use (a,a-1) or > something similar. There's always a drawback. > >>>> List comps are pretty readable if you know how programming languages >>>> work. Python need not be readable by everyone and his grandmother, and >>>> it does a fairly good job of being grokkable to someone who has a few >>>> ranks in Coding. (Yeah, I'm a D&D nerd. ) >>> >>> >>> I like what I've seen so far. >> >> >> Python has its problems, but it's a good language. I personally prefer >> to delimit blocks of code with braces than with indentation, > > > I, on the other hand, prefer indentation. I find braces redundant (in fac= t, > I never use them in pseudo-code). > > >> and I >> also prefer explicit declaration of variables (yes, it's extra work, >> but you can have infinitely nested scopes and easily-caught syntax >> errors when you misspell one), but they're relatively minor. > > > I usually declare my variables but close to where I need them. > > >> One of my >> favorite aspects of Python is that *everything* is an object. There's >> no magic syntax that gives you a piece of an object, or something >> special about variables that contain this, that, or the other. A >> literal list [like, this, one] can be used in exactly the same ways as >> the name of a variable containing a list or a function call returning >> a list - there is no difference. Oh how I yearn for that when working >> in C++ or PHP! > > > Don't worry. Soon you'll be using C++0x :))) > > Kiuhnm > -- > http://mail.python.org/mailman/listinfo/python-list C++0x? You mean C++11? :P On that note, is Python upgrading to use C11? :V