The primary class in the subprocess module is name Popen, and represents a subprocess. Popen sounds like someone was trying to force the name to follow some function naming format, rather than chosing a name that actually represents what the object is. Does anyone know why it was chosen over something simple like, say, Subprocess?
-
I suppose the name was chosen because the functionality
subprocessis replacing was formerly in theosmodule as theos.popenfunction. There could be even ways to automate migration between the two.From Sergio Acosta -
subprocess.Popenreplaces the group ofos.popenXPOSIX functions (which have a long history). I suppose that the namePopenmakes it more likely for people used to the old functions to find and use the new ones.The PEP for subprocess (PEP 324) has a little bit of discussion on the name of the module but not of class
Popen. The list of PEPs (Python enhancement proposals) is in general an excellent place to start if you're looking for the rationale for features of Python.From dF -
Now, I'm not saying that this is the greatest name in the world, but here was the idea as I understand it.
Originally, the popen family was in the os module and was an implementation of the venerable posix popen. The movement to the subprocess module would have been an opportune time to rename them, but I guess that keeping Popen makes it easier to find in the docs for those who have a long history with python or even to the venerable posix functions.
From it's earliest posix incarnation,
Popenhas always been meant to open a Process and allow you to read and write from it's stdio like a file. Thus the mnemonic forPopenis that it is short forProccesOpenin an attempt to kind of, sorta, look like open.From AmanKow
0 comments:
Post a Comment