Carl Banks pavlovevide...@gmail.com 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:
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're
In article mailman.2144.1306471679.9059.python-l...@python.org,
Stefan Behnel stefan...@behnel.de 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
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
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 stdin, line 1, in module
TypeError: slice indices must be integers or None or have an
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 stdin, line 1, in
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 stdin, line 1, in module
TypeError: slice indices must be integers or None or have an __index__
In article mailman.2136.1306451668.9059.python-l...@python.org,
Ethan Furman et...@stoneleaf.us wrote:
-- 'this is a test'.startswith('this')
True
-- 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: slice indices
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 stdin, line 1, in module
TypeError: slice indices must be integers or None or have an
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
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 stdin, line 1, inmodule
TypeError: slice indices must be integers or None or have an __index__
method
11 matches
Mail list logo