lib-python.2.7.test.test_pickletools.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jython-standalone Show documentation
Show all versions of jython-standalone Show documentation
Jython is an implementation of the high-level, dynamic, object-oriented
language Python written in 100% Pure Java, and seamlessly integrated with
the Java platform. It thus allows you to run Python on any Java platform.
import pickle
import pickletools
from test import test_support
from test.pickletester import AbstractPickleTests
from test.pickletester import AbstractPickleModuleTests
class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def dumps(self, arg, proto=0, fast=0):
return pickletools.optimize(pickle.dumps(arg, proto))
def loads(self, buf):
return pickle.loads(buf)
module = pickle
error = KeyError
def test_main():
test_support.run_unittest(OptimizedPickleTests)
test_support.run_doctest(pickletools)
if __name__ == "__main__":
test_main()