[Python-Dev] Preventing 1.5 extensions crashing under 1.6/2.0 Python
Barry Scott
barry@scottb.demon.co.uk
Mon, 10 Jul 2000 00:15:49 +0100
The key problem here is that the python engine needs to
verify the version of python that the extension supports
before allowing the extension to do anything dangerous.
Maybe the solution is a pair of functions and a bit of
protocol.
The first function is used for version checking.
int check_version_##module_name();
The second function will do the init as today.
init init##module_name();
Based on the outcome of calling the check_version function
python can decide if it should call the init function.
Issues with the check_version function that I can think of
are:
* how is a python version represented?
* should the check_version function be passed the calling
python's version? This would allow smart extensions to
adapt to the invoking python's version dependent features.
Barry