[SciPy-Dev] Remove print_function import?

Tim Leslie tim.leslie at gmail.com
Thu May 23 23:31:28 EDT 2013


Hi Alexei,

The print_function import is actually a piece of magic to make the print()
function work in python 2.x.

http://docs.python.org/2/library/__future__.html

This feature was added in Python 2.6, which is the oldest version of python
supported by the latest scipy. If you need to still use python 2.5 you will
need to use an older release of scipy.

Cheers,

Tim


On 24 May 2013 13:12, Alexei Colin <alexei at alexeicolin.com> wrote:

> Hello,
>
> SciPy setup in a virtualenv for Python 2.5.2 failed due to not
> recognizing 'print_function' in many source files:
> from __future__ import division, print_function, absolute_import
>
> Since the import appears to be unused...
> $ grep -rnI print_function scipy | grep -v import | wc -l
> 0
>
> ...would it be correct to remove it?:
> $ find  scipy/ -type f -name "*.py" | \
> xargs -n 1 sed -i 's/, print_function//g'
>
> -alexei
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130524/fda0ccb4/attachment.html>


More information about the SciPy-Dev mailing list