On Jul 14, 2010, at 3:43 PM, M.-A. Lemburg 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>' > > I would have expected str(m) == 'abc'.
That is also my expectation. A memoryview object is iterable, so str(memviewobj) should return ''.join(memviewobj). In your example, that would be: >>> list(m) ['a', 'b', 'c'] >>> ''.join(m) 'abc' Raymond _______________________________________________ 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