[issue3106] speedup some comparisons

Marc-Andre Lemburg report at bugs.python.org
Mon Dec 15 20:27:58 CET 2008


Marc-Andre Lemburg <mal at egenix.com> added the comment:

On 2008-12-15 16:34, Antoine Pitrou wrote:
> Antoine Pitrou <pitrou at free.fr> added the comment:
> 
> Le lundi 15 décembre 2008 à 14:41 +0000, Marc-Andre Lemburg a écrit :
>> Why have you removed the complete error handling section in
>> PyUnicode_RichCompare() ?
> 
> Because the only error that can occur is a TypeError when one of the two
> arguments is not an unicode object, and that is handled by returning
> Py_NotImplemented at the end.
> (there is no implicit bytes -> unicode coercion anymore, and therefore
> things are much simpler)

Ah, sorry, just saw that this is just for Py3.

The fast-path would probably also make sense for Py2 (keeping the
error handling, of course).

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3106>
_______________________________________


More information about the Python-bugs-list mailing list