what does := means simply?

Chris Angelico rosuav at gmail.com
Fri May 18 21:26:31 EDT 2018


On Sat, May 19, 2018 at 11:10 AM, bartc <bc at freeuk.com> wrote:
> On 19/05/2018 02:00, Steven D'Aprano wrote:
>>
>> On Fri, 18 May 2018 20:42:05 -0400, Dennis Lee Bieber wrote:
>>
>>>         Unfortunately -- in the current era, "text" means "a defined
>>
>> encoding",
>>
>> Text has ALWAYS meant "a defined encoding". It is just that for a long
>> time, people could get away with assuming that the encoding they used was
>> the *only* possible encoding, and using it implicitly without even
>> thinking about it.
>>
>> That One True Encoding is, of course, EBCDIC.
>>
>> No, I kid, of course it is Mac-Roman.
>>
>> Ha ha, no, just pulling your leg... of course it's ISO 8859-1 (not to be
>> confused with ISO-8859-1, yes the hyphen is significant). Except for web
>> browsers, which are required to interpret declarations of ISO 8859-1 as
>> CP-1252 instead.
>>
>> Actually, I'm still kidding around. Everyone knows the One True Encoding
>> is ISCII. (That's not a typo.)
>
>
> The .ppm (really .pbm) file which was the subject of this sub-thread has its
> header defined using ASCII. I don't think an EBCDIC 'P4' etc will work.
>

"Defined using ASCII" is a tricky concept. There are a number of file
formats that have certain parts defined because of ASCII mnemonics,
but are actually defined numerically. The PNG format begins with the
four bytes 89 50 4E 47, chosen because three of those bytes represent
the letters "PNG" in ASCII. But it's defined as those byte values. The
first three represent "i&+" in EBCDIC, and that would be just as
valid, because you get the correct bytes.

Your file contains bytes. Not text.

ChrisA



More information about the Python-list mailing list