Why Python does *SLICING* the way it does??

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Apr 21 21:29:48 EDT 2005


Roy Smith wrote:

> What would actually be cool is if Python were to support the normal math 
> notation for open or closed intervals.
 >
> foo = bar (1, 2)
> foo = bar (1, 2]
> foo = bar [1, 2)
> foo = bar [1, 2]
> 
> That would certainly solve this particular problem, but the cost to the 
> rest of the language syntax would be rather high :-)

Not to mention the sanity of everyone's editors when
they try to do bracket matching!

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list