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
add rotate{left,right} methods to bytearray #47739
Comments
While tweaking the BufferedWriter implementation it came to me that it (or, if memoryview is one day implemented it could be a memoryview |
Sadly, this isn't quite as easy as it would seem. The O(1) memory The simple version that copies out the small part of the shift into a Offering this ability in the momoryview object would be very |
Hi,
You are right, I was overly optimist when thinking about this.
I'm not sure what you mean, but I think we can just restrict it to the shift{left,right} could be useful too (and faster). |
In order for MemoryView to know what bytes it is pointing to in memory, |
Le vendredi 08 août 2008 à 21:44 +0000, Josiah Carlson a écrit :
Hmm, I think it's simpler if the rotate is done in-place rather than |
Am -1 on this. Rotating byte arrays has very few use cases and the ones |
Antoine, do you disagree with Raymond or should we close this? |
Antoine, do you want to pursue, or can we close this? |
I think we can close. bpo-17100 would have been more useful actually. |
I think you rather need the inplace shift operation. Or even the move the tail of buffer to the start without filling the remaining. I.e. something like
but without creating immediate bytes object. Now it may be written as:
|
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: