[Cython] CmdLine.py refactoring

Stefan Behnel stefan_ml at behnel.de
Tue Aug 9 13:22:58 CEST 2011


Stefano, 09.08.2011 12:13:
> Tuesday 9th August 2011 10:15:14, Stefan Behnel wrote:
>> However, I also see the problem that optparse is deprecated and may get
>> removed in a future 3.x version. So, switching to optparse now means that
>> we may have to switch to something else later, whereas that's not the case
>> with the current code, however clumsy and low-level it may be.
>
> I've fixed the glitches, now both versions (argparse and optparse) are
> supported. Still, optparse's code performs a bit faster and doesn't need a
> couple of HACKs that are necessary for optparse's code to run. If all tests
> perform correctly, I'll merge the branch into master.
>
> So, no upgrade problems, nor optparse embedding issues :)

Thanks!


> I did want to rewrite the module beacuse I think that clarity of
> implementation should win over milliseconds of speed.

This is really old code and performance certainly is not an issue. I 
wouldn't be surprised if the implementation simply predated the addition of 
command line parsers to the stdlib.

In any case, we are happy about all contributions, not only those that 
address our most urgent needs. Your changes clearly make the command line 
parser more readable.

When you're done with it, please open a pull request.

Stefan


More information about the cython-devel mailing list