print as a function in 2.5 ?

Martin martin at marcher.name
Mon Apr 20 12:53:46 EDT 2009


Hi,

On Sun, Apr 19, 2009 at 7:13 PM, Stef Mientki <stef.mientki at gmail.com> wrote:
> hello,
>
> For several reasons I still use Python version 2.5.
> I understand that the print-statement will be replaced in Python version
> 3.0.
>
> At the moment I want to extend the print statement with an optional
> traceback.
> So I've 2 options:
> 1- make a new function, like "eprint ()", where "e" stands for extended
> print
> 2- make a function "print()" that has the extended features

I usually have a tools module/package (depending on size of my
project, mostly a module) that defines an "emit([object, ...][, sep='
'][, end='\n'][, file=sys.stdout])" -- this corresponds
tohttp://docs.python.org/3.0/library/functions.html#print

I found that to be the handiest solution, however I'm too much of an
idiot to use it as a gobally available module right now :) (Yeah I
know DRY....)

regards,
Martin

-- 
http://soup.alt.delete.co.at
http://www.xing.com/profile/Martin_Marcher
http://www.linkedin.com/in/martinmarcher

You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



More information about the Python-list mailing list