On Fri, Feb 5, 2021 at 10:17 AM Ben Rudiak-Gould <benrud...@gmail.com> wrote:
> 'L' could be argued to be unnecessary if there's a simple way to achieve the 
> same thing with the encoding parameter (which currently there isn't).
>

I'd rather work that one out the opposite way, having
encoding="locale" (or encoding="system" or something), and then that
distinction won't apply. Whether that's PEP 597 or something else, an
encoding parameter is the logical way to do this.

The mode parameters have significant impact on the overall behaviour
of the resulting file object. If you specify "r", you get something
that you can read from; specify "w" and you get something you can
write to. With "t", it takes/gives Unicode objects, but with "b" it
uses bytes. The encoding parameter controls how it transforms what's
on disk into the Unicode strings it returns, but regardless of that
value, it will always be returning strings (or accepting strings, when
writing). The choice of encoding is, by comparison, a much less
significant difference.

(Yes, there's the "U" flag for universal newlines, but that's deprecated.)

ChrisA
_______________________________________________
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/YVBATPDALTE3ZIF5BFPD6KZFE4UDLP5D/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to