[EMAIL PROTECTED] wrote:
> the print statement is more convenient. Maybe a print builtin wouldn't kill
> me. In that case I'd want both output redirection and newline suppression
> though. I guess you'd have to use a keyword arg to specify an alternate
> stream. 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)
I think, instead, the stream API should grow a "print" method (or
whatever it ends up getting called). The example would then look
like:
sys.stderr.print("foo", "bar", "baz", " ")
It would probably be nice to provide a FileMixin object too.
(Actually, this would be nice now, so that if I implement read(), I
don't have to implement readline(), readlines(), etc.) The FileMixin
object would make it easy for user-defined file-like objects to also
support the print() method:
class FileMixin(object):
"""Adds the file methods.
Requires:
read()
write()
Adds:
__iter__()
next()
readline()
readlines()
writelines()
print() # or whatever it gets called
"""
...
STeVe
--
You can wordify anything if you just verb it.
--- Bucky Katt, Get Fuzzy
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com