Text-mode apps (Was :Who are the "spacists"?)

Chris Angelico rosuav at gmail.com
Sat Apr 1 17:22:21 EDT 2017


On Sun, Apr 2, 2017 at 7:06 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
> Chris Angelico <rosuav at gmail.com>:
>
>> On Sun, Apr 2, 2017 at 6:47 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
>>> A far more convenient escaping scheme could have been devised for
>>> pathnames.
>>
>> Definitely. We should treat file names like domain names. "Bücher.ch"
>> gets represented internally as "xn--bcher-kva.ch". That would solve
>> all the problems, and there's no way that it could create more.
>
> Note that Python can express any text string, including one with a quote
> character. I don't know if Python's escaping scheme is creating more
> problems than it is solving.

Yes it can; however, there is no way within Python to have a string
that can represent two strings, which is what directory separators do.
Ultimately, all you really get by referencing Python's string literals
is an escaping system: "\\" for a backslash, and then you can use "\?"
for various special symbols to change their meaning.

ChrisA


More information about the Python-list mailing list