Comment 2 for bug 414967

Revision history for this message
Fernando Perez (fdo.perez) wrote :

Mmh:

- Beni, I've applied your patch to 0.10.1 and trunk-dev, thanks.

- As for the real problem with print, I'm not sure what to do: I've spent some quality time with the Python sources, trying to write some ctypes-based utilities to fish into the compiler state struct (see compiler.c and future.c in the Python tree), but no success yet. It's not the type of code I'm familiar with so it's likely to be slow/hard going, and I don't have the time for more on this now. Ultimately I'm leaning towards suggesting that people simply put in their config file

from __future__ import print_function

and be done with it! That way they start getting used to print as a function everywhere, in preparation for 3.0, they can learn the syntax of the function, and IPython will happily put the parens in there for them.

It seems like a better way to address this than to sink days of work into an obscure tool to spelunk into the compiler internals at runtime to fish a __future__ flag out...

Thoughts?

If people agree on this, closing the bug will just require adding the text above to the docs/faq.