[cctbxbb] State of python3 support?

Jan Marten Simons marten at xtal.rwth-aachen.de
Tue Dec 14 06:33:51 PST 2010


Am Montag 13 Dezember 2010 18:59:24 schrieb Jon Wright:
> Numpy is now supposed to be working with python 3.1. It seems the
> conversion was not as difficult as feared, but they did have several
> people working on it.

http://www.mail-archive.com/numpy-discussion@scipy.org/msg26524.html

The numpy team documented the porting process here:
https://github.com/numpy/numpy/blob/799179d1466f274dfef66d6aeea394b2c7cff729/doc/Py3K.rst.txt

While at the moment python3 does not give much gain for cctbx (despite imho 
cleaner syntax) as most of the performance critical code is written in c++ 
future development of python will most likely travel the py3k road.
Therefore in my opinion it would be a good practice to have new cctbx code 
compatible with python3 wherever it is possible. and to port print statements 
to the new print function peau-á-peau. For legacy versions of python one could 
include a universal print function like this: 
http://www.daniweb.com/code/snippet217214.html
That way a future switch to python3 would be less painful.

From this rather old message at http://mail.python.org/pipermail/cplusplus-
sig/2009-July/014664.html it looks like boost.python should be python3 ready 
as well by now. So with numpy 1.5 (+scipy) and boost.python most dependencies 
of cctbx seem to be python3 enabled by now. As more and more libraries move to 
python3 imho it be good to plan ahead with cctbx as well.

Btw. is there a coding style document/policy for cctbx? If so where can I find 
it and would it be a good idea to add some note there that contributors should 
check their code for possible incompatibilites using python's "-3" parameter 
and fix those before commit?

With  regards,
 
  Jan M. Simons

Institute of Crystallography
RWTH  Aachen


More information about the cctbxbb mailing list