[Python-ideas] A suggestion for Python 3 vs Python 2
Barry Warsaw
barry at python.org
Tue Nov 12 20:26:06 CET 2013
On Nov 12, 2013, at 10:10 PM, Nick Coghlan wrote:
>It's far more common in utility scripts (such as those written by
>system administrators) than it is in applications. The print change
>between Python 2 and 3 is one that doesn't really affect application
>developers all that much in practice (other than when trying things
>out in the REPL, and apparently not even then if using IPython), but
>can be more of an issue with those writing scripts where the standard
>streams are the primary IO mechanism.
>
>We tend not to hear from the latter group as much as we do from
>application developers, though.
Oh yeah, another beautiful thing about the print function:
>>> from functools import partial
>>> import sys
>>> perr = partial(print, file=sys.stderr)
>>> perr('you hit a bug')
Cheers,
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131112/9d628bf8/attachment.sig>
More information about the Python-ideas
mailing list