Guido van Rossum wrote: > > > Right. I was too fast. There is some speedup due to the string > > specialization. I'll post a patch to SF with some more tweaks > > of this implementation. Briefly: > > > > - do not call PyErr_Clear() systematically after PyObject_Compare(); > > only if (!error_restore && PyErr_Occurred()) > > What do you mean? The lookdict code checked in already checks > PyErr_Occurrs(). Was fast again. Actually PyErr_Clear() is called on PyErr_Occurred(). PyErr_Occurred() is called systematically after PyObject_Compare() and it will evaluate to true even if the error was previously fetched. So I mean that the test for detecting whether a *new* exception is raised by PyObject_Compare() is (!error_restore && PyErr_Occurred()) because error_restore is set only when there's a previous exception in place (before the call to Object_Compare). And only in this case we need to clear the new error. -- Vladimir MARANGOZOV | Vladimir.Marangozov@inrialpes.fr http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252
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