On 8/10/19 7:05 AM, Chris Angelico wrote:
> On Sat, Aug 10, 2019 at 6:39 PM Paul Moore <p.f.mo...@gmail.com> wrote:
>> There are *many* valid ways to write Windows pathnames in your code:
>>
>> 1. Raw strings
>> 2. Doubling the backslashes
>> 3. Using pathlib (possibly with slash as a directory separator, where
>> it's explicitly noted as a portable option)
>> 4. Using slashes
>>
>> IMO, using slashes is the *worst* of these. But this latter is a
>> matter of opinion - I've no objection to others believing differently,
>> but I *do* object to slashes being presented as the only option, or
>> the recommended option without qualification.
> Please expand on why this is the worst?
>
> ChrisA

One big issue with trying to get use to using / on windows for the
directory separator is that it doesn't work for many windows programs
because on Windows the / character is defined to be the option character
(instead of - for *nix)

Yes, you can write your program to use the foreign convention of using -
for options, and because the system calls accept either \ or / as the
directory separator, paths which use the 'wrong' separator will work,
but your program will be violating the conventions of the host environment.

-- 
Richard Damon
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/RMEUSPLAST7INRQQDLILW3IYETWDITMV/

Reply via email to