should these be fixed for python 2.4?

Alexander Schmolck a.schmolck at gmx.net
Mon Oct 4 13:33:08 EDT 2004


Carlos Ribeiro <carribeiro at gmail.com> writes:

> On Sun, 03 Oct 2004 15:50:18 +0100, Alexander Schmolck
> <a.schmolck at gmx.net> > Yes, that's why I mentioned the need for a
> "documented and *reasonably
>> reliable*" version in another post (the code also happens to be terribly
>> inefficient, but that's presumably not such a big concern).
>
> Shouldn't it be easier (and less contentious) to add the 'run' function to
> the commands module? I mean, messing with the os module may be a little bit
> harder, because most calls there simply mimic the standard library calls.

Well, I'm not particularly enamoured with the commands module (and it's unix
only). As long as the docs of os point in the right direction I'm not that
fuzzed where the functionality ends up, but I must say I find this "thin
wrapper" argument unconvincing -- it might be a great argument for not messing
with `system` (people expect it to work like the C-counterpart), but I don't
see why it would preclude an `os.run`:

a) os already contains plenty of convinience functions that don't have
   C-counterparts (removdirs, walk etc.) and generally it is not just an
   "close to the metal" type module, but simply what is used for the majority
   of os relevant stuff.

b) As such, it is not just used by a select few system programmers, but simply
   by about everyone who wants to use python for scripting. Given that python
   is intended as a scripting language particularly also for people who don't
   spend all their lives in front of computers and given that in this specific
   instance it performs poorly at that combination (inexperienced folks are
   needlessly likely to produce broken code for a fairly frequent and simple
   task and that even remains true for experienced programmers -- several
   regulars have claimed in this thread that they either got bitten by
   os.system or at least found the spawn* stuff difficult to use and to
   remember) my personal feeling is that the addition of `run` is well worth
   the "bloat".

Anyway, I think this horse has now been beaten to death -- either someone who
has the power to make inclusions has been convinced by now or it's not gonna
happen (at least not in the immediate future).


'as



More information about the Python-list mailing list