[Cython] CmdLine.py refactoring

Stefano stefano.k.sanfilippo at gmail.com
Sun Aug 7 21:58:46 CEST 2011


Sunday 7th August 2011 16:21:06, Stefan Behnel wrote:
> Will you put it up somewhere on github?

Here's my branch for command line refactoring. There's still nothing 
interesting on, but changes will be pushed soon.

https://github.com/satufk/cython/tree/_commandline

> I'm also not sure how well this will fit in, given that the default options
> are stored in Main.py and don't belong in CmdLine.py as the command line is
> only one of the ways to run Cython. I'd prefer not to duplicate too much of
> that setup.

I agree. That's the reason while I'm thinking about a partial refactoring of 
all the Options&co. system, to provide a more coherent interface. Well, at 
least, I'm just evaluating at what extent it could be possible.

> argparse is new and not supported by anything but 2.7 and recent 3.x
> versions. Cython currently runs on Python 2.4, which rules out a dependency
> on argparse. I never tried it, so I can't tell what exactly the advantages
> over optparse are. They certainly can't be big enough to make up for a
> duplicate implementation of Cython's cmd line parser.

Fixed the issue. Simply, try: catch the import. The modules are very similar, 
so no more than 10 lines of overhead.  When the old module will disappear, 
I'll just remove that lines :)

--SKS


More information about the cython-devel mailing list