On 20 January 2018 at 02:32, Random832 <random...@fastmail.com> wrote:
> On Fri, Jan 19, 2018, at 04:28, Pablo Galindo Salgado wrote:
>> On the other side, we have pipe and pipe2 as an example of exposing two
>> versions when this situation happens.
>>
>> The question is:
>>
>> What is preferable, exposing both functions or augment the old one?
>
> A large number, possibly a majority, of system calls in the os module, have 
> "dir_fd" arguments that cause them to call the *at counterpart of the 
> underlying system call. And chdir can also be called with a file descriptor, 
> which will call fchdir (though there is also a fchdir function) I don't know 
> why pipe2 was implemented as a separate call.

I think it's mainly just that our design philosophy on this front has
changed over time, and os.pipe2 was added back in 2011. These days,
the preference is more strongly in favour of amending the existing API
if Python offers relevant features that let us hide the existence of
multiple distinct APIs at the OS level.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to