Hello Mike

On Sat, 12 Jan 2002, Mike Orr wrote:
> Occasionally, like with Pickle and cPickle, you have a choice of
> implementations of compatible objects.  In that case, it makes sense
> to do "from cPickle import dump, load".  Then if you end up in a
> situation where cPickle isn't available  (Jython, embedded systems,
> etc), you just change "cPickle" to "Pickle" in that one line and
> away yo go, rather than making changes all over the script.

An alternative is to use

import cPickle as pickle  # doesn't work in Python 1.5.2
p = pickle.dumps([1, 2, 3])

Stefan



_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to