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

Marko Rauhamaa marko at pacujo.net
Sat Apr 1 17:35:48 EDT 2017


Chris Angelico <rosuav at gmail.com>:

> there is no way within Python to have a string that can represent two
> strings, which is what directory separators do.

Really? Try:

   >>> repr(("a", "b"))
   "('a', 'b')"

There! A string that represents two strings.

Note, however, that Python programs generally don't restrict themselves
to expressing objects via strings. There are even objects with no string
representation at all.

A pathname is a list of strings. Python could naturally express it as
just that:

  [ "usr", "bin", "python3" ]


I'm not really proposing any change to the status quo. What's done is
done. However, I do think it is awkward to ban one particular, very
common character while allowing all the rest.


Marko



More information about the Python-list mailing list