[Python-ideas] Input characters in strings by decimals (Was: Proposal for default character representation)

Mikhail V mikhailwas at gmail.com
Thu Dec 8 00:06:38 EST 2016


On 8 December 2016 at 05:39, Random832 <random832 at fastmail.com> wrote:
> On Wed, Dec 7, 2016, at 22:06, Mikhail V wrote:
>> So you were catched up from the beginning with hex, as I see ;)
>> I on the contrary in dark times of learning programming
>> (that was C) always oriented myself on decimal codes
>> and don't regret it now.
>
> C doesn't support decimal in string literals either, only octal and hex
> (incidentally octal seems to have been much more common in the
> environments where C was first invented). I can think of one context
> where decimal is used for characters, actually, now that I think about
> it. ANSI/ISO standards for 8-bit character sets often use a 'split'
> decimal format (i.e. DEL = 7/15 rather than 0x7F or 127.)


That is true, it does not support decimals in string literals,
but I don't remember (it was more than 10 years ago) that
I used anything but decimals for text processing in C.
So normally load a file in memory, iterate over bytes,
compare the value, and so on.
And somewhat very foggy in my memory, but at that time
most ASCII tables included decimals and they stood
normally in the first column, but I can be wrong now,
got to google some original tables.

Jeez, how positive came this thread out, first Ethan said
it will be never implemented, and it turns out it has already
been implemented. Christmas magic.


More information about the Python-ideas mailing list