On Fri, Jan 6, 2017 at 4:43 PM, Serhiy Storchaka <storchaka at gmail.com> wrote: > Compare these two calls: >> >> from array import array >>>>> bytes(array('h', [1, 2, 3])) >>>>> >>>> b'\x01\x00\x02\x00\x03\x00' >> >> and >> >> bytes(array('f', [1, 2, 3])) >>>>> >>>> b'\x00\x00\x80?\x00\x00\x00@\x00\x00@@' >> > > I don't see a difference. Hmm indeed. Doesn't this contradict the documentation? >>> help(bytes) .. class bytes(object) | bytes(iterable_of_ints) -> bytes | bytes(string, encoding[, errors]) -> bytes | bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer .. This suggests that iterable_of_ints is tried first. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20170106/37347723/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4