[Python-Dev] Adding Optik to 2.3 standard library

Barry A. Warsaw barry@zope.com
Fri, 12 Apr 2002 23:08:43 -0400


>>>>> "SM" == Skip Montanaro <skip@pobox.com> writes:

    SM> How about "optionparser" or "optionlib"?

    BAW> I really think we should expose Optik's main parser class
    BAW> through getopt, which we'd make into a package.  I didn't see
    BAW> any response to my previous suggestion, does everybody else
    BAW> hate it? ;)

    SM> I assume this can be done without changing the apparent
    SM> interface to the getopt class?  That is, if I import getopt
    SM> will getopt.getopt still reference what getopt.getopt does
    SM> today?

Yes.  Move getopt.py to getopt/_getopt.py and put this in
getopt/__init__.py:

# For backwards compatibility
from _getopt import getopt, error, GetoptError
# For convenience
from OptionParser import OptionParser

so some such similar incantation (I don't remember off-hand whether
the module names should be fully-qualified or not).

-Barry