How to make a C extension module backwards compatible?

Andrew McNamara andrewm at object-craft.com.au
Wed Sep 18 05:24:36 CEST 2002


Is there any community wisdom on how to make a C extension module that
implements a new-style class (type?) backwards compatible (albeit,
at the cost of some functionality)?

Put another way, how *should* I make a class implemented in C behave
like a new-style class when installed with python 2.2 and above, and
like an old style class when installed with older pythons?

Should I just riddle the code with #ifdef's, or is there a more elegant
way?

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/




More information about the Python-list mailing list