X-Received: by 10.66.159.228 with SMTP id xf4mr4655210pab.24.1407734599107; Sun, 10 Aug 2014 22:23:19 -0700 (PDT) X-Received: by 10.50.66.135 with SMTP id f7mr449338igt.3.1407734599002; Sun, 10 Aug 2014 22:23:19 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!h18no11402025igc.0!news-out.google.com!px9ni599igc.0!nntp.google.com!h18no11402019igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Sun, 10 Aug 2014 22:23:18 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=59.95.27.212; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui NNTP-Posting-Host: 59.95.27.212 References: <53E658CD.5020904@gmail.com> <53e59035$0$29998$c3e8da3$5496439d@news.astraweb.com> <338e8fb0-c9ec-462a-b560-1c1ff77de17e@googlegroups.com> <154cc342-7f85-4d16-b636-a1a953913c98@googlegroups.com> <8c41d779-0c26-430a-a915-08c2b962e0e7@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: how to get the ordinal number in list From: Rustom Mody Injection-Date: Mon, 11 Aug 2014 05:23:19 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.python:76022 On Monday, August 11, 2014 12:33:59 AM UTC+5:30, Chris Angelico wrote: > On Mon, Aug 11, 2014 at 4:26 AM, Rustom Mody wrote: > > Its when we have variables that are assigned in multiple places that > > we start seeing mathematical abominations like > > x = x+1 > That's an abomination to you because it breaks your mathematical > model. It's fine to a computer, which has a sense of time. It does?!?! Completely missed the news flash Last I knew they were as dumb as a rock -- maybe a GHz rock A C programmer asked to swap variables x and y, typically writes something like t = x; x = y; y = t; Fine, since C cant do better. But then he assumes that that much sequentialization is inherent to the problem... Until he sees the python: x,y = y,x The same applies generally to all programmers brought up on imperative style. Yeah there are problems that need to address time -- OSes, network protocols, reactive systems like window managers etc But the vast majority of problems that a programmer is likely to solve dont need time. These are of the form: Given this situation, this is the desired outcome. Nothing wrong with giving a sequential solution to a not inherently sequential problem. What is wrong is then thinking that all *problems* are sequential rather than seeing that some over-specific sequential *solutions* to non-sequential problems are ok. A mindset exemplified by your hilarious statement: "computers have a sense of time"