<div dir="ltr"><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
* Would you be opposed to a note in the getopt documentation <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">suggesting argparse as an alternative?</span></blockquote>
<div> </div></div>from the top of <a href="http://docs.python.org/library/getopt.html">http://docs.python.org/library/getopt.html</a> - &quot;A more convenient, flexible, and powerful alternative is the optparse module.&quot;<div>
I think this statement should be emphasized better but it&#39;s already there so no worries.<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
* Would you like argparse to grow an add_getopt_arguments method (as in my other post)? </blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">* If argparse grew an add_getopt_arguments, would you still want to <span class="Apple-style-span" style="border-collapse: separate; font-family: arial; font-size: small; "><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">keep getopt around? And if so, why?</span> </span></span></blockquote>
<div><br></div><div>Argparse/optparse use a parser instance and getopt doesn&#39;t. I think that&#39;s a saved line you have to keep saving so this would be the better syntax imho:</div><div>    optlist, args = argparse.getopt(args, &#39;abc:d:&#39;)</div>
<div><br></div><div>I was thinking on the general issue of what&#39;s better for the std-lib:</div><div>1. Mini modules - 3+ small modules in each subject that can be useful in different contexts. For example the xml libs.</div>
<div>or</div><div>2. Big modules - 1 uber-module for each subject that does everything. Maybe logging is an example of this.</div><div><br></div><div>I think in general python std-lib went the path of mini modules. Its advantages</div>
<div>1. Each mini module can be coherent and while python isn&#39;t really OnlyOneWayToDoIt, each module in itself has OnlyOneWayToDoIt.</div><div>2. Documentation is less cluttered by a large amount of functions that all do the same thing but differently. This is very important for python&#39;s learning curve.</div>
<div><br></div><div>disadvantages:</div><div>1. You have to craft your documentation carefully as to be very explicit on why you have all these modules for the same thing. Probably each module should explain it&#39;s purpose in relation to the other modules and this explanation should appear at the top of the documentation of each of the mini modules in the subject. Today it would be very hard for me to figure out how the xml modules interrelate, urllib has improved in python3 but still isn&#39;t perfect.</div>
<div>2. I could be using some silly way of doing things (getopt) while I really wanted to do it the good way (argparse).</div><div><br></div><div>I think that while adding getopt functionality to argparse might be nice but would eventually cause clutter.</div>
<div><br></div></div></div>