New submission from Georg Brandl <ge...@python.org>:

There are a few points where `os.waitid()` docs need improvement. Current text:

Wait for the completion of one or more child processes. idtype can be P_PID, 
P_PGID or P_ALL. id specifies the pid to wait on. options is constructed from 
the ORing of one or more of WEXITED, WSTOPPED or WCONTINUED and additionally 
may be ORed with WNOHANG or WNOWAIT. The return value is an object representing 
the data contained in the siginfo_t structure, namely: si_pid, si_uid, 
si_signo, si_status, si_code or None if WNOHANG is specified and there are no 
children in a waitable state.

Problems are:

* The given use of the *pid* argument is only for the case of `idtype=P_PID`.  
For `P_ALL` it is ignored, and for `P_PGID` it specifies that the child's PGID 
must be *pid*.

* "One or more child processes" is misleading -- the function waits for until 
exactly one child process to exit (or aborts with WNOHANG).  Sure, there can be 
multiple candidate processes, but this should be formulated differently.

* The explanation of *options* is quite cumbersome, it seems to be copied 
directly from the manpage (where it is laid out much more clearly and with 
explanation of the different options).

Additionally the flags P_*, W* and CLD_* are just stated as-is, and need 
explanation in the docs. You should not need to consult the manpage to be able 
to use the function at all.

----------
assignee: docs@python
components: Documentation
keywords: easy
messages: 377263
nosy: docs@python, georg.brandl
priority: normal
severity: normal
stage: needs patch
status: open
title: os.waitid() documentation needs TLC
type: enhancement
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41825>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to