wrapt
wrapt copied to clipboard
Improve efficiency of string comparisons in WraptObjectProxy_setattro().
When checking for 'self' prefix, currently invoking starts with() method of the string object.
It would be more efficient where the name is a string object to use PyString_AsString() to get access to the character array and then use strstr() or equivalent.
Similarly for a Unicode string and using Python 3, can use PyUnicode_AsUTF8AndSize().