Path: csiph.com!news.mixmin.net!news2.arglkargh.de!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'value,': 0.03; 'subject:Python': 0.05; 'assignment': 0.07; 'repeated': 0.07; 'received:internal': 0.09; 'spelling': 0.09; 'python': 0.10; 'thu,': 0.15; '"while': 0.16; 'boolean': 0.16; 'comma': 0.16; 'expected,': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'value),': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'prevent': 0.20; 'logical': 0.22; 'sep': 0.22; 'thus': 0.24; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'yields': 0.29; 'statement': 0.32; 'useful': 0.33; 'could': 0.35; 'returning': 0.35; 'something': 0.35; 'but': 0.36; '(and': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'expect': 0.37; 'received:66': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'from:no real name:2**0': 0.60; 'your': 0.60; 'header:Message-Id:1': 0.61; 'places': 0.64; 'legal': 0.66; 'therefore': 0.67; 'mistake': 0.91 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=jOWQ4pAVb8R1driRs/2uE4MisfM=; b=eWzSeO USqOTZBt5XyiY+5DbkEaxtDygvbbdJU7LaYjaSItU1ds94AG7PyzWWIPtgAIbiYJ iyBh5cirIbQQKUvM/aRQ7XWKen8Gg4fQKOA4t2UaqB3gWrmfNJEZhBJt6pYhAsrk /gASw/lrE+8+Ceqof+pQmPEu+dlnk7S96tCO8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=jOWQ4pAVb8R1dri Rs/2uE4MisfM=; b=ejMDmrnl9RdsIDHP+T78oGbKiZ2lMN+JTbyIYLRFjF0C0n9 UHYqwdjh6yML8YGib2wwU5A4GqYnTcHee2lmHmXTKDXt4oIEAubj4OvfqFz5/HQY hXQRcCJnhc3IElz5VkqdBlf272d8Pj0MJLbKextDUtIUkS8u2PgnXjXR1HGE= X-Sasl-Enc: h0Zd6T+HRtUF30IsscwMkmO74R7MNflH1SsRaLIQxhGk 1441915664 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-c76b43ce Subject: Re: Python handles globals badly. Date: Thu, 10 Sep 2015 16:07:44 -0400 In-Reply-To: References: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.com> <55EE9EEC.1060907@rece.vub.ac.be> <55EEDD37.5090602@gmx.com> <55f072aa$0$1669$c3e8da3$5496439d@news.astraweb.com> <55f1a8df$0$1660$c3e8da3$5496439d@news.astraweb.com> <1441902711.3168172.380049449.32E41922@webmail.messagingengine.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441915666 news.xs4all.nl 23772 [2001:888:2000:d::a6]:39930 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96298 On Thu, Sep 10, 2015, at 12:48, Chris Angelico wrote: > Having assignment be a statement (and therefore illegal in a loop > condition) makes sense. Having it be an expression that yields a > useful or predictable value makes sense. Having it be an expression, > but not returning a value, doesn't. Why not? Having it not return a value (and thus be illegal in places that expect a value), but be legal in places like C's comma operator or Lisp's progn that do not use the value, would make logical sense. Your while loop could be written as something like "while (ch = getchar(); ch): ..." The main purpose of this would be to prevent you from using it where a boolean is expected, which wouldn't be necessary if Python hadn't repeated C's mistake of spelling it "=".