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


Groups > comp.lang.python > #63028

Re: Ifs and assignments

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.045
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'assume': 0.14; 'chained': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'time.time()': 0.16; 'wrote:': 0.18; 'pointed': 0.19; 'cc:addr:python.org': 0.22; 'delta': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'message- id:@mail.gmail.com': 0.30; 'time:': 0.31; 'fri,': 0.33; "i'd": 0.34; 'received:google.com': 0.35; 'otherwise.': 0.36; 'pm,': 0.38; 'name': 0.63; 'spot': 0.65; 'hints': 0.68; 'smith': 0.68; '3:00': 0.84; 'to:none': 0.92
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:cc :content-type; bh=nKUEae9lWSJTlveRo5h43Wk4bWJ1lGHjj7TGZfGuyOg=; b=W7dQ2sRcaeBnNK7K2TEV8O10aSstS/emRrcnYo7AX6aoN/d3qjIAhNiLJFYZrk9TXr kQ9Iy/HWNoNeWXgOXQhP/dY7yIGxnnG6ZxtgXrghklMA08+K9yBS8kVPLrRgs6UuJQz4 6s9ys/33/XBwxb195gdYNLhwDPcu8r0Ye/etxJ815U0AFzvno3uEHT+UB9yCZoVGrYEn 4jFT2MaPUh/Tfi3Ql1ky+9BKIYpoDNx4+nwcE8puPRxT3jel3wNfmBx19trb7pxiLjoF wDxJJkuCsgdxFNeDgJE0EFK5nYq2gdFXgbLa/aZsL9hxPV+OTYUROSqEnF5DK6kkBOKS f4Yg==
MIME-Version 1.0
X-Received by 10.68.108.194 with SMTP id hm2mr93151200pbb.22.1388722113375; Thu, 02 Jan 2014 20:08:33 -0800 (PST)
In-Reply-To <roy-ACE92F.23004902012014@news.panix.com>
References <52C59FF6.5000607@allsup.co> <mailman.4816.1388709915.18130.python-list@python.org> <52c62fa8$0$30001$c3e8da3$5496439d@news.astraweb.com> <mailman.4824.1388721334.18130.python-list@python.org> <roy-ACE92F.23004902012014@news.panix.com>
Date Fri, 3 Jan 2014 15:08:33 +1100
Subject Re: Ifs and assignments
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.4827.1388722122.18130.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1388722122 news.xs4all.nl 2901 [2001:888:2000:d::a6]:34285
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:63028

Show key headers only | View raw


On Fri, Jan 3, 2014 at 3:00 PM, Roy Smith <roy@panix.com> wrote:
> I do this all the time:
>
> t0 = time.time()
> [some code]
> t1 = time.time()
> dt = t1 = t0   # <-- spot the typo?

Yep, I see that... now that it's pointed out as a typo. Without the
marker, I'd assume it's correct chained assignment, and only an
examination of the name (dt = delta t) hints otherwise.

ChrisA

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


Thread

Re: Ifs and assignments Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-01-02 19:45 -0500
  Re: Ifs and assignments Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-03 14:33 +1100
    Re: Ifs and assignments Chris Angelico <rosuav@gmail.com> - 2014-01-03 14:49 +1100
      Re: Ifs and assignments Roy Smith <roy@panix.com> - 2014-01-02 23:14 -0500
        Re: Ifs and assignments Chris Angelico <rosuav@gmail.com> - 2014-01-03 15:25 +1100
        Re: Ifs and assignments Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-03 04:29 +0000
      Re: Ifs and assignments Duncan Booth <duncan.booth@invalid.invalid> - 2014-01-03 15:46 +0000
    Re: Ifs and assignments Chris Angelico <rosuav@gmail.com> - 2014-01-03 14:55 +1100
      Re: Ifs and assignments Roy Smith <roy@panix.com> - 2014-01-02 23:00 -0500
        Re: Ifs and assignments Chris Angelico <rosuav@gmail.com> - 2014-01-03 15:08 +1100

csiph-web