Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-16 Thread Pablo Galindo Salgado
Thank you everyone that commented in this thread about the best interface for posix_spawn. I have finished implementing Antoine's suggestion in the PR: https://github.com/python/cpython/pull/5109 I think it would be good if we can have this merged before the feature lock at the end of the month i

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-10 Thread Pablo Galindo Salgado
I think I really like Antoine's suggestion so I'm going to finish implementing it that way. I think this keeps the API simple, does not bring in the os module new dependencies, keeps the C implementation clean and is consistent with the rest of the posix module. I will post an update when is ready.

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-09 Thread Brett Cannon
On Tue, 9 Jan 2018 at 02:42 Nick Coghlan wrote: > On 9 January 2018 at 20:01, Antoine Pitrou wrote: > > On Mon, 08 Jan 2018 09:11:38 + > > Pablo Galindo Salgado wrote: > >> Hi, > >> > >> I'm currently working on exposing posix_spawn in the posix module (and > by > >> extension in the os mod

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-09 Thread Nick Coghlan
On 9 January 2018 at 20:01, Antoine Pitrou wrote: > On Mon, 08 Jan 2018 09:11:38 + > Pablo Galindo Salgado wrote: >> Hi, >> >> I'm currently working on exposing posix_spawn in the posix module (and by >> extension in the os module). You can find the initial implementation in >> this PR: >> >>

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-09 Thread Antoine Pitrou
On Mon, 08 Jan 2018 09:11:38 + Pablo Galindo Salgado wrote: > Hi, > > I'm currently working on exposing posix_spawn in the posix module (and by > extension in the os module). You can find the initial implementation in > this PR: > > https://github.com/python/cpython/pull/5109 > > As pointed

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-09 Thread Nick Coghlan
On 9 January 2018 at 17:07, Serhiy Storchaka wrote: > 09.01.18 05:31, Nick Coghlan пише: >> As with DirEntry, I don't see any obvious value in making the new >> objects iterable though - we should be able to just use named field >> access in both the C and Python APIs. > > Do you suggest to add a

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Serhiy Storchaka
09.01.18 01:05, Gregory P. Smith пише: On Mon, Jan 8, 2018 at 12:36 PM Serhiy Storchaka > wrote: 08.01.18 11:11, Pablo Galindo Salgado пише: > Following Gregory's comment on the PR I understand that he is proposing > to have three objects in the os m

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Serhiy Storchaka
09.01.18 05:31, Nick Coghlan пише: On 8 January 2018 at 19:11, Pablo Galindo Salgado wrote: Following Gregory's comment on the PR I understand that he is proposing to have three objects in the os module representing each action and pass a sequence of these objects to the Python API. What I am n

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Nick Coghlan
On 8 January 2018 at 19:11, Pablo Galindo Salgado wrote: > Following Gregory's comment on the PR I understand that he is proposing to > have three objects in the os module representing each action and pass a > sequence of these objects to the Python API. What I am not sure about this > is that the

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Brett Cannon
On Mon, 8 Jan 2018 at 15:06 Gregory P. Smith wrote: > On Mon, Jan 8, 2018 at 12:36 PM Serhiy Storchaka > wrote: > >> 08.01.18 11:11, Pablo Galindo Salgado пише: >> > Following Gregory's comment on the PR I understand that he is proposing >> > to have three objects in the os module representing e

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Gregory P. Smith
On Mon, Jan 8, 2018 at 4:03 PM Random832 wrote: > On Mon, Jan 8, 2018, at 18:05, Gregory P. Smith wrote: > > i agree with just a list of tuples, but i suggest creating namedtuple > > instances in the posix module for the purpose (one each for close, dup2, > > open) . Don't put a reference to a f

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Random832
On Mon, Jan 8, 2018, at 18:05, Gregory P. Smith wrote: > i agree with just a list of tuples, but i suggest creating namedtuple > instances in the posix module for the purpose (one each for close, dup2, > open) . Don't put a reference to a function in the tuple as Serhiy > suggested as, while obvio

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Gregory P. Smith
On Mon, Jan 8, 2018 at 12:36 PM Serhiy Storchaka wrote: > 08.01.18 11:11, Pablo Galindo Salgado пише: > > Following Gregory's comment on the PR I understand that he is proposing > > to have three objects in the os module representing each action and pass > > a sequence of these objects to the Pyt

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Serhiy Storchaka
08.01.18 11:11, Pablo Galindo Salgado пише: Following Gregory's comment on the PR I understand that he is proposing to have three objects in the os module representing each action and pass a sequence of these objects to the Python API. What I am not sure about this is that there is no previous

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Brett Cannon
On Mon, 8 Jan 2018 at 07:57 Pablo Galindo Salgado wrote: > Hi, > > I'm currently working on exposing posix_spawn in the posix module (and by > extension in the os module). You can find the initial implementation in > this PR: > > https://github.com/python/cpython/pull/5109 > > As pointed out by G

[Python-Dev] Best Python API for exposing posix_spawn

2018-01-08 Thread Pablo Galindo Salgado
Hi, I'm currently working on exposing posix_spawn in the posix module (and by extension in the os module). You can find the initial implementation in this PR: https://github.com/python/cpython/pull/5109 As pointed out by Gregory P. Smith, some changes are needed in the way the file_actions argum