>> A bug: >> >> >>> 'ab'.endswith('b',0,1) # right >> 0 >> >>> 'ab'.endswith('ab',0,1) # wrong >> 1 >> >>> 'ab'.endswith('ab',0,0) # wrong >> 1 >> >>> [Ka-Ping] > I assumed you meant that the extra arguments should be slices > on the string being searched, i.e. > > specimen.startswith(text, start, end) > > is equivalent to > > specimen[start:end].startswith(text) > > without the overhead of slicing the specimen? Or did i understand > you correctly? Yes, and e.g. 'ab'[0:1] == 'a', which does not end with 'ab'. So these are inconsistent today, and the second is a bug: >>> 'ab'[0:1].endswith('ab') 0 >>> 'ab'.endswith('ab', 0, 1) 1 >>> Or did I misunderstand you <wink>?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4