why does activestate (win98) python not support globbing

Chris Gonnerman chris.gonnerman at usa.net
Sun Apr 15 09:47:45 EDT 2001


----- Original Message -----
From: "Marcin 'Qrczak' Kowalczyk" <qrczak at knm.org.pl>
Subject: Re: why does activestate (win98) python not support globbing


> Fri, 13 Apr 2001 15:31:23 GMT, Robert Amesz
<rcameszREMOVETHIS at dds.removethistoo.nl> pisze:
>
> > Why nasty? This is one instance were I think UNIX has got it wrong.
> > It's much better to leave commandline parameters alone than to try and
> > interpret them in a particular way. Explicit is better than implicit.
>
> This would mean that in a statement like
>     self.write(PERSID + str(pid) + '\n')
> the write function should perform the parsing of the expression
> "PERSID + str(pid) + '\n'", while for me it's obvious that it only
> gets its result and can't recover the spelling of the expression
> used to compute it.
>
> It's similar for commandline arguments. The list of files doesn't need
> to be written explicitly: it can come from expanding variables, from
> globbing patterns, from substitution of output of some other command,
> from arithmetic computation etc. You can't expect applications to do
> all this. This is the job of whoever calls your program to generate
> arguments, e.g. the shell. The user just tells the shell how to
> generate them using the shell's language, which includes variables,
> wildcards etc.

I have been on both sides of this for a long time... and I feel the Unix way
is better.  There are many cases in the Unix docs where special steps
have to be taken to protect special characters from the shell, but these
cases of "extra work" IMHO are better than the alternative: inconsistent
command-line syntax.

Live in stupid DOS for a while, where each command has to decide for
itself whether or not to glob.  Globbing is consistent for most core DOS
commands because the "cathedral" was built to a plan, but most add-on's
have different rules, and when it comes to Win32 console commands it
just gets worse.

BTW Robert, the Unix way *is* explicit, because (if you learn in a class
or from most of the books I've read) you learn the shell first.  Knowing
its'
rules covers virtually all cases, where in DOS there are no such consistent
rules.







More information about the Python-list mailing list