-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
bytes(x) is slow when x is bytearray #71891
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
Comments
When bytes(x), bytes_new checks if x is integer via PyNumber_AsSize_t(x). When x is not an integer, especially bytearray or memoryview, the internal # HEAD # this patch |
the patch seems to be fine. |
bytearray suffers from the same issue. It would be nice to optimize it too. |
Hi Serhiy Thank you for your feedback. Stephane |
Thanks for comments. |
LGTM. |
New changeset 789a42401009 by Serhiy Storchaka in branch 'default': |
Thank you for your contribution Naoki. |
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: