On Thu, 15 Jul 2010 00:43:49 +0200
"M.-A. Lemburg" <m...@egenix.com> wrote:
> Is this intended or should I open a bug report for it:
> 
> >>> m = memoryview('abc')
> >>> m == 'abc'
> True
> >>> str(m) == 'abc'
> False
> >>> str(m)
> '<memory at 0x2b2bb6ee26d8>'

Well, I think this is intended. str(m) is the human-readable string
representation of the memoryview. In 3.x, you would write bytes(m)
instead to have its bytes contents.
Or, better again, use m.tobytes() in both versions.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to