Modules that provide differing functionality amongst different Python versions...

Aahz aahz at pythoncraft.com
Sun Apr 21 14:23:26 EDT 2002


In article <mailman.1019412399.4283.python-list at python.org>,
holger krekel  <pyth at devel.trillke.net> wrote:
>On Sun, Apr 21, 2002 at 01:35:09PM -0400, Aahz wrote:
>> In article <304d20df.0204210629.3f2b4d58 at posting.google.com>,
>> Allan Crooks <googlegroups at sixtyten.org> wrote:
>>>
>>>Another thought I've had is doing it by specifying, say for module
>>>'x', having modules 'x_20', 'x_21', 'x_22', with x simply finding out
>>>what versions of Python it is running on, and then compiling all
>>>modules it can deal with, and then importing all objects into it's
>>>namespace.
>> 
>> Yup.  But do it with a package.
>
>But doesn't this lead to lots of duplicated -hard to maintain-  code?

Depends.  You can certainly construct your package to use common code.
But if you're truly set on using the idioms of each Python version to
the full extent while still providing backwards compatibility, you're
going to have a problem with code duplication.  Period.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

What if there were no rhetorical questions?



More information about the Python-list mailing list