[issue14149] argparse: Document how to use argument names that are not Python identifiers

2020-02-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I think this one should have been closed long ago.

--
nosy: +rhettinger
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2020-02-05 Thread Dan Arad


Dan Arad  added the comment:

Hi everyone!

I thought to take this issue up by updating the documentation. Is this still 
relevant?

If so I think the best place to add the documentation is in the "name or flags" 
section, where people will go looking first. I think to add both the metavar 
and the vars solutions discussed below.

--
nosy: +Dan Arad

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2019-04-27 Thread Fred L. Drake, Jr.


Change by Fred L. Drake, Jr. :


--
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

#11076 was closed as a duplicate of #8982 which was closed as fixed so can this 
also be closed as a duplicate?

--
nosy: +BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14149
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2012-02-29 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
assignee:  - docs@python
components: +Documentation -Library (Lib)
keywords: +easy
nosy: +docs@python
stage:  - needs patch
title: argparse usage model requires argument names to be python identifiers - 
argparse: Document how to use argument names that are not Python identifiers
versions: +Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14149
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2012-02-29 Thread Joseph Birr-Pixton

Joseph Birr-Pixton jpix...@gmail.com added the comment:

 I don’t understand, can you rephrase?

Sorry, I mean making Namespace subscriptable.  eg:

 v = argparse.Namespace(abc = 123)
 v
Namespace(abc=123)
 v.abc
123
 v['abc']
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: 'Namespace' object is not subscriptable

 add_argument('foo_bar', metavar='foo-bar', ...)

This works. Thanks!

Cheers,
Joe

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14149
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2012-02-29 Thread Steven Bethard

Steven Bethard steven.beth...@gmail.com added the comment:

 making Namespace subscriptable

This has been discussed before - see issue 11076. I prefer to keep Namespace as 
simple as possible. For subscripting, just use the standard Python idiom of 
vars as suggested in the docs:

http://docs.python.org/library/argparse.html#the-namespace-object

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14149
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com