Skip to content

Instantly share code, notes, and snippets.

@njsmith
Created May 1, 2017 05:52
Show Gist options
  • Save njsmith/0ffd38ec05ad8e34004f34a7dc492227 to your computer and use it in GitHub Desktop.
Save njsmith/0ffd38ec05ad8e34004f34a7dc492227 to your computer and use it in GitHub Desktop.
pypy3's memoryview is very clever
>>>> b = bytearray(10)
>>>> m = memoryview(b)
>>>> m._pypy_raw_address()
140164544488368
>>>> b += bytes(100)
>>>> m._pypy_raw_address()
140164544178608
>>>> b[0] = 1
>>>> m[0]
1
>>>> m[0] = 2
>>>> b[0]
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment