Thought on PEP 204 and 276
Chris Liechti
cliechti at gmx.net
Mon May 27 16:11:02 EDT 2002
Steve Horne <steve at lurking.demon.co.uk> wrote in
news:ckp4fuc4fskjcpilnn2mrt3665fqvld92g at 4ax.com:
>
> I can't help being disappointed that PEP 204 was rejected. To me,
>
> for i in [0:10] :
>
> is much more intuitive than the PEP 276 version
>
> for i in 10 :
>
> As for the ideas like allowing '[1, 5:10, 20]'
but all those don't make a real imprevement (some would say the would make
the language worse). what would be more useful is the ability to write
different open/closed itervals, such as 0<i<=7 -> range(1,8).
if shortness is your motivation, just define "r=range" or make a class with
__getitem__ and give it a short name. i think such indeas came up when the
discussion happened.
and in the end, >>> import this: "explicit is better than implicit"
chris
--
Chris <cliechti at gmx.net>
More information about the Python-list
mailing list