Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '21,': 0.07; 'classes.': 0.09; 'valueerror:': 0.09; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'instances,': 0.16; 'itself,': 0.16; 'reedy': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'why.': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '"",': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'skip:m 30': 0.32; '(most': 0.33; 'fri,': 0.33; "can't": 0.35; 'classes': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'nov': 0.38; 'pm,': 0.38; 'recent': 0.39; 'skip:u 10': 0.60; 'subject:skip:S 10': 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=Z2PNVbUvIMD+ndkjgUDQg7Ya51hspJ1hfn4MxAWZ5+s=; b=s/LlSyKyBXbhisE2UaGCz0zviYz23122K/oG3Sv8dAKIJLTPrYrhvu8YhVifDqx8Zu OOWcEzR3FnQk25XzWprSN8e0uAS+xDhnTELE21745hpKfRu5onhXiffGqP/FGPMaKLvi 2k9gZCHlnABjHLg4/p7x03Pia2bmvM8Ka2xlIAxxD8G/ZLP9Y0e57TiFMthhS8oY6Jmb Oct1tKR0S1CW4YeVme8jtvWa/iemS+Xd6HPkhd9jHk/0LNw1wn6G09BC4X8kuiF+2ZMS vobWfwEwQazg/x23YoRqNLWSPvHmRDZS7ezo9mGK891+nUEI1iMCdET7DioBsA9nauJ2 s8cQ== MIME-Version: 1.0 X-Received: by 10.50.178.212 with SMTP id da20mr1681138igc.34.1416543826061; Thu, 20 Nov 2014 20:23:46 -0800 (PST) In-Reply-To: References: <546d77a5$0$12899$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 21 Nov 2014 15:23:46 +1100 Subject: Re: Is StopIteration a singleton? From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416543834 news.xs4all.nl 2931 [2001:888:2000:d::a6]:34369 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81166 On Fri, Nov 21, 2014 at 2:40 PM, Terry Reedy wrote: > On 11/20/2014 12:09 AM, Steven D'Aprano wrote: > >> No idea. But you can marshal StopIteration itself, but not StopIteration >> instances: >> >> py> marshal.dumps(StopIteration) >> 'S' >> py> marshal.dumps(StopIteration()) >> Traceback (most recent call last): >> File "", line 1, in >> ValueError: unmarshallable object > > > Ditto for other exception classes I tried. I can't marshal any other exception instances, but I also can't marshal any other exception classes. StopIteration is special-cased, and I have no idea why. ChrisA