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

David Mertz mertz at gnosis.cx
Thu Dec 8 12:35:32 EST 2016


The Unicode Consortium reference entirely lacks decimal values in all their
tables. EVERYTHING is given solely in hex. I'm sure someone somewhere had
created a table with decimal values, but it's very rare.

We should not change Python syntax because exactly one user prefers decimal
representations. At most there can be an external library to cover strings
in whatever manner he wants. Why is octal being neglected for us old
fogeys?! 😏

On Dec 7, 2016 6:11 PM, "Mikhail V" <mikhailwas at gmail.com> wrote:

> On 8 December 2016 at 01:57, Nick Timkovich <prometheus235 at gmail.com>
> wrote:
> >> hex notation not so readable and anyway decimal is kind of standard way
> to
> >> represent numbers
> >
> >
> > Can you cite some examples of Unicode reference tables I can look up a
> > decimal number in? They seem rare; perhaps in a list as a secondary
> column,
> > but they're not organized/grouped decimally. Readability counts, and
> > introducing a competing syntax will make it harder for others to read.
>
> There were links to such table in previos discussion. Googling
> "unicode table decimal" and
> first link will it be.
> I think most online tables include decimals as well, usually as tuples
> of 8-bit decimals.
> Also earlier the decimal code was the first column in most tables, but
> it somehow settled in
> peoples' minds that hex reference should be preferred, for no solid reason
> IMO.
> One reason I think due to HTML standards which started to use it in html
> files
> long ago and had much influence later, but one should understand,
> that is just for brevity in most cases. Other reason is, file viewers
> show hex by
> default, but that is just misfortune, nothin besides brevity and 4-bit
> word alignment
> gives the hex notation unfortunatly, at least in its current typeface.
> This was discussed actually in that thread.
> Many people also think they are cool hackers if they make everything in
> hex :)
> In some cases it is worth it, but not this case IMO. Mainly for
> bitwise stuff, but
> then one should look into binary/trinary/quaternary representation
> depending on nature
> of operations and hardware.
>
> Yes there is unicode table pagination correspondence in hex reference,
> but that hardly plays
> any positive role for real applications, most of the time I need to
> look in my code
> and also perform number operations on *specific* ranges and codes, but not
> on whole pages of the table. This could only play role if I do
> low-level filtering of large files
> and want to filter out data after character's page, but that is the
> only positive thing
> I can think of, and I don't think it is directly for Python.
>
> Imagine some cryptography exercise - you take 27 units, you just give
> them numbers (0..26)
> and you do calculations, yes you can view results as hex numbers, but
> I don't do it and most people
> don't and should not, since why? It is ugly and not readable.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161208/7e32c4d2/attachment.html>


More information about the Python-ideas mailing list