Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: how to get the ordinal number in list Date: Mon, 11 Aug 2014 13:46:13 +0300 Organization: A noiseless patient Spider Lines: 37 Message-ID: <87d2c7wbgq.fsf@elektro.pacujo.net> 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> <87ha1jweq7.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="8044"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ViAmYnEPcFt3j2zRqjJON" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:7prcCfutskzURpQLcZzhtzNG3so= sha1:Xe94PWZMdt/jobGtIFnjCBFfjmc= Xref: csiph.com comp.lang.python:76045 Chris Angelico : > On Mon, Aug 11, 2014 at 7:35 PM, Marko Rauhamaa wrote: >> Python is a formal language with a well-defined syntax and reasonably >> well-understood semantics. That's all that matters. Any resemblance >> to the much more ad-hoc syntax of classical mathematics is almost >> coincidental. > > Well, it's a bit more than coincidence. It's the ELIZA effect: > > http://www.catb.org/jargon/html/E/ELIZA-effect.html > > Using notations that some people will be familiar with is better than > constructing brand new notations from scratch, even if not everyone > can gain that benefit. The main thing is that the definitions must be clear. I must be able to look up the precise description quickly, and in fact, I always have the Python Library Reference in a browser tab or two because I have to review even familiar functionality over and over again. Less often, I also have to review the Python Language Reference. You don't have to like the = sign or the trailing comma of 1-tuples. What matters is that you know how to use them. The second in priority is that the language/module should be faithful to its own principles. An example is the so-called "file-like objects" in Python. A different one would be the principle that a new indentation level is always introduced by a colon. Yet another specialty of Python is the numerous "magic" access points that have been named __xyz__. You don't have to like the naming of __init__. It doesn't have to have a precedent in other programming languages. However, it is important that it follows a general, rigorous Python pattern. Marko