[cctbxbb] cctbx.python unnecessarily unfriendly

James Stroud xtald00d at gmail.com
Wed Jan 8 12:51:05 PST 2014


Hello CCTBX developers,

I noticed in the cctbx.python script the following lines that call the python interpreter

  if [ -n "$LIBTBX__VALGRIND_FLAG__" ]; then
    exec $LIBTBX_VALGRIND "$LIBTBX_PYEXE" -Qnew "$@"
  elif [ $# -eq 0 ]; then
    exec "$LIBTBX_PYEXE" -Qnew
  else
    exec "$LIBTBX_PYEXE" -Qnew "$@"
  fi

Here, the “-Qnew” flag forces the python interpreter to work with new division (where “/“ does not strictly mean integer division).

This flag basically overrides the expected python behavior to which python programmers have been writing code for over a decade, wrecks some dependencies, and stifles new code that itself depends on cctbx.

It is highly frustrating to work around this highly unnecessary flag!!

Fortunately, python has a better way to handle this problem by just having “from __future__ import division” at the top of .py files. In fact, I have spot-checked several files in the cctbx source tree and noticed that the ALL have this line at the top.

So why does the -Qnew flag still exist in the cctbx.python script? It is entirely unnecessary and requires any and all dependencies to be programmed to a behavior that is not standard for the language.

James

p.s. It is not reasonable to ask users who install your packages to patch the cctbx.python script or to patch dependencies that don’t conform to this non-standard behavior.



More information about the cctbxbb mailing list