|
From: Nicola L. <ni...@te...> - 2006-05-23 06:33:47
|
> The real question is whether the larger code base and/or steeper
> learning curve are worth the benefits the new feature would bring. In
> this case, I think they are, as I'll explain.
I agree. The new syntax is simpler, supported by Python, and widely used
elsewhere; it seems worth the additional burden.
> My patch adds 85 additional lines of code, including comments. (The 75
> lines of code figure I quoted above was before I commented the code to
> my satisfaction). Most of ConfigObj's 2000 lines of code didn't need to
> be touched, so the new feature should be easy to understand and the
> codebase's mantainability shouldn't suffer. I've attached the patch, so
> you can review it for yourself and decide how easy or difficult it would
> be to maintain. (I've tested it and, I believe, gotten all the bugs
> worked out).
Minimizing the patch length is good, but it's even better to reuse already
tested and deployed code: therefore I'd go for a different implementation
strategy.
Instead of reimplementing parts of string.Template, I'd copy it wholesale
from the stdlib string module to an additional module, and do a conditional
import, like this:
try:
from string import Template
except ImportError:
from configobj.string import Template
That way, when ConfigObj drops support for the older Python versions, the
additional module and the conditional import will be removed, and no code
duplication will remain.
--
Nicola Larosa - http://www.tekNico.net/
As for the music factories--a.k.a. the major record companies--what they
want is power. They will never accept P2P sharing as long as it remains
a way to escape from their power. For their abuses against the people,
they deserve to be abolished, and that should be everyone's goal.
-- Richard Stallman, February 2006
|