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


Groups > comp.lang.python > #53015

Re: How come StopIteration.__base__ is not BaseException?

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <random832@fastmail.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:not': 0.03; 'context': 0.07; 'escape': 0.09; 'received:internal': 0.09; 'subject:How': 0.10; 'marco': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'systemexit': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'aug': 0.22; '(by': 0.24; 'mon,': 0.24; 'header:In-Reply-To:1': 0.27; 'code': 0.31; 'catching': 0.31; 'received:66': 0.35; 'subject:?': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'catch': 0.60; 'from:no real name:2**0': 0.61; 'header:Message-Id:1': 0.63; '26,': 0.68; '2013,': 0.91; 'subject:skip:S 20': 0.91
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= message-id:from:to:mime-version:content-transfer-encoding :content-type:in-reply-to:references:subject:date; s=mesmtp; bh= bnpK+WVUg2I7EJTnkq5sv8HfcB0=; b=gVfhZmDgaPBBHcKONbRRq+SSKh5GMYne XRUjW+2Q0BGCWc85pX6oKBqjy+NDRjFaDauySL9Z9oRr43I4nhR+RmM21BiSL24o TOaeRsIdGVtZVZcYQ0QWTy6t+FhnL2kk6cDpidOMyg8tiEYuCyPbAuF+HSAr24ls WhdGsy6b5Fs=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=bnpK+WVUg2I7EJTnkq5sv8HfcB0=; b=HXv Uhl2eCogsith+3ZY+ZhcV3UOwKestuldXC+cL7XdNyJl6nsDIJzT1kJoApLEhCx6 +2GuATOWbeJloT4jQu/LfOGIGKKo72CKSpEgNOy1O1A3IStpXmNlrXSNO3eHkAHw TJMMJGsufgMCSvWjHvJRZbU7LPDTnFBjMJ2mATy0=
X-Sasl-Enc soKIhLg1zCVdB2OLdEKgiywkJiuo8glnZZ1Ntt+/s5XA 1377547815
From random832@fastmail.us
To "" <python-list@python.org>
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Content-Type text/plain
X-Mailer MessagingEngine.com Webmail Interface - ajax-be0d4992
In-Reply-To <kvgapp$lh3$1@speranza.aioe.org>
References <kvgapp$lh3$1@speranza.aioe.org>
Subject Re: How come StopIteration.__base__ is not BaseException?
Date Mon, 26 Aug 2013 16:10:15 -0400
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 <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.246.1377547832.19984.python-list@python.org> (permalink)
Lines 9
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1377547832 news.xs4all.nl 15963 [2001:888:2000:d::a6]:50780
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:53015

Show key headers only | View raw


On Mon, Aug 26, 2013, at 15:37, Marco Buttu wrote:
> Since StopIteration is not an error, how come does it inherit directly 
> from Exception and not from BaseException?

The reason KeyboardInterrupt and SystemExit inherit from BaseException
is because you often want them to escape (allowing the program to quit)
from code that would otherwise catch them (by catching Exception). On
the contrary, StopIteration is almost always used in a context that
catches it specifically.

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


Thread

How come StopIteration.__base__ is not BaseException? Marco Buttu <marco.buttu@gmail.com> - 2013-08-26 21:37 +0200
  Re: How come StopIteration.__base__ is not BaseException? random832@fastmail.us - 2013-08-26 16:10 -0400
    Re: How come StopIteration.__base__ is not BaseException? Marco Buttu <marco.buttu@gmail.com> - 2013-08-27 08:17 +0200
      Re: How come StopIteration.__base__ is not BaseException? Marco Buttu <marco.buttu@gmail.com> - 2013-08-27 08:18 +0200
      Re: How come StopIteration.__base__ is not BaseException? Steven D'Aprano <steve@pearwood.info> - 2013-08-27 09:22 +0000
        Re: How come StopIteration.__base__ is not BaseException? Marco Buttu <marco.buttu@gmail.com> - 2013-08-27 12:02 +0200
          Re: How come StopIteration.__base__ is not BaseException? Terry Reedy <tjreedy@udel.edu> - 2013-08-27 14:51 -0400
            Re: How come StopIteration.__base__ is not BaseException? Marco Buttu <marco.buttu@gmail.com> - 2013-08-27 21:52 +0200
              Re: How come StopIteration.__base__ is not BaseException? Terry Reedy <tjreedy@udel.edu> - 2013-08-27 16:37 -0400
  Re: How come StopIteration.__base__ is not BaseException? Ethan Furman <ethan@stoneleaf.us> - 2013-08-27 13:00 -0700

csiph-web