print as a function in 2.5 ?

Christian Heimes lists at cheimes.de
Sun Apr 19 13:36:20 EDT 2009


Stef Mientki wrote:
> Now doesn't seem to be allowed,
> nor is there an import from __future__  :-(
> 
> What's the best solution (other than moving to 2.6 or up ?

The word 'print' is a reserved word like is, class or def. You can't
have a function named 'print' in Python 2.5. You have to call your
function eprint() or print_().

Christian




More information about the Python-list mailing list