Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.057 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'lawrence': 0.09; 'subtract': 0.09; 'arrays,': 0.16; 'enlighten': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'knows?': 0.16; 'wrote:': 0.17; 'received:209.85.214.174': 0.21; 'subject:skip:i 10': 0.22; "i've": 0.23; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'subject:list': 0.28; "d'aprano": 0.29; 'steven': 0.29; "i'm": 0.29; 'fri,': 0.30; 'to:addr:python-list': 0.33; 'code:': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'nov': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'itself': 0.37; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'more': 0.63; 'benefit': 0.70; 'once).': 0.84; 'sets,': 0.84; 'either:': 0.91 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=llGo0AESgl6iATHgylGjRzqcVMx7jXRtWrk4wCZCyDI=; b=Bcq3DKKBBcFB0HoB2kO6JtrzUvClRj6Br6uotDAHRpUK6kxGV0YLo2SbSJAfzbGRGW jEyH1rJAFNh8RoJckRR69L3DbO5ABHtboWsq3JXdhebu/4mjIN3ZWJ9yrDxkBfECXysg rSYaQ7ED9hU05IYG1zzNhRdcUFOCi35ARvU2lLHQQg5fEEUSzmfvNBiLFYOjgTAMwWYT IwHgHwgi0rnebAHsiDYKUkikSG/erN2Qc+uqQ5ouwN0xIu/zPgfzCCV17/0ti6tiDheW sHq3oyOJsTH9Kcsod8S3rQgZ7YR/WMNsOdVvaZoq4H2hqMin83ee0ZVky9MYs7ywu4du 5PYA== MIME-Version: 1.0 In-Reply-To: References: <50978323$0$6908$e4fe514c@news2.news.xs4all.nl> <5098d2ac$0$29980$c3e8da3$5496439d@news.astraweb.com> <5099bf7d$0$29980$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 9 Nov 2012 17:07:09 +1100 Subject: Re: Multi-dimensional list initialization From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352441232 news.xs4all.nl 6927 [2001:888:2000:d::a6]:36931 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32995 On Fri, Nov 9, 2012 at 12:39 PM, Mark Lawrence wrote: > On 07/11/2012 01:55, Steven D'Aprano wrote: >> >> >> Who knows? Who cares? Nobody does: >> >> n -= n >> > > But I've seen this scattered through code: > > x := x - x - x Can you enlighten us as to how this is better than either: x := -x or x := 0 - x ? I'm not seeing it. And I'm not seeing any nonnumeric that would benefit from being subtracted from itself twice (strings, arrays, sets, you can subtract them from one another but not usefully more than once). ChrisA