Range Literals (was Re: [ANNOUNCE] Python Enhancement Proposals on the Web)

Ben Wolfson rumjuggler at cryptarchy.org
Fri Jul 21 17:58:53 EDT 2000


On Fri, 21 Jul 2000 08:27:53 +0200, Thomas Wouters <thomas at xs4all.net>
wrote:

>On Fri, Jul 21, 2000 at 12:53:25AM +0000, Peter Schneider-Kamp wrote:
>
>> The so called PEPs (Python Enhancement Proposals) are now
>> available on the web at
>
>> PEPs that already carry some content include:
>
>> 0204  Range Literals                       twouters
>
>Damn, Peter beat me to it ;) This PEP is in first draft, so any and all
>comments are welcome. Do people want me to post it here in full glory, or is
>the webpage accessible enough ?
>
>Note: I don't think this subject will raise as much discussion as new
>operators or the name of a new function ;) but I would prefer it if
>discussion was kept at a minimum: I'll try to incorporate all opinions in
>the PEP, and I'm certainly not trying to be some kind of spanish
>inquisition, but the reason I ask this is very simple: I wouldn't be able to
>keep up with the posting frenzy ;-P
>
>But if we can keep it down to, ooh, a hundred or so postings a day, I think
>I can manage.... ;P

Well, in the PEP you give an example of a non-numerical range literal,
['a':'z'].  But in the current slice notation, that would result in a list
with elements from a to y.  There isn't a one-after-z letter, so how would
a list with elements from a to z be constructed?

Also, I think that ['a':'z':'b'], as a way to indicate step, is much less
legible than ['a':'z':2].

-- 
Barnabas T. Rumjuggler

The night of time far surpasseth the day, and who knows when was the
equinox?
 -- Thomas Browne



More information about the Python-list mailing list