[IPython-dev] Getting rid of "print" in ipython

Fernando Perez fperez.net at gmail.com
Wed Jul 9 17:44:12 EDT 2008

On Wed, Jul 9, 2008 at 10:00 AM, Hans Meine <hans_meine at gmx.net> wrote:
> On Mittwoch 09 Juli 2008, Edward K. Ream wrote:
>> On Wed, Jul 9, 2008 at 9:59 AM, Hans Meine <hans_meine at gmx.net> wrote:
>> > What are those arguments?
>> http://www.python.org/dev/peps/pep-3105/
>> def print(*args, sep=' ', end='\n', file=None)
> OK, so this is not really surprising, but I don't see which of the arguments
> could be needed in IPython.  Actually, I like string interpolation even more
> than passing separate args, and one could even discuss the \n (e.g. whether
> to append it automatically or be explicit about it), but file is certainly
> not needed (it's up to the frontend IMO).
> So I would really propose to just use a minimum wrapper around
> sys.stdout/err.write, which is exactly what iplib already offers. :-)

Fortunately the current interface is almost a subset of the above,
except for the file option and the fact that we don't append the \n.
So if we decide to extend to a 3k-compatible print function, no code
working today would break.  We might want to add at least the 'end'
option soon to keep the newline-handing interface future-proof.

I still do like separate out/err functions rather than a keyword in this case.



More information about the IPython-dev mailing list