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: 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: "" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-be0d4992 In-Reply-To: References: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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.