Inquiry regarding the name of subprocess.Popen class

Derek Martin code at
Wed Sep 3 00:15:07 CEST 2008

On Tue, Sep 02, 2008 at 05:22:51PM -0300, Gabriel Genellina wrote:
> > The name popen is an abbreviation of "pipe open" -- the function, and
> > the class, open pipes to communicate with another process.  What you
> > said is correct; however there are numerous other ways to open
> > subprocesses.  The focus of popen is the communication aspect -- the
> > opening and control of the pipes -- not the subprocess.  That's the
> > key difference between popen() and all the other methods of starting a
> > subprocess.
> Totally irrelevant here - we are talking about the subprocess
> module, not the popen C function.

I was talking about both actually.  I can't agree that it's not
relevant...  The Popen class clearly takes its name from the function
of the same name, and does exactly the same thing (plus what pclose()
does, plus saving the pid of the forked process).  Seems pretty
relevant to me.

> >> > The C library's popen() function, on which this class is based,
> No, subprocess.Popen does not use -directly or indirectly- the C
> popen function. It uses fork or CreateProcess in Windows.

I didn't say it used it.  I said it was based on it.  It is

> > The Linux man page unfortunately copies (verbatim) the FreeBSD man
> > page, which gets it wrong.  You can not open a process, but you can
> > definitely open a pipe.
> (Ok, if it doesn't agree with you, it must be wrong)

See my last post for accreditation of my comment.  A common
argumentation tactic of the closed-minded and the small-minded is to
resort to insinuation to attack the validity of other's comments
without providing any basis for doing so.  Nice job.

> Classes represent "things", and class names should be nouns.

Is that a law?

Classes are instantiated by invoking their class names as a function
call -- the computing equivalent of a verb.  Why then, must they be
named as nouns?  Can you not, in fact, have classes which describe
(or model) actions?  Wouldn't you name them using verbs if you did?  

That said, this is the most valid point anyone has made...  You should
have made it when the module was being designed. :-D

My point is, if you don't think Popen is a good name for the class,
that's your opinion, but it is only that: an opinion.  Yet some of you
state your case as if it is incontrovertable fact.  I've given a good
case as to why it IS a good name (one which I genuinely support), and
disagree as you may, none of the points any of you have made
invalidate or even weaken my argument.  Lastly, the maintainers
obviously thought it was a good name when they included it...

Derek D. Martin
GPG Key ID: 0x81CFE75D

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list