I prefer using partial than introducing new syntax:<br><br>print_to_stderr = functools.partial(print, file=sys.stderr)<br><br>print_to_stderr('first line')<br>print_to_stderr('second line')<br>...<br><br>- Tal<br>
<br><div class="gmail_quote">On Thu, Mar 13, 2008 at 10:56 PM, Erick Tryzelaar <<a href="mailto:idadesub@users.sourceforge.net">idadesub@users.sourceforge.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This might be a minor thing, but I kind of wish that I could write this:<br>
<br>
sys.stderr.print('first line')<br>
sys.stderr.print('another line here')<br>
sys.stderr.print('and again')<br>
<br>
instead of:<br>
<br>
print('first line', file=sys.stderr)<br>
print('another line here', file=sys.stderr)<br>
print('and again', file=sys.stderr)<br>
<br>
As it's a lot easier to read for me. Of course you can always add<br>
spaces to make the lines line up, but with a long print statement your<br>
eye has to go a long distance to figure out what file, if any, you're<br>
printing to. It could be pretty simple to add:<br>
<br>
class ...:<br>
  def print(*args, **kwargs):<br>
    io.print(file=self, *args, **kwargs)<br>
<br>
I haven't been able to find any discussion on this, has this already<br>
been rejected?<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</blockquote></div><br>