[IPython-dev] Fork to create an IPcluster with engines and clients being a mix of Python 2.6 & 2.7 (bytecode translation utilities)

Matt Hagy hagy at gatech.edu
Mon Oct 31 15:36:01 EDT 2011


Hi All,

To support an IPcluster containing both Python 2.6 & 2.7 engines and 2.6 clients I incorporated a small bytecode translation utility into my fork of IPython. If anyone else is interested you can find the fork at:

    https://github.com/matthagy/ipython

(Nothing else has been changed yet, and everything is up to date with the master branch of IPython).

It’s likely not worth pulling this niche feature into IPython, although it may be useful to at least detect when an engine is attempting to run incompatible byte code from a different client Python version. Otherwise you learn of this issue the hard way with the engine-interpreter crashing.

This can be accomplished with a very small addition to the CannedFunction class in IPython.utils.pickleutil module. One simply records the version of Python in which the function is canned, and at uncanning this can be checked for incompatibilities. See:

    https://github.com/matthagy/ipython/blob/master/IPython/utils/pickleutil.py#L72


If anyone is interested the added module IPython.utils.codetranslation is a general translation framework that includes byteplay-derived disassemblers and assemblers for 2.4 – 2.7. This may be of negligible use in IPython as at least 2.6 is required, and hence only the 2.6 -> 2.7 translation has been developed. One could easily code up the additional translations if needed in other projects.


-Matt

P.S. Thanks ipython dev team for the great tools. I’ve been using the IPython shell for 4 years and have recently found the parallel tools to be incredibly useful.






More information about the IPython-dev mailing list