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


Groups > comp.lang.python > #85420

Re: __next__ and StopIteration

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'received:209.85.223': 0.03; 'broken': 0.04; 'allowed.': 0.07; 'rounds': 0.09; 'subtle': 0.09; 'cc:addr:python-list': 0.11; 'random': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterator': 0.16; 'of"': 0.16; 'received:209.85.223.173': 0.16; 'track.': 0.16; 'worst': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'documented': 0.24; 'cc:2**0': 0.24; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'then.': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'probably': 0.32; 'lab': 0.33; 'not.': 0.33; 'maybe': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; "i'll": 0.36; 'should': 0.36; 'received:209': 0.37; 'being': 0.38; 'pm,': 0.38; 'expect': 0.39; 'does': 0.39; 'numbers': 0.61; "you're": 0.61; 'show': 0.63; 'news': 0.67; 'miss': 0.74; 'future,': 0.83; '2015': 0.84; 'boys': 0.84; 'median': 0.84; 'poisoning': 0.84; 'subject:skip:S 10': 0.84; 'symptoms': 0.84; 'technically': 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=8Mi8JqY+xMYBBJl8M8I9dvPYIEtUYKEqvKuu0L/5xcU=; b=Xl7BbLw2OcmSgLMrcdwr7lNvEV1nAlLmQYgxG/lqx5m0Tytdc0Dsw+W3Q2nAbBeEPZ 6n13u1Ff0SanBMFozwx/6vNtIhSlXqFgse1jzbi0LA2DeRIMaIfssGvybtpDr26Yv0G7 VKFsW9QPtykGueo8+GSGwIx/EvNzq+kdwO3Vi2X7b5MCs2h6NEmFQp8tbPWOpyzew03r kVhV6yKp02tkcuazhF//Xal8PTU3EaeAfJvrlpxSLIX5wbzC8UFQlS9PE5ip9aluJgg/ ZS9TmrXQKV+oBdkhX6x1y+dhUlsJzBgR69/pX6LtENzpoGb7admf2RUdL6ES9xX/5R8W 8P1Q==
MIME-Version 1.0
X-Received by 10.42.52.200 with SMTP id k8mr28357567icg.26.1423533524858; Mon, 09 Feb 2015 17:58:44 -0800 (PST)
In-Reply-To <54d95adc$0$13002$c3e8da3$5496439d@news.astraweb.com>
References <mailman.18573.1423509383.18130.python-list@python.org> <54d94307$0$12998$c3e8da3$5496439d@news.astraweb.com> <mailman.18582.1423526240.18130.python-list@python.org> <54d9540d$0$13003$c3e8da3$5496439d@news.astraweb.com> <mailman.18585.1423529677.18130.python-list@python.org> <54d95adc$0$13002$c3e8da3$5496439d@news.astraweb.com>
Date Tue, 10 Feb 2015 12:58:44 +1100
Subject Re: __next__ and StopIteration
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.18588.1423533527.18130.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1423533527 news.xs4all.nl 2878 [2001:888:2000:d::a6]:43494
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:85420

Show key headers only | View raw


On Tue, Feb 10, 2015 at 12:11 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
>> Yes, it is allowed. But when you write code that's documented as being
>> "broken", you should expect annoying, subtle errors, maybe a long way
>> down the track.
>
> Well, that depends, don't it?
>
> Am I really going to care if the iterator used to generate those random
> numbers is technically "broken"? Probably not. And if I do, some time in
> the distant future, oh well, I'll "fix" it then.

If you inhale asbestos, you should expect annoying, maybe subtle,
errors, maybe a long way down the track. Good news is, the lab boys
say the symptoms of asbestos poisoning show a median latency of 44.6
years, so if you're thirty or older, you're laughing. Worst case
scenario, you miss out on a few rounds of canasta. Do you care that
your lungs are technically "broken"? Probably not. It's something to
be aware of when you consider working in certain environments, but "be
aware of" doesn't mean "absolutely always avoid".

Okay, maybe it does with asbestos... but not with broken iterators. :)

ChrisA

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


Thread

__next__ and StopIteration Charles Hixson <charleshixsn@earthlink.net> - 2015-02-09 11:14 -0800
  Re: __next__ and StopIteration Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-02-09 19:27 +0000
  Re: __next__ and StopIteration Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-10 10:30 +1100
    Re: __next__ and StopIteration Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-09 16:56 -0700
      Re: __next__ and StopIteration Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-10 11:42 +1100
        Re: __next__ and StopIteration Chris Angelico <rosuav@gmail.com> - 2015-02-10 11:54 +1100
          Re: __next__ and StopIteration Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-10 12:11 +1100
            Re: __next__ and StopIteration Chris Angelico <rosuav@gmail.com> - 2015-02-10 12:58 +1100
        Re: __next__ and StopIteration Chris Kaynor <ckaynor@zindagigames.com> - 2015-02-09 16:59 -0800
          Re: __next__ and StopIteration Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-10 16:54 +1100
        Re: __next__ and StopIteration Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-10 01:30 -0700
        Re: __next__ and StopIteration Chris Kaynor <ckaynor@zindagigames.com> - 2015-02-10 09:27 -0800
    Re: __next__ and StopIteration Charles Hixson <charleshixsn@earthlink.net> - 2015-02-09 20:33 -0800
    Re: __next__ and StopIteration Chris Angelico <rosuav@gmail.com> - 2015-02-10 15:46 +1100
    Re: __next__ and StopIteration Charles Hixson <charleshixsn@earthlink.net> - 2015-02-09 22:16 -0800
    Re: __next__ and StopIteration Chris Angelico <rosuav@gmail.com> - 2015-02-10 17:38 +1100
    Re: __next__ and StopIteration Ethan Furman <ethan@stoneleaf.us> - 2015-02-10 08:44 -0800
    Re: __next__ and StopIteration Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-10 09:53 -0700
    Re: __next__ and StopIteration Ethan Furman <ethan@stoneleaf.us> - 2015-02-10 09:33 -0800

csiph-web