This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: non-uniform behavior in 'startswith' / 'endswith'
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: georg.brandl, rhettinger, sf-robot, t-milich
Priority: normal Keywords:

Created on 2006-07-10 19:49 by t-milich, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg29129 - (view) Author: Milind (t-milich) Date: 2006-07-10 19:49
compare the two versions of 'endswith'.
Either  both of them should throw TypeErorr or both 
should return boolean value. 


>>> 'abc'.endswith( ('abc',None))

True

>>> 'abc'.endswith( ('abc',None),4,3)

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

TypeError: expected a character buffer object

msg29130 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-07-10 20:15
Logged In: YES 
user_id=849994

The current code shortcuts if it finds a match, so I think
this is not a bug. Raymond?
msg29131 - (view) Author: SourceForge Robot (sf-robot) Date: 2006-08-08 02:20
Logged In: YES 
user_id=1312539

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43645
2006-07-10 19:49:26t-milichcreate