mguin...@gmail.com writes:

 > There should be a safer abstraction to these two basic functions.

There is: TextIOBase.read, then treat it as an array of code units
(NOT CHARACTERS!!)

 > More details in the issue:

Not at all persuasive.  I'm with Chris: you need to present the
abstraction you want.

One thing you don't seem to understand: Python does *not* know about
characters natively.  str is an array of *code units*.  This is much
better than the pre-PEP-393 situation (where the unicode type was
UTF-16, nowadays except for PEP 383 non-decodable bytes there are no
surrogates to worry about), but Python doesn't care if you use NFD,
and there are characters that have no composed version (some are the
kind of thing you see in @jwz's display name on Twitter, but some of
them are characters that exist in national standards but not in
Unicode NFC form, I believe).

If code points are good enough for you, you need to specify that.

-- 
I, too, gruntle.  What about it?
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/ITJDGIE72WNWW7OW2ERL7Q4BBQO54RZN/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to