# test memoryview retains pointer to original object/bufferb=bytearray(10)m=memoryview(b)[1:]foriinrange(len(m)):m[i]=i# reclaim b, but hopefully not the bufferb=Noneimportgcgc.collect()# allocate lots of memoryforiinrange(100000):[42,42,42,42]# check that the memoryview is still what we wantprint(list(m))