Jim Jewett wrote: >> * getopt >> + optparse provides better functionality. > > Yes and no. getopt does provide a (non-python-specific) standard > parsing, and is still widely used. > I would say keep it unless the converter could automate the > translation to *lightweigt* optparse usage. (Shouldn't add more than > ~15% to the script's "here is where I deal with options" code.)
I'm not sure what you mean here. In my experience, converting to optparse results in *less* code, especially if the script has a relatively complex command line interface. Let alone the fact that it makes possible to adhere to the "say it once" principle, while getopt forces to several repetitions (each option is repeated in the getopt argument strings, in the if/else chain, and in the usage screen at least). Are you worried more for existing code or for new code? Do you believe getopt still makes sense even for new code, and if so, would you please elaborate on this? -- Giovanni Bajo _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
