# Add startswith and friends as methods on memoryview

**URL:** <https://discuss.python.org/t/add-startswith-and-friends-as-methods-on-memoryview/45681>\
**Category:** Ideas\
**Created:** [February 12, 2024, 12:18am UTC](https://discuss.python.org/t/add-startswith-and-friends-as-methods-on-memoryview/45681 "2024-02-12T00:18:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Daverball](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/daverball/32/15931_2.png) [@Daverball](https://discuss.python.org/u/Daverball)\
**Post date:** [February 12, 2024, 6:38am UTC](https://discuss.python.org/t/add-startswith-and-friends-as-methods-on-memoryview/45681/2 "2024-02-12T06:38:40Z")

</div>

You may also be interested in this recent discussion that came up in the context of PEP 467 which proposed more types of view objects and/or better interpreter level support for zero-copy slice operations:

> [@More kinds of view objects in the standard library to enable zero copy slicing](https://discuss.python.org/t/more-kinds-of-view-objects-in-the-standard-library-to-enable-zero-copy-slicing/45500):
>
> Big +1 for this, especially if we can also have a writeable strview backed by e.g. a io.StringIO object. It always kind of irked me how wasteful str is for simple slicing operations (or concat in the writeable case, although StringIO is a decent solution there, but the API for a strview could be a bit more ergonomic compared to StringIO, since you’d likely want strview to be fully compatible with str, i.e. everywhere that accepts a str can also take a strview without any surprises, so things li…

---

_[View the full topic](https://discuss.python.org/t/add-startswith-and-friends-as-methods-on-memoryview/45681)._
