changeset 144:df5350aee9c3

not sure what i did here
author Jeff Hammel <k0scist@gmail.com>
date Thu, 11 Dec 2014 18:07:10 -0800
parents 2825b0fdf80e
children a95e7f218bd2
files example/argparse_undefined.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/example/argparse_undefined.py	Mon Dec 01 18:24:01 2014 -0800
+++ b/example/argparse_undefined.py	Thu Dec 11 18:07:10 2014 -0800
@@ -16,9 +16,10 @@
 
     def __init__(self, *args, **kwargs):
         argparse.ArgumentParser.__init__(self, *args, **kwargs)
+        self.__defaults = {}
 
     def add_argument(self, *args, **kwargs):
-        kwargs.setdefault('default', Undefined)
+        default = kwargs.pop('default', self.argument_default)
         return argparse.ArgumentParser.add_argument
 
 def main(args=sys.argv[1:]):