How to make a C extension module backwards compatible?

Martin v. Loewis martin at
Wed Sep 18 06:47:43 CEST 2002

Andrew McNamara <andrewm at> writes:

> 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?

What properties of a new-style class are you interested in? If you
implement a plain type, it will work on all Python versions, no need
to change anything for Python 2.2.


More information about the Python-list mailing list