skip at pobox.com 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4