Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: How to get an integer from a sequence of bytes Date: Mon, 3 Jun 2013 14:31:45 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 31 Message-ID: References: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1370269905 3900 64.122.56.22 (3 Jun 2013 14:31:45 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 3 Jun 2013 14:31:45 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:46792 On 2013-06-03, Dennis Lee Bieber wrote: > On Sun, 02 Jun 2013 21:25:45 +0200, Mok-Kong Shen > declaimed the following in > gmane.comp.python.general: > > >> b'7' is the byte with the character 7 in a certain code, so that's >> ok. In other PLs one assigns an int to a byte, with that int in either > > In other languages "byte" is an 8-bit signed/unsigned numeric. That's a common assumption, but historically, a "byte" was merely the smallest addressable unit of memory. The size of a "byte" on widely used used CPUs ranged from 4 bits to 60 bits. Quoting from http://en.wikipedia.org/wiki/Byte "The size of the byte has historically been hardware dependent and no definitive standards existed that mandated the size." That's why IEEE standards always use the word "octet" when referring a value containing 8 bits. Only recently has it become common to assume that an "byte" contains 8 bits. -- Grant Edwards grant.b.edwards Yow! It's a lot of fun at being alive ... I wonder if gmail.com my bed is made?!?