Why not use Python's own pickle for it? I'm not entirely certain that Python classes could be serialized using Java's serialization, but pickling will work, and is the python equivalent (more or less).

On Mon, Apr 5, 2010 at 2:29 AM, Tony Locke <tlocke@tlocke.org.uk> wrote:

For performance reasons I tried to serialize a PyCode object, so I
could re-use it rather than compiling from the source each time.
However on attempting to serialize the PyCode object I get
java.io.NotSerializableException: org.python.core.CompilerFlags

Here's some code that will reproduce the problem:

PythonInterpreter interp = new PythonInterpreter();
PyCode code = interp.compile("jython_rocks = True");
ObjectOutputStream ow = new ObjectOutputStream(new
FileOutputStream(File.createTempFile("compscript", null)));

Is this a genuine problem, or am I on the wrong track?



Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
Jython-users mailing list

"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
Website: http://darkhelm.org