<div dir="ltr">Out of curiosity, why do you prefer decimal values to refer to Unicode code points? Most references, <a href="http://unicode.org/charts/PDF/U0400.pdf">http://unicode.org/charts/PDF/U0400.pdf</a> (official) or <a href="https://en.wikibooks.org/wiki/Unicode/Character_reference/0000-0FFF">https://en.wikibooks.org/wiki/Unicode/Character_reference/0000-0FFF</a> , prefer to refer to them by hexadecimal as the planes and ranges are broken up by hex values.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 7, 2016 at 5:52 PM, Mikhail V <span dir="ltr"><<a href="mailto:mikhailwas@gmail.com" target="_blank">mikhailwas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In past discussion about inputing and printing characters,<br>
I was proposing decimal notation instead of hex.<br>
Since the discussion was lost in off-topic talks, I'll try to<br>
summarise my idea better.<br>
<br>
I use ASCII only for code input (there are good reasons for that).<br>
Here I'll use Python 3.6, and Windows 7, so I can use print() with unicode<br>
directly and it works now in system console.<br>
<br>
Suppose I only start programming and want to do some character manipulation.<br>
The vey first thing I would probably start with is a simple output for<br>
latin and cyrillic capital letters:<br>
<br>
caps_lat = ""<br>
for o in range(65, 91):<br>
caps_lat = caps_lat + chr(o)<br>
print (caps_lat)<br>
<br>
caps_cyr = ""<br>
for o in range(1040, 1072):<br>
caps_cyr = caps_cyr + chr(o)<br>
print (caps_cyr)<br>
<br>
<br>
Which prints:<br>
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br>
АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭ<wbr>ЮЯ<br>
<br>
<br>
Say, I want now to input something direct in code:<br>
<br>
s = "first cyrillic letters: " + chr(1040) + chr(1041) + chr(1042)<br>
<br>
Which works fine and has clean look. However it is not very convinient<br>
because of much typing and also, if I generate such strings,<br>
adds a bit more complexity. But in general it is fine, and I use this<br>
method currently.<br>
<br>
=========<br>
Proposal: I would want to have a possibility to input it *by decimals*:<br>
<br>
s = "first cyrillic letters: \{1040}\{1041}\{1042}"<br>
or:<br>
s = "first cyrillic letters: \(1040)\(1041)\(1042)"<br>
<br>
=========<br>
<br>
This is more compact and seems not very contradictive with<br>
current Python escape characters in string literals.<br>
So backslash is a start of some escaping in most cases.<br>
<br>
For me most important is that in such way I would avoid<br>
any presence of hex numbers in strings, which I find very good<br>
for readability and for me it is very convinient since I use decimals<br>
for processing everywhere (and encourage everyone to do so).<br>
<br>
So this is my proposal, any comments on this are appreciated.<br>
<br>
<br>
PS:<br>
<br>
Currently Python 3 supports these in addition to \x:<br>
(from <a href="https://docs.python.org/3/howto/unicode.html" rel="noreferrer" target="_blank">https://docs.python.org/3/<wbr>howto/unicode.html</a>)<br>
"""<br>
If you can’t enter a particular character in your editor or want to keep<br>
the source code ASCII-only for some reason, you can also use escape<br>
sequences in string literals.<br>
<br>
>>> "\N{GREEK CAPITAL LETTER DELTA}" # Using the character name<br>
>>> "\u0394" # Using a 16-bit hex value<br>
>>> "\U00000394" # Using a 32-bit hex value<br>
<br>
"""<br>
So I have many possibilities and all of them strangely contradicts with<br>
my image of intuitive and readable. Well, using charater name is readable,<br>
but seriously not much of a practical solution for input, but could be<br>
very useful<br>
for printing description of a character.<br>
<br>
<br>
Mikhail<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a></blockquote></div><br></div>