Shift Confusion

James Kew james.kew at gmail.com
Thu Feb 24 12:41:56 EST 2005


"Dennis Lee Bieber" <wlfraed at ix.netcom.com> wrote in message 
news:pj0s11p3dn5o9nldsiklptce6j9ts26utf at 4ax.com...
> On 23 Feb 2005 22:06:54 -0800, "Kamilche" <klachemin at comcast.net>
> declaimed the following in comp.lang.python:
>
>>
>> Essentially, it should be possible to use a 'packed string' format in
>> Python, where as long as the characters you're sending are in the ASCII
>> range 0 to 127, two will fit in a byte.
>>
> Pardon? You are going to fit TWO 7-bit values into one 8-bit?

Quite. Although you can sort of see how one might naively arrive at this 
conclusion: one 7-bit char takes 0...127, which when you put it into an 
8-bit byte leaves 128...255 unused for a second char....

James





More information about the Python-list mailing list