Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #60379

Re: sys.stdout and Python3

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.013
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'subject:Python3': 0.09; 'wrong,': 0.09; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'loops': 0.16; 'repl': 0.16; 'repl)': 0.16; 'written.': 0.16; 'wrote:': 0.18; 'handles': 0.22; 'apply.': 0.24; 'bytes': 0.24; 'mon,': 0.24; 'script': 0.25; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '25,': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'run': 0.32; 'received:google.com': 0.35; 'thanks': 0.36; 'nov': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'explain': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'different': 0.65; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=i9A+DZ82d4bMakqBHvSOrPe6vUFQ4vOdOnsZWFp+DJ4=; b=v7iP6BTWbHlLLgqXV8qSCp8jI4EABnP+CfQ5us5nasX7r43tnF/vx5ioqOUl5u5dpm 51B/crxJQnczPQvWYeICdasiFOS9xmqs69YRwAKUz3ilWeuhA4ikhUXOoxltCw5axW2q 1cPBTs4Xp1UUcsTwj+M1VWu4cctfYkgQlAf68ST2IxH8Sw3GriICcOnxC3jBGaouCAVU BIV0MNZSKBn+3E/nECI/PCF0il6mYDAB13MtkQgvV7FdL+evc3W2uf67TbHUclNQFDj2 /tpeeH2z4XFonVeHGVXCK5WjV5pa34KKEwILS/X6vNOnWQ/+dKqoYV6gJFlBEoCs7g43 3uQA==
MIME-Version 1.0
X-Received by 10.68.12.138 with SMTP id y10mr13188537pbb.101.1385303981955; Sun, 24 Nov 2013 06:39:41 -0800 (PST)
In-Reply-To <52920dd3$0$29993$c3e8da3$5496439d@news.astraweb.com>
References <l6qacb$ap$1@ger.gmane.org> <mailman.3084.1385216188.18130.python-list@python.org> <52920dd3$0$29993$c3e8da3$5496439d@news.astraweb.com>
Date Mon, 25 Nov 2013 01:39:41 +1100
Subject Re: sys.stdout and Python3
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3137.1385303985.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1385303985 news.xs4all.nl 15969 [2001:888:2000:d::a6]:40389
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:60379

Show key headers only | View raw


On Mon, Nov 25, 2013 at 1:31 AM, Steven D'Aprano
<steve+comp.lang.python@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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: sys.stdout and Python3 Chris Angelico <rosuav@gmail.com> - 2013-11-24 01:16 +1100
  Re: sys.stdout and Python3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-24 14:31 +0000
    Re: sys.stdout and Python3 Chris Angelico <rosuav@gmail.com> - 2013-11-25 01:39 +1100

csiph-web