Allow returning memoryview in StreamingResponse#2576
Conversation
|
What's the use case? To create the |
|
Memoryview allows you to efficiently return a slice of the original bytes value without copying. This is especially convenient when you want to strip some prefix or header of some value in memory you don’t control. |
|
Yup I'd say the use cases are varied, it allows moving around bytes with zero copying. |
|
This is a PR without description, and there's a single discussion that mentioned this feature request (that is 4 years old) without reactions. Also, this can be easily done by overriding the |
|
Feel free to revert it if you don’t agree. To me it made sense and was simple. |
|
Thanks for this! Useful when transmitting buffers from numpy array without copying. |
Summary
Checklist