On 2019-11-03 00:38, Chris Angelico wrote:
On Sun, Nov 3, 2019 at 11:34 AM Eric V. Smith <e...@trueblade.com> wrote:
On 11/2/2019 7:24 PM, Steven D'Aprano wrote:
> I see no reason why this shouldn't be allowed. It seems like a
> straight-forward feature request, and one that is compatible with the
> basic idea that Path objects should be usable anywhere you need a file
> name.
The problem is that in the given example, to turn:
`Popen(('/path/to/program', '-o', fspath(outputPath), fspath(inputPath)`
Into this:
`Popen(('/path/to/program', '-o', outputPath, inputPath`
There's no way for Popen to know that outputPath and inputPath are in
fact file names. So unless you want to call str() on every element of
args (Popen's first parameter), I don't see how you'd implement this.
I wouldn't see a problem with that. It'd mean you can also pass an
integer as an argument, and it'd be sent as digits. I've wanted that a
number of times too.
It would also let you pass a whole load of other things too. It would
accept x if str(x) returns a string ... which means _anything_. Lists,
dicts, compiled regexes, ....
_______________________________________________
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/KIAE6NO2T4HF4KXWTTDGA6WO6UJ7RGMH/
Code of Conduct: http://python.org/psf/codeofconduct/