[Python-Dev] Best Python API for exposing posix_spawn

Serhiy Storchaka storchaka at gmail.com
Mon Jan 8 15:36:00 EST 2018


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 example of such classes in the os 
> module for other similar APIs and therefore I am not sure if there is a 
> better approach.

I would pass a sequence like:

[(os.close, 0),
  (os.open, 1, '/tmp/mylog', os.O_WRONLY, 0o700),
  (os.dup2, 1, 2),
]



More information about the Python-Dev mailing list