Re: [Python-Dev] sliceobject Py_None step inquiry

2007-12-11 Thread Calvin Spealman
I think that should not change. None is different than 0. It makes sense to use it as a "use the default value" kind of place holder. Silently using 1 when you pass 0 is a very different thing. Maybe the slice was calculated and the developer should know about it being 0, because in this cas

[Python-Dev] sliceobject Py_None step inquiry

2007-12-11 Thread Joseph Armbruster
I was playing around with sliceobject.c this evening and noticed the following behavior. If you slice with a step 0, you receive a ValueError but when you slice with a step of None, the step is set to 1. As an example, observe the following interactive session: >>> a = [1,2,3,4,5,6] >>> b