[Python-ideas] sys.args

Michael Foord fuzzyman at gmail.com
Fri Jul 26 16:55:49 CEST 2013


On 26 July 2013 17:52, Oleg Broytman <phd at phdru.name> wrote:

> 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?
>
>
How will adding another sys attribute break those scripts?


> 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.
>

Sometimes it's overkill. Or you have custom needs that argparse doesn't
handle.

Michael


>
> Oleg.
> --
>      Oleg Broytman            http://phdru.name/            phd at phdru.name
>            Programmers don't die, they just GOSUB without RETURN.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



-- 

http://www.voidspace.org.uk/

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130726/babd7c96/attachment.html>


More information about the Python-ideas mailing list