iters on ints? (reducing the need for range/xrange)

Rainer Deyke root at rainerdeyke.com
Fri Nov 9 09:08:11 EST 2001


"Luigi Ballabio" <ballabio at mac.com> wrote in message
news:mailman.1005305487.25887.python-list at python.org...
> This said, while it makes sense in english to say "do this for every line
> IN this file", it just doesn't sound right to me to say "do this for every
> number IN 10"---even though I've been once familiar with the definitions
of
> the set of all integers. I'd rather say "for every number UP TO 10" but
> that would mean introducing a new keyword which I'm not going to suggest,
> not me, sir.

I consider that a fairly weak argument.  Programming languages should be
simple, internally consistent, fairly easy to learn, well defined, and able
to express programs with minimum redundacy.  English is none of these, so
English should not be used a basis for creating a programming language.  As
an example, the for-else construct in Python is a good language construct,
even if it has no equivalent in English.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list