incorrect return values of optimised builtin functions/methods
|Reported by:||scoder||Owned by:||scoder|
Description (last modified by scoder)
In Python, calls to setattr() or some_list.sort() return None. When optimised in Cython, they return 0 on success or -1 on error instead. The 0 return value is visible to user code.
Plus, Cython currently fails to handle the return value in some cases, so using the return value as Python object can crash as the value may not even get coerced.
This was found in a CPython unit test which tests the return value.
Change History (3)
comment:1 Changed 4 years ago by scoder
- Description modified (diff)
- Summary changed from incorrect return values of optimised builtin methods like list.sort() to incorrect return values of optimised builtin functions/methods