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

2018年1月08日 19:42:04 -0800

On 8 January 2018 at 19:11, Pablo Galindo Salgado <[email protected]> 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 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.
Probably the closest prior art would be the os.DirEntry objects used
for the items yielded from os.scandir - that is the same general idea
(a dedicated Python class to represent a C struct), just in the other
direction.
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.
Cheers,
Nick.
-- 
Nick Coghlan | [email protected] | Brisbane, Australia
_______________________________________________
Python-Dev mailing list
[email protected]
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