Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Reimer Newsgroups: comp.lang.python Subject: Re: Assignment Versus Equality Date: Sun, 26 Jun 2016 11:53:19 -0700 Lines: 24 Message-ID: References: <8a53c069-ca13-47bf-a24e-d2393a018b22@googlegroups.com> <78b5ed0e-ec5f-6f54-b88c-4fed570115d2@mrabarnett.plus.com> <1e5a51af-cb31-f3fe-cc07-535ee8073ea6@icloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de HBK/dQsglU1Szmuq4Qe55w5IfV63tasovYmgpQvrGBAQ== Return-Path: 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; 'mrab': 0.05; 'assignment': 0.07; 'python': 0.10; '"="': 0.16; 'assignments.': 0.16; 'assigns': 0.16; 'chained': 0.16; 'comparison.': 0.16; 'expressions.': 0.16; 'ops': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'copied': 0.18; '>>>': 0.20; 'lawrence': 0.22; 'am,': 0.23; 'header:User-Agent:1': 0.26; 'appear': 0.26; 'chris': 0.26; 'received:17': 0.27; 'clever': 0.29; 'equality': 0.29; "i'm": 0.30; 'convention': 0.30; "can't": 0.32; 'received:10.0.0': 0.32; 'common': 0.33; 'though.': 0.33; 'received:10.0': 0.34; 'supports': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'thought': 0.37; 'why': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.40; 'header :MIME-version:1': 0.60; 'skip:u 10': 0.61; 'art': 0.62; 'virtually': 0.66; 'header:In-reply-to:1': 0.84; 'mistakes.': 0.84; 'mistakes': 0.95 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-26_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1606260211 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 In-reply-to: <78b5ed0e-ec5f-6f54-b88c-4fed570115d2@mrabarnett.plus.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=4d515a; t=1466967198; bh=c5myd7916+Wuj4AObwYepPeyUfmvq2crk3QjP+7yc48=; h=Subject:To:From:Message-id:Date:MIME-version:Content-type; b=oLB7SYzAJUARPpTjcsYK22xwAKlhyqPrQydvqosMFQPJTu9KJZVhihEfiEf6Wce3B BkAhQ4lUxv2Oe+yRdU8yrz0lorhyrJwOhOWrdkMcLRXNxGah6tCSU5fjwBWLCTyCuz 8n/+gGYes35qC01vn3sWIbjSnIbBE8j6+fzk5eLlMll47NtqfTw3uJrp5B47HDYqlo 8d0NWO99EUCUZaDtcPKZsgjkGgGMa5DQA94rHh855OSQ94LL9AKvvFOwsPQnD87pPG YHpx2xkdvVqUmG39ecR73UJBsdCBN5wYpI2Fwn+MF9H0YA+JC8Jy7kvpXZ5mKzEVSx yjg2ztqNlKCmw== X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1e5a51af-cb31-f3fe-cc07-535ee8073ea6@icloud.com> X-Mailman-Original-References: <8a53c069-ca13-47bf-a24e-d2393a018b22@googlegroups.com> <78b5ed0e-ec5f-6f54-b88c-4fed570115d2@mrabarnett.plus.com> Xref: csiph.com comp.lang.python:110539 On 6/26/2016 8:41 AM, MRAB wrote: > On 2016-06-26 11:48, BartC wrote: >> On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: >>> One of Python’s few mistakes was that it copied the C convention of >>> using “=” for assignment and “==” for equality comparison. >> >> One of C's many mistakes. Unfortunately C has been very influential. >> >> However, why couldn't Python have used "=" both for assignment, and for >> equality? Since I understand assignment ops can't appear in expressions. >> > [snip] > > Python supports chained assignments. For example, "a = b = 0" assigns > 0 to both a and b. > > I'm not sure how common it is, though. I virtually never use it myself. How can you not use chained assignments? I thought Python was the art of the clever one-liners. :) Chris R.