[Python-ideas] making a module callable

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Nov 24 23:37:39 CET 2013


Ben Finney wrote:
> It's more convenient to look in “the sequence of command-line
> parameters” for all the command-line parameters, without special-casing
> the command name.

But you hardly ever want to process argv[0] the same way
as the rest of the arguments, so you end up treating it
as a special case anyway.

It seems to me we only think of it as a command line
argument because C traditionally presents it that way.
I don't think it's something that would naturally come
to mind otherwise. I know I found it quite surprising
when I first encountered it.

-- 
Greg


More information about the Python-ideas mailing list