[issue20339] Make bytes() use tp_as_buffer for cmp

Stefan Krah report at bugs.python.org
Tue Oct 14 17:39:03 CEST 2014


Stefan Krah added the comment:

The comparisons can be somewhat meaningless though:

>>> from _testbuffer import *
>>> x = ndarray([1.1, 2.2, 3.3, 4.4, 5.5, 6.6], shape=[2,3], format="f")
>>> x.tolist()
[[1.100000023841858, 2.200000047683716, 3.299999952316284], [4.400000095367432, 5.5, 6.599999904632568]]
>>> memoryview(x) < bytearray(b'b')
False

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20339>
_______________________________________


More information about the Python-bugs-list mailing list