[Python-Dev] PEP 554 v2 (new "interpreters" module)

Paul Moore p.f.moore at gmail.com
Sat Sep 9 04:04:59 EDT 2017


On 9 September 2017 at 00:04, Eric Snow <ericsnowcurrently at gmail.com> wrote:
>    add_recv_fifo(name=None):
>
>       Create a new FIFO, associate the two ends with the involved
>       interpreters, and return the side associated with the interpreter
>       in which "add_recv_fifo()" was called.  A FIFOReader gets tied to
>       this interpreter.  A FIFOWriter gets tied to the interpreter that
>       called "add_recv_fifo()".
>
>       The FIFO's name is set to the provided value.  If no name is
>       provided then a dynamically generated one is used.  If a FIFO
>       with the given name is already associated with this interpreter
>       (or with the one in which "add_recv_fifo()" was called) then raise
>       KeyError.
>
>    add_send_fifo(name=None):
>
>       Create a new FIFO, associate the two ends with the involved
>       interpreters, and return the side associated with the interpreter
>       in which "add_recv_fifo()" was called.  A FIFOWriter gets tied to
>       this interpreter.  A FIFOReader gets tied to the interpreter that
>       called "add_recv_fifo()".
>
>       The FIFO's name is set to the provided value.  If no name is
>       provided then a dynamically generated one is used.  If a FIFO
>       with the given name is already associated with this interpreter
>       (or with the one in which "add_send_fifo()" was called) then raise
>       KeyError.

Personally, I *always* read these names backwards - from the POV of
the caller. So when I see "add_send_fifo", I then expect to be able to
send stuff on the returned FIFO (i.e., I get a writer back). But
that's not how it works.

I may be alone in this - I've had similar problems in the past with
how people name pipes, for example - but I thought I'd raise it while
there's still a possibility that it's not just me and the names can be
changed.

Paul


More information about the Python-Dev mailing list