Ethan Furman wrote:
Any reason this is not a bug?
Looks like someone else beat me to filing:
http://bugs.python.org/issue11828
Looks like they fixed it as well.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
Stefan Behnel wrote:
> Roy Smith, 27.05.2011 03:13:
> > Ethan Furman wrote:
> >
> >> --> 'this is a test'.startswith('this')
> >> True
> >> --> 'this is a test'.startswith('this', None, None)
> >> Traceback (most recent call last):
> >> File "", line 1, in
> >> TypeError: sl
Terry Reedy wrote:
> To me, that says pretty clearly that start and end have to be
> 'positions', ie, ints or other index types. So I would say that the
> error message is a bug. I see so reason why one would want to use None
> rather that 0 for start or None rather than nothing for end.
If you'r
Carl Banks wrote:
> The end parameter looks pretty useless for
> .startswith() and is probably only present for consistency with other
> string search methods like .index().
No, the end parameter could be useful if the slice ends up shorter than the
prefix string:
>>> 'abcd'.startswith('abc',
Roy Smith, 27.05.2011 03:13:
Ethan Furman wrote:
--> 'this is a test'.startswith('this')
True
--> 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__
method
[...]
On Thu, 26 May 2011 23:00:32 -0400, Terry Reedy wrote:
[...]
> To me, that says pretty clearly that start and end have to be
> 'positions', ie, ints or other index types. So I would say that the
> error message is a bug. I see so reason why one would want to use None
> rather that 0 for start or
On 5/26/2011 7:27 PM, Ethan Furman wrote:
I've tried this in 2.5 - 3.2:
--> 'this is a test'.startswith('this')
True
--> 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__
In article ,
Ethan Furman wrote:
> --> 'this is a test'.startswith('this')
> True
> --> 'this is a test'.startswith('this', None, None)
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: slice indices must be integers or None or have an __index__
> method
[...]
> Any re
Ethan Furman wrote:
> I've tried this in 2.5 - 3.2:
>
> --> 'this is a test'.startswith('this')
> True
> --> 'this is a test'.startswith('this', None, None)
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: slice indices must be integers or None or have an __index__
> me
On Thursday, May 26, 2011 4:27:22 PM UTC-7, MRAB wrote:
> On 27/05/2011 00:27, Ethan Furman wrote:
> > I've tried this in 2.5 - 3.2:
> >
> > --> 'this is a test'.startswith('this')
> > True
> > --> 'this is a test'.startswith('this', None, None)
> > Traceback (most recent call last):
> > File "", l
On 27/05/2011 00:27, Ethan Furman wrote:
I've tried this in 2.5 - 3.2:
--> 'this is a test'.startswith('this')
True
--> 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__
m
I've tried this in 2.5 - 3.2:
--> 'this is a test'.startswith('this')
True
--> 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__
method
The 3.2 docs say this:
str.sta
12 matches
Mail list logo