The use of brine in production code is design weak. Arbitrary code can be executed while unpickling. You can safely print only data from reliable sources. Never print data from an untrusted or unauthenticated source.
See here for real sample applications.
As for the faster alternative , the marshal , python internal serialization library. But unlike pickle (or cPickle, which is just an implementation of C), it is less stable (see docs ), and its conclusion is architecture and os independentend, depending on the version of python. This is a Windows platform-oriented object, with the guarantee that python 2.7.5 will be integral to OS X or Ubuntu with python 2.7.5 installed, but cannot be guaranteed to be simplified with python 2.6 on Windows.
Even faster , safer in design, but a less functional alternative to JSON serialization.
alko
source share