sys.stdout and Python3

Chris Angelico rosuav at gmail.com
Sun Nov 24 09:39:41 EST 2013


On Mon, Nov 25, 2013 at 1:31 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> I don't think the REPL handles return values inside loops any different
> from how it handles them outside loops. The difference is that file.write
> methods used to return None in Python 2, in Python 3 they return the
> number of bytes written.

Oh! That would explain it, thanks for clarifying. So my justification
was wrong, though the solutions (assign the return value to something,
or run it in a script rather than the REPL) still apply.

ChrisA



More information about the Python-list mailing list