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
SystemError when __len__ returns a non-number #49387
Comments
len(obj) is not happy when obj.__len__() returns a non-number. |
Here's patch that raises a TypeError like 2.x. |
Wouldn't it be better to use PyNumber_AsSsize_t() instead, so as to |
Yes, good idea. |
I don't think you need to call PyNumber_Check() (unless you want to |
The patch is ok to me. (I assume all tests pass fine :-)) |
Thanks for the reviews! Fixed in r69451. |
This also solves bpo-3729. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: