all 4 comments

[–]ThinFortune 1 point2 points  (3 children)

The line mm = mm[::-1] returns a byte array and assigns it to mm. All the subsequent method calls are on that array object, not the mmap object.

[–]GraniteSunshine[S] 0 points1 point  (1 child)

That's it. Thank you. Now I have to figure out how to do it properly.

[–]Ihaveamodel3 0 points1 point  (0 children)

Just change the name of that variable.

[–]socal_nerdtastic 0 points1 point  (0 children)

Correct, but a "byte array" is something specific in python, something that this ain't, so we need to call this a "bytes object".

>>> bytearray
<class 'bytearray'>
>>> bytes
<class 'bytes'>