[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: not a bug -> out of date ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Dan, thanks for the suggestion. Changing to PyObject_Size() would have been the right thing to do if the error message had not been fixed. But since the new error message "TypeError: dict is not a sequence" is more helpful than "TypeError: 'dict' object

[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was fixed in issue32500. This is a new feature and it was not backported. >>> bisect.bisect_right(dict.fromkeys(range(10)), 5) Traceback (most recent call last): File "", line 1, in TypeError: dict is not a sequence >>> bisect.bisect_right(dict.fromkey

[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Dan Snider
New submission from Dan Snider : internal_bisect_left and internal_bisect_right use PySequence_Size when a "hi" argument wasn't provided, which causes this silly error message: >>> bisect.bisect_right(dict.fromkeys(range(10)), 5) Traceback (most recent call last): File "", line 1