Closed GoogleCodeExporter closed 9 years ago
Yes, this is indeed an issue. The problem is that subparsers don't know whether
they're being called by parse_args() or parse_known_args().
I guess the most obvious way to fix this would be to add another argument to
Action.__call__ that indicates what method is being called. But that would
break any
existing subclasses.
Another option would be to do some stack inspection using sys._getframe(). But
that's
not guaranteed to work on other implementations of Python.
If you have any ideas how to fix this, patches are welcome.
Also, if you have a more specific example of what you're trying to do, maybe I
can
give you a workaround.
Original comment by steven.b...@gmail.com
on 6 Dec 2009 at 11:49
Issue 56 has been merged into this issue.
Original comment by steven.b...@gmail.com
on 15 Jan 2010 at 12:18
Moved to http://bugs.python.org/issue9340
Original comment by steven.b...@gmail.com
on 23 Jul 2010 at 12:01
Original issue reported on code.google.com by
whart222
on 26 Nov 2009 at 12:28Attachments: