[Python-ideas] sys.args

Michael Foord fuzzyman at gmail.com
Fri Jul 26 16:54:50 CEST 2013


On 26 July 2013 17:51, anatoly techtonik <techtonik at gmail.com> wrote:

> On Fri, Jul 26, 2013 at 5:47 PM, Giampaolo Rodola' <g.rodola at gmail.com>
> wrote:
> > On Fri, Jul 26, 2013 at 4:39 PM, 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: ...")
> >
> > I'd say the cost in terms of compatibility breakage is way higher than
> > the benefits.
>
> It's not sys.argv replacement, but an alternative that is easy to remember.
>

In principle I like it. I agree that argv is an unintuitive hang over from
earlier days.

The only compatibility issue is that a lot of code out there (especially
tests but not just tests) manipulates the contents of sys.argv to modify
behaviour. Code might have to change to modifying sys.args and sys.argv,
taking care to keep them in sync.

All the best,

Michael Foord


> --
> anatoly t.
> _______________________________________________
> 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/51bea881/attachment.html>


More information about the Python-ideas mailing list