Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: MRAB Newsgroups: comp.lang.python Subject: Re: Assignment Versus Equality Date: Sun, 26 Jun 2016 16:41:48 +0100 Lines: 16 Message-ID: References: <8a53c069-ca13-47bf-a24e-d2393a018b22@googlegroups.com> <78b5ed0e-ec5f-6f54-b88c-4fed570115d2@mrabarnett.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de FroxDHrNnRK435H3bJOZOAEfY+MNru1h8GeDzYxSi4dg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'assignment': 0.07; 'python': 0.10; '"="': 0.16; 'assignments.': 0.16; 'assigns': 0.16; 'chained': 0.16; 'comparison.': 0.16; 'expressions.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'ops': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'copied': 0.18; 'lawrence': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'appear': 0.26; 'equality': 0.29; "i'm": 0.30; 'convention': 0.30; "can't": 0.32; 'received:84': 0.32; 'common': 0.33; 'though.': 0.33; 'supports': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'why': 0.39; 'sure': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'virtually': 0.66; 'mistakes.': 0.84; 'mistakes': 0.95 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.2 cv=QfYkhYTv c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=IkcTkHD0fZMA:10 a=XrjwwsNLl7gUBfuciHQA:9 X-AUTH: mrabarnett@:2500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 In-Reply-To: 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: <78b5ed0e-ec5f-6f54-b88c-4fed570115d2@mrabarnett.plus.com> X-Mailman-Original-References: <8a53c069-ca13-47bf-a24e-d2393a018b22@googlegroups.com> Xref: csiph.com comp.lang.python:110522 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.