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


Groups > comp.lang.python > #3093

Re: Feature suggestion -- return if true

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.wiretrip.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <anikom15@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.022
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'loop,': 0.07; 'received:209.85.213.46': 0.07; 'received:mail- yw0-f46.google.com': 0.07; 'equivalent.': 0.09; 'terminate': 0.09; 'pm,': 0.11; 'def': 0.13; 'am,': 0.14; 'wrote:': 0.14; 'expr': 0.16; 'none"': 0.16; 'otherwise,': 0.20; 'tue,': 0.20; 'header:In- Reply-To:1': 0.22; 'jason': 0.22; 'received:209.85.213': 0.23; 'subject: -- ': 0.25; 'chris': 0.27; 'function': 0.27; "doesn't": 0.28; 'hey': 0.29; 'argue': 0.31; 'second': 0.31; 'does': 0.31; 'to:addr:python-list': 0.32; 'idea': 0.32; 'from:charset:iso-8859-1': 0.33; 'received:192.168.1': 0.34; 'received:192': 0.34; 'point': 0.35; '-0700,': 0.35; 'function.': 0.35; 'think': 0.36; 'none': 0.36; 'received:192.168': 0.37; 'received:209.85': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'to:addr:python.org': 0.39; 'could': 0.39; 'received:209': 0.39; 'header:Mime-Version:1': 0.39; 'how': 0.39; 'would': 0.40; 'header:Received:5': 0.40; '2011': 0.62; 'show': 0.67; 'said:': 0.68; 'message-id:@localhost.localdomain': 0.74; '12:18': 0.84; '12:20': 0.84; '12:44': 0.84; 'death!': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=dCZ+Z/aZQewSpHM1zEOepgTY0gpLjhKwSL6f7RxqdrE=; b=hpXuGByMF4rm4dtqYb3wXkyWEUGM0xjr0eysZ0rD5pJsImPS4vD4/JDkaYJkEq1Sq6 ef4d6otUaqT3BCFRb9G7Q7FPsWHhLOC2m41emJ8pqLrCMiUujofcoZW7euGf+GvfGXjF wc25NP0Mat0c+7rmYWu50RhR+WKYh8xas31JM=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=LiqLNVfZyLLP/iLqihWjJ84rMyYUAVJyPDBnpWxCMeVRHBKf7EHgH6UP9bHD4mzIKN eSOTjG5+V4j//OXxTteNvh409vJsqsYa6XHzIYOWcOGOJERgfvTScuKC+negy6lTy0eQ Doy7b6MpRkPXvpkm4erDoovSNgmwwGgqcXFYQ=
Subject Re: Feature suggestion -- return if true
From Westley Martínez <anikom15@gmail.com>
To python-list@python.org
In-Reply-To <9ed613bb-dfab-490b-9043-706b88846056@bl1g2000vbb.googlegroups.com>
References <8abff237-5ccd-4eb6-85c8-cdc9e87520b7@bl1g2000vbb.googlegroups.com> <mailman.233.1302568099.9059.python-list@python.org> <io0apf$2os$1@reader1.panix.com> <BANLkTikLxhshYfANu+cGO6hO00DMPw9P0w@mail.gmail.com> <BANLkTim+JcVt3iT6Xw4XwnvCX-Rirw9rog@mail.gmail.com> <BANLkTikvHLhzDJq==_y2L4QZy=FePr7apA@mail.gmail.com> <BANLkTinTcYtJ5o3+3=8UKbA1htAf2aQ94w@mail.gmail.com> <mailman.260.1302617154.9059.python-list@python.org> <9ed613bb-dfab-490b-9043-706b88846056@bl1g2000vbb.googlegroups.com>
Content-Type text/plain; charset="UTF-8"
Date Tue, 12 Apr 2011 15:45:11 -0700
Mime-Version 1.0
X-Mailer Evolution 2.32.2
Content-Transfer-Encoding 8bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.287.1302648317.9059.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 82.94.164.166
X-Trace 1302648318 news.xs4all.nl 41114 [::ffff:82.94.164.166]:53350
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:3093

Show key headers only | View raw


On Tue, 2011-04-12 at 07:58 -0700, scattered wrote:
> On Apr 12, 10:05 am, Westley Martínez <aniko...@gmail.com> wrote:
> > On Tue, 2011-04-12 at 12:44 +1000, Chris Angelico wrote:
> > > On Tue, Apr 12, 2011 at 12:20 PM, James Mills
> > > <prolo...@shortcircuit.net.au> wrote:
> > > > On Tue, Apr 12, 2011 at 12:18 PM, Jason Swails <jason.swa...@gmail.com> wrote:
> > > >> This is only true if n < 5.  Otherwise, the first returns None and the
> > > >> second returns False.
> >
> > > > Which is why I said:
> >
> > > > return expr or None
> >
> > > > But hey let's argue the point to death!
> >
> > > That's still not equivalent. "return expr or None" will always
> > > terminate the function. The OP's request was for something which would
> > > terminate the function if and only if expr is non-false.
> >
> > > Chris Angelico
> >
> > def bs(x):
> >     while not x:
> >         <modify x>
> >     return x
> >
> > Am I wrong here?- Hide quoted text -
> >
> > - Show quoted text -
> 
> I don't think that this is equivalent. The OP's original idea doesn't
> involve a loop, but this does - how could that be equivalent?

Not OP's idea, Angelico's.

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


Thread

Feature suggestion -- return if true zildjohn01 <zildjohn01@gmail.com> - 2011-04-11 16:17 -0700
  Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-12 10:27 +1000
    Re: Feature suggestion -- return if true Grant Edwards <invalid@invalid.invalid> - 2011-04-12 01:44 +0000
      Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-12 12:12 +1000
        Re: Feature suggestion -- return if true Grant Edwards <invalid@invalid.invalid> - 2011-04-12 02:18 +0000
          Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-12 12:44 +1000
            Re: Feature suggestion -- return if true Grant Edwards <invalid@invalid.invalid> - 2011-04-12 13:42 +0000
            Re: Feature suggestion -- return if true "Martin v. Loewis" <martin@v.loewis.de> - 2011-04-17 12:03 +0200
              Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-18 09:36 +1000
      Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-12 12:20 +1000
      Re: Feature suggestion -- return if true Zero Piraeus <schesis@gmail.com> - 2011-04-11 22:43 -0400
      Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-12 12:44 +1000
      Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-12 12:49 +1000
      Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-12 12:59 +1000
      Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-12 13:01 +1000
        Re: Feature suggestion -- return if true Nobody <nobody@nowhere.com> - 2011-04-12 07:08 +0100
          Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-12 16:21 +1000
            Re: Feature suggestion -- return if true Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-12 10:52 +0000
            Re: Feature suggestion -- return if true scattered <tooscattered@gmail.com> - 2011-04-12 03:55 -0700
              Re: Feature suggestion -- return if true "Colin J. Williams" <cjw@ncf.ca> - 2011-04-12 10:01 -0400
            Re: Feature suggestion -- return if true Grant Edwards <invalid@invalid.invalid> - 2011-04-12 13:50 +0000
        Re: Feature suggestion -- return if true Grant Edwards <invalid@invalid.invalid> - 2011-04-12 13:44 +0000
      Re: Feature suggestion -- return if true Westley Martínez <anikom15@gmail.com> - 2011-04-12 07:05 -0700
        Re: Feature suggestion -- return if true scattered <tooscattered@gmail.com> - 2011-04-12 07:58 -0700
          Re: Feature suggestion -- return if true Westley Martínez <anikom15@gmail.com> - 2011-04-12 15:45 -0700
          Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-13 08:52 +1000
        Re: Feature suggestion -- return if true zildjohn01 <zildjohn01@gmail.com> - 2011-04-12 11:25 -0700
          Re: Feature suggestion -- return if true Terry Reedy <tjreedy@udel.edu> - 2011-04-12 15:14 -0400
          Re: Feature suggestion -- return if true alex23 <wuwei23@gmail.com> - 2011-04-12 21:05 -0700
    Re: Feature suggestion -- return if true Teemu Likonen <tlikonen@iki.fi> - 2011-04-12 21:00 +0300
      Re: Feature suggestion -- return if true Ian Kelly <ian.g.kelly@gmail.com> - 2011-04-12 12:25 -0600
        Re: Feature suggestion -- return if true Neil Cerutti <neilc@norwich.edu> - 2011-04-12 20:13 +0000
          Re: Feature suggestion -- return if true Neil Cerutti <neilc@norwich.edu> - 2011-04-12 20:16 +0000
      Re: Feature suggestion -- return if true Ian Kelly <ian.g.kelly@gmail.com> - 2011-04-12 12:29 -0600
      Re: Feature suggestion -- return if true Paul Rudin <paul.nospam@rudin.co.uk> - 2011-04-12 19:28 +0100
      Re: Feature suggestion -- return if true Chris Rebert <clp2@rebertia.com> - 2011-04-12 13:26 -0700
      Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-13 08:34 +1000
      Re: Feature suggestion -- return if true Ethan Furman <ethan@stoneleaf.us> - 2011-04-12 16:06 -0700
      Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-13 09:12 +1000
      Re: Feature suggestion -- return if true Westley Martínez <anikom15@gmail.com> - 2011-04-12 16:15 -0700
      Re: Feature suggestion -- return if true Ethan Furman <ethan@stoneleaf.us> - 2011-04-12 16:48 -0700
        Re: Feature suggestion -- return if true Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-13 00:03 +0000
          Re: Feature suggestion -- return if true Ethan Furman <ethan@stoneleaf.us> - 2011-04-12 19:42 -0700
          Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-13 13:00 +1000
          Re: Feature suggestion -- return if true James Mills <prologic@shortcircuit.net.au> - 2011-04-13 13:28 +1000
      Re: Feature suggestion -- return if true Teemu Likonen <tlikonen@iki.fi> - 2011-04-13 13:58 +0300
  Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-12 10:46 +1000
    Re: Feature suggestion -- return if true Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-04-17 16:21 +1200
      Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-17 14:31 +1000
      Re: Feature suggestion -- return if true Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-17 08:45 +0000
        Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-17 19:07 +1000
          Re: Feature suggestion -- return if true Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-17 15:23 +0000
        Re: Feature suggestion -- return if true Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-04-18 12:25 +1200
        Re: Feature suggestion -- return if true Dave Angel <davea@ieee.org> - 2011-04-17 22:04 -0400
        Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-18 12:10 +1000
          Re: Feature suggestion -- return if true Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-04-19 12:35 +1200
            Re: Feature suggestion -- return if true Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-04-19 09:42 +0300
              Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-19 17:01 +1000
      Re: Feature suggestion -- return if true "D'Arcy J.M. Cain" <darcy@druid.net> - 2011-04-17 08:33 -0400
        Re: Feature suggestion -- return if true Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-17 15:10 +0000
        Re: Feature suggestion -- return if true aahz@pythoncraft.com (Aahz) - 2011-04-18 09:11 -0700
      Re: Feature suggestion -- return if true Greg Ewing <greg.ewing@canterbury.ac.nz> - 2011-04-18 11:09 +1200
  Re: Feature suggestion -- return if true Chris Angelico <rosuav@gmail.com> - 2011-04-12 10:51 +1000
  Re: Feature suggestion -- return if true Paul Rubin <no.email@nospam.invalid> - 2011-04-11 23:58 -0700
    Re: Feature suggestion -- return if true John Roth <johnroth1@gmail.com> - 2011-04-12 06:16 -0700
    Re: Feature suggestion -- return if true Mel <mwilson@the-wire.com> - 2011-04-12 11:12 -0400

csiph-web