[Python-Dev] Replacement for print in Python 3.0
Steven Bethard
steven.bethard at gmail.com
Fri Sep 2 17:18:00 CEST 2005
skip at pobox.com wrote:
> Perhaps if the last non-keyword argument was exactly one space, the
> newline could be suppressed, e.g.:
>
> print("foo", "bar", "baz", " ", stream=sys.stderr)
Sorry, I missed the newline-suppression idea in my first reply. I
think the rule above is too confusing. I'm also still not convinced
that the print function needs to support newline-suppression. Since
the print function seems to be intended mainly for newbies and simple
debugging, I'm having trouble coming up with examples where this is
really necessary. I'd like to see a few examples where it's crucial
that the final newline is suppressed.
If it *has* to be supported, I'd add it as a keyword argument, so that
your example above reads like:
sys.stderr.print("foo", "bar", "baz", newline=False)
I guess that's not too bad actually. Kinda nice that it has to be the
last thing in the function...
STeVe
--
You can wordify anything if you just verb it.
--- Bucky Katt, Get Fuzzy
More information about the Python-Dev
mailing list