[Python-ideas] Function multiple arguments assignment

Nick Coghlan ncoghlan at gmail.com
Tue Mar 22 11:01:25 CET 2011


On Tue, Mar 22, 2011 at 7:16 PM, Giampaolo Rodolà <g.rodola at gmail.com> wrote:
> It's likely this has already been proposed in past, I don't know, anyway...
> This occurred to me while using subprocess module yesterday.
> I had to do something like this:
>
> subprocess.Popen(["exe"], stdin=subprocess.PIPE,
> stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>
> Would it be appropriate to permit something similar to multiple
> variable assignment such as:
>
> subprocess.Popen(["exe"], stdin=stdout=stderr=subprocess.PIPE)

Hitting a gnat with a hammer.

Something that may make more sense is a PopenPipe that changes the
default for stdin/out/err to be distinct pipes rather than inherited
from the parent (but still able to be set explicitly). It is certainly
annoying that creating a fully piped subprocess is so verbose.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list