Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect return values of optimised builtin functions/methods #1246

Closed
robertwb opened this issue Apr 16, 2011 · 3 comments
Closed

incorrect return values of optimised builtin functions/methods #1246

robertwb opened this issue Apr 16, 2011 · 3 comments

Comments

@robertwb
Copy link
Contributor

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.

Migrated from http://trac.cython.org/ticket/688

@robertwb
Copy link
Contributor Author

scoder changed description from

In Python, some_list.sort() returns None. When optimised in Cython, it returns 0 on success or -1 on error instead.

Plus, Cython currently fails completely to handle the return value, so using the return value as Python object crashes as the value does not even get coerced.

This was found in a CPython unit test which tests the return value.

to

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.
summary from

incorrect return values of optimised builtin methods like list.sort()

to

incorrect return values of optimised builtin functions/methods
commented

@robertwb
Copy link
Contributor Author

scoder changed owner to scoder
status from new to assigned
commented

@robertwb
Copy link
Contributor Author

scoder changed milestone from wishlist to 0.15
resolution to fixed
status from assigned to closed
commented

Fixed here:

bba74d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant