zenlotus / argparse

Automatically exported from code.google.com/p/argparse
Other
0 stars 0 forks source link

optparse incompatibilities are unnecessary #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The use of methods like "add_argument" and "ArgumentParser" are 
unnecessarily different than optparse.  I don't see a reason I shouldn't be 
able to replace "from optparse import ..." with "from argparse import ...", 
so long as I don't do anything particularly complicated (like add new 
converters).  These small name changes get in the way of that.  

Also the optparse substitutions (like %prog) should be supported; it would 
only be a couple of lines of extra code to support both those and the 
current argparse %()s substitutions.

Original issue reported on code.google.com by ianbick...@gmail.com on 14 Dec 2009 at 6:20

GoogleCodeExporter commented 9 years ago
Some other things you'd need to patch to make the transition seamless:
* parse_args() would need to return something that can be unpacked into (args, 
[])
* all the type= arguments would have to accept string forms as well
I'm open to patches, but I'd want to have some folks verify that it really does 
make
the transition easier before I commit the patch.

Original comment by steven.b...@gmail.com on 14 Dec 2009 at 7:51

GoogleCodeExporter commented 9 years ago
Marking this as wontfix. I think there are really enough differences that this 
isn't
a profitable approach, and no one else is attempting to prepare a patch to 
prove me
wrong. ;-)

Original comment by steven.b...@gmail.com on 28 Feb 2010 at 8:11