Thoughts on PEP284

Stephen Horne $$$$$$$$$$$$$$$$$ at $$$$$$$$$$$$$$$$$$$$.co.uk
Tue Sep 23 02:10:50 EDT 2003


On Tue, 23 Sep 2003 01:14:57 -0400, "Sean Ross"
<sross at connectmail.carleton.ca> wrote:

>"Stephen Horne" <$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$.co.uk> wrote in
>message
>> Personally, I think the conventional '..' has more chance than your
>> '...'.
>
>Hi.
>Actually, I think '...' is more conventional notation for expressing a range
>of numbers. Like when you want to show a sequence:
>
># odd numbers greater than 3, but less than 257
>5, 7, 9, 11, ..., 255, 257
>
>That sort of thing.

Good point, but I think the commas are essential to making that clear.
Without the commas, it simply doesn't look like the same thing.


>I've seen it in Ruby and Smalltalk (where integers have such methods), and
>it's not '...' , nor is it range(), so that might be an alternative. Whether
>it is a good alternative ... <shrug>. It doesn't add new syntax, only new
>methods to existing objects.

That is also an advantage to my slicing idea - it only requires a new
method (__getitem__ IIRC) be implemented for one object (the builtin
type object called 'int').


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list