how to deal with deprecating API functionality in python module?

Chris Friesen chris.friesen at windriver.com
Wed Nov 20 19:02:30 EST 2013


Hi,

I'm pretty new to python, I'm trying to figure out how a python module 
is supposed to make non-backwards-compatible changes without blowing up 
the applications that use it.

In the C world this is straightforward, an application is linked against 
version X of the library, and if the library developers make a 
non-compatible change (remove a deprecated function, or change a 
function signature) they bump the version to X+1.  Then versions X and 
X+1 can both be installed on the system at the same time and 
applications will link against whichever one they were compiled against.

How would something like this work in a python application?  I don't see 
any way to do the equivalent of

import foo version X


Is the only way to incorporate the version in the name?  Like:

import fooX


Any guidance would be appreciated...


Thanks,
Chris



More information about the Python-list mailing list