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.

Author rhettinger
Recipients rhettinger, veky
Date 2018-06-23.20:03:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529784186.84.0.56676864532.issue33933@psf.upfronthosting.co.za>
In-reply-to
Content
This probably doesn't warrant another tracker entry.  Serhiy already had a PR for this and attached it to the original bug report for https://bugs.python.org/issue32500 .  See https://github.com/python/cpython/pull/7846

My suggestion would be to just change the error message in PySequence_Size() from "object of type '%.200s' has no len()" to "object of type '%.200s' has no len() or does not support the sequence protocol (consider using a list instead)".

Marking this as low priority because the behavior has existed for a very long time and hasn't bothered anyone until now (possibly because the bisect module is documented to only search lists).  Also, this is a specific instance of a more general, pervasive, and hard problem where low level routines raise exceptions that have error messages than may not make much sense from the point of view someone calling higher level APIs.

Suggest closing this as a duplicate and continuing the discussion back in issue32500 where it arose.  This would show-up in any C code that calls PySequence_Size() not just bisect.
History
Date User Action Args
2018-06-23 20:03:06rhettingersetrecipients: + rhettinger, veky
2018-06-23 20:03:06rhettingersetmessageid: <1529784186.84.0.56676864532.issue33933@psf.upfronthosting.co.za>
2018-06-23 20:03:06rhettingerlinkissue33933 messages
2018-06-23 20:03:06rhettingercreate