[Python-Dev] Replacement for print in Python 3.0

Barry Warsaw barry at python.org
Fri Sep 2 14:03:22 CEST 2005


On Fri, 2005年09月02日 at 00:40, Martin Blais wrote:
> Talking about cleanliness, I'm not sure which is cleaner::
>> print >> sys.stderr, "This is a long sentence that I " \
> "had to cut in two."
>> print("This is a long sentence that I "
> "had to cut in two.", stream=sys.stderr)
>> Sometimes I'll do this because I don't like the backslashes::
>> print >> sys.stderr, ("This is a long sentence that "
> "Had to cut in two.")

Or maybe
print >> sys.stderr, "\
This is a long sentence that I didn't have to cut in two."
A bit yucky, but easily extended to TQS when your message gets longer
and longer.
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20050902/094d121d/attachment.pgp


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /