Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!roy From: Roy Smith Newsgroups: comp.lang.python Subject: Re: how to get the ordinal number in list Date: Sun, 10 Aug 2014 18:01:08 -0400 Organization: PANIX Public Access Internet and UNIX, NYC Lines: 30 Message-ID: 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> NNTP-Posting-Host: localhost X-Trace: reader1.panix.com 1407708069 8518 127.0.0.1 (10 Aug 2014 22:01:09 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Sun, 10 Aug 2014 22:01:09 +0000 (UTC) User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: csiph.com comp.lang.python:76005 In article , Mark Lawrence wrote: > On 10/08/2014 19:26, Rustom Mody wrote: > > > > Its when we have variables that are assigned in multiple places that > > we start seeing mathematical abominations like > > x = x+1 > > > > I'm not bothered about it being a mathematical or any other type of > abomination. It works, practically beats purity, so if it ain't broke, > please don't fix it, for some definition of fix. I'm with Mark. This isn't math, it's programming. Sure, the intersection of the two is non-null, but they are different things. I'll often do things like: for line in input: line = line.strip() # do more stuff Sure, I could invent some other variable name to avoid re-using the same name, but does: for line in input: stripped_line = line.strip() # do more stuff really make this any easier to read or understand? I think not.