[cctbxbb] "import pickle"

Nicholas Sauter nksauter at lbl.gov
Fri Sep 23 09:33:58 PDT 2016


Seems like a good idea generally.
Nick

Nicholas K. Sauter, Ph. D.
Computer Staff Scientist, Molecular Biophysics and Integrated Bioimaging
Division
Lawrence Berkeley National Laboratory
1 Cyclotron Rd., Bldg. 33R0345
Berkeley, CA 94720
(510) 486-5713

On Fri, Sep 23, 2016 at 9:31 AM, <markus.gerstel at diamond.ac.uk> wrote:

> Hi everyone,
>
> I note that we are using "import pickle" on some 57 occasions.
> Is there a particular reason we don't import cPickle? For example:
>
> --- libtbx/env_config.py        (revision 25451)
> +++ libtbx/env_config.py        (working copy)
> @@ -7,7 +7,10 @@
>  from libtbx import adopt_init_args
>  import platform
>  import shutil
> -import pickle
> +try:
> +  import cPickle as pickle
> +except:
> +  import pickle
>  from cStringIO import StringIO
>  import re
>  import sys, os
>
> This should still work on all systems without issue. According to python
> docs the only difference is that cPickle can't be subclassed.
> If it's alright with you I would go through those imports and update them
> to use cPickle where possible.
>
> -Markus
>
> --
> This e-mail and any attachments may contain confidential, copyright and or
> privileged material, and are for the use of the intended addressee only. If
> you are not the intended addressee or an authorised recipient of the
> addressee please notify us of receipt by returning the e-mail and do not
> use, copy, retain, distribute or disclose the information in or attached to
> the e-mail.
> Any opinions expressed within this e-mail are those of the individual and
> not necessarily of Diamond Light Source Ltd.
> Diamond Light Source Ltd. cannot guarantee that this e-mail or any
> attachments are free from viruses and we cannot accept liability for any
> damage which you may sustain as a result of software viruses which may be
> transmitted in or with the message.
> Diamond Light Source Limited (company no. 4375679). Registered in England
> and Wales with its registered office at Diamond House, Harwell Science and
> Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
>
>
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20160923/9d463484/attachment.htm>


More information about the cctbxbb mailing list