X-Git-Url: https://git.distorted.org.uk/~mdw/mLib-python/blobdiff_plain/a19eaede18c9176b382df01e4f6c6e5c04a87d0f..addc0c3760b565ead630bd67cc038b31954b9284:/mdup.pyx diff --git a/mdup.pyx b/mdup.pyx index cf3a3c0..7256211 100644 --- a/mdup.pyx +++ b/mdup.pyx @@ -24,6 +24,14 @@ ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. def mdup(v): + """ + mdup(LIST) -> LIST: + LIST is a list (mutable sequence) of pairs (CUR, WANT). Duplicate each + CUR file descriptor as WANT (may be -1 to mean `don't care'), closing + original CUR. Works even if there are cycles. LIST is updated in place + with CUR reflecting the new file descriptors even on error. Returns the + same LIST on success. + """ cdef mdup_fd *vv cdef size_t n cdef int i