pygame and python 2.5

skip at pobox.com skip at pobox.com
Sat Feb 10 08:13:25 EST 2007


    >> Python used to work that way.  You'd then silently get errors if the
    >> API changed between version A and version B and you neglected to
    >> recompile the extensions you compiled against version A.

    bearophile> Can't the compiled module have one or more test functions
    bearophile> that can be used during linking to see if the compiled
    bearophile> module respects the expected standard?

Given the complexity of the formal API how would you test to see if the
extension violated a particular aspect of the API?  What if one of the API
bits used is implemented as a C macro (as parts are) and it was changed
simply to fix a bug.  Wouldn't you want to know with a high degree of
certainty that you should recompile?  How would a test function tell you
that?  A simple API versioning scheme does that.  It means you have to
recompile when a new version of Python comes out.  In fact, you can think of
it as the test function you suggest.  It's just that it's noted at the time
a module is imported, not strictly speaking at link time.  It tells you,
"Hey buddy.  You're using an outdated version of the API."  What it can't
tell you is if the parts of the API your particular module uses are used
incorrectly.

Skip




More information about the Python-list mailing list