[Python-3000] Move argv[0]? (Re: Unicode and OS strings) (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Sep 20 03:40:06 CEST 2007


Thomas Wouters wrote:

The only meaning is by accident of position. For most programs, the very same thing goes for the rest of the arguments: 'mv foo bar' assigns a different meaning to 'foo' than it does to 'bar'. Notice how sys.argv matches what the user typed, including sys.argv[0].

But most users don't think of the 'mv' in 'mv foo bar' as being an argument in any normal sense of the word. It's the thing the arguments are passed to, not an argument itself.

Also, most programs aren't interested in argv[0] at all, and those that are treat it in a very different way from the rest of argv.

I still think that argv[0] is in the "too clever by half" category. It has a kind of theoretical elegance from a certain point of view, but no practical benefit that I can see.

-- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing at canterbury.ac.nz +--------------------------------------+



More information about the Python-3000 mailing list