Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'mess': 0.07; 'caller': 0.09; 'variables.': 0.09; 'am,': 0.12; 'library': 0.13; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:10.216': 0.16; 'subject:() ': 0.16; 'subject:sum': 0.16; 'received:74.125.82.44': 0.16; 'received:mail-ww0-f44.google.com': 0.16; 'wrote:': 0.18; 'subject:not': 0.19; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'itself,': 0.23; 'module': 0.26; 'missed': 0.28; 'message-id:@mail.gmail.com': 0.29; '24,': 0.29; 'subject:number': 0.30; 'break': 0.32; 'it.': 0.33; 'fri,': 0.34; 'steven': 0.34; 'to:addr:python-list': 0.35; 'received:74.125.82': 0.36; 'received:google.com': 0.37; 'received:74.125': 0.38; 'to:addr:python.org': 0.40; 'header:Received:6': 0.61; 'custom': 0.61; 'your': 0.61; 'cause': 0.67; 'sum': 0.74; '10:33': 0.84; 'something.': 0.84; 'many,': 0.93 Received-SPF: pass (google.com: domain of rosuav@gmail.com designates 10.216.138.8 as permitted sender) client-ip=10.216.138.8; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rosuav@gmail.com designates 10.216.138.8 as permitted sender) smtp.mail=rosuav@gmail.com; dkim=pass header.i=rosuav@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=sgfeODtdr1T8OBTPjOQ7q5sHCbJEPD8WYTChwe9CwBY=; b=W7i1aQIMjZE6jhzyceYBv5HBQspP3uUGwhA3aP2PMiogRsxzyBOrBIQsCHguJk2TMZ NFqQaKwFiUlYIWf2c6Wx+XKamGQZ6vxnnjqYpgyhyuFxnZSineo8uSENYzzZ2ujrty1N Ni0GUscJTfa+aCjHd5HqVyZRJACHYfBs+dXd4= MIME-Version: 1.0 In-Reply-To: <4f46ccd2$0$29986$c3e8da3$5496439d@news.astraweb.com> References: <91c71e41-b98c-46f6-b3af-bed894cf9d92@kh11g2000pbb.googlegroups.com> <41177e2c-3cf7-4678-8594-5a81290eaa4d@ub4g2000pbc.googlegroups.com> <4f46ccd2$0$29986$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 24 Feb 2012 10:39:26 +1100 Subject: Re: sum() requires number, not simply __add__ From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1330040369 news.xs4all.nl 6917 [2001:888:2000:d::a6]:43710 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20766 On Fri, Feb 24, 2012 at 10:33 AM, Steven D'Aprano wrote: > Yes, deleting _sentinel will cause the custom sum to fail, and yes, you > have missed something. > > If the caller wants to mess with your library and break it, they have > many, many ways to do so apart from deleting your private variables. I was looking at the module breaking itself, though, not even waiting for the caller to do it. ChrisA