[Python-ideas] sys.args
Oleg Broytman
phd at phdru.name
Fri Jul 26 16:52:17 CEST 2013
On Fri, Jul 26, 2013 at 05:39:18PM +0300, anatoly techtonik <techtonik at gmail.com> wrote:
> sys.argv is an atavism with not intuitive name, how about sys.args for
> program arguments only?
>
> if not sys.args:
> print("usage: ...")
1. How are you going to handle backward compatibility? I.e., how are you
going to fix millions scripts out there?
2. If you use argparse -- and it's *the way* to parse command-line args --
you don't need to use sys.argv at all, argparse does all necessary magic
for you.
Oleg.
--
Oleg Broytman http://phdru.name/ phd at phdru.name
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-ideas
mailing list