enhancing slicing
Mikael Olofsson
mikael at isy.liu.se
Thu Aug 23 10:42:30 EDT 2001
On 23-Aug-2001 gbreed at cix.compulink.co.uk wrote:
> v[5 :][: 2]
Yuck!
> v[:5 ][ -2:]
Double yuck!!
Besides being ugly (for your purpose), it's already valid syntax:
>>> v=[[1,2,3],[4,5,6],[7,8,9]]
>>> v[1:][:1]
[[4, 5, 6]]
>>> v[:1][1:]
[]
> Shall I start on the PEP?
Please don't. Spend your time on something that at least has a slight
chance of being accepted instead. See other comments in this thread.
/Mikael
-----------------------------------------------------------------------
E-Mail: Mikael Olofsson <mikael at isy.liu.se>
WWW: http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone: +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date: 23-Aug-2001
Time: 16:31:57
/"\
\ / ASCII Ribbon Campaign
X Against HTML Mail
/ \
This message was sent by XF-Mail.
-----------------------------------------------------------------------
Linköpings kammarkör: www.kammarkoren.com
More information about the Python-list
mailing list