Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python': 0.08; 'think?': 0.09; 'am,': 0.12; 'def': 0.13; 'received:209.85.214.174': 0.13; 'argument': 0.15; 'omitted.': 0.16; 'subject:() ': 0.16; 'subject:sum': 0.16; '\xc2\xa0if': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'subject:not': 0.19; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'optional': 0.23; 'object,': 0.24; 'cc:2**0': 0.26; 'skip:_ 20': 0.26; 'message- id:@mail.gmail.com': 0.29; '24,': 0.29; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'basically,': 0.30; 'subject:number': 0.30; 'syntax,': 0.30; 'chris': 0.30; 'list': 0.32; 'fri,': 0.34; 'trouble': 0.35; 'received:209.85.214': 0.36; 'received:google.com': 0.37; 'received:209.85': 0.38; 'could': 0.38; 'received:209': 0.39; 'unique': 0.61; 'header:Received:6': 0.61; 'more': 0.61; 'here': 0.64; 'as:': 0.70; 'introduce': 0.82 Received-SPF: pass (google.com: domain of arnodel@gmail.com designates 10.182.86.201 as permitted sender) client-ip=10.182.86.201; Authentication-Results: mr.google.com; spf=pass (google.com: domain of arnodel@gmail.com designates 10.182.86.201 as permitted sender) smtp.mail=arnodel@gmail.com; dkim=pass header.i=arnodel@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 :cc:content-type:content-transfer-encoding; bh=hkVS4/BXOQxeJog4p2H57OEv9VTg0pkMlCE3TVepnvI=; b=eIAb+HeKr72JZgJOKyi4NE1jdyyYV4FrsXMGkOmJVwkaI03oOxTdZXJp4rwK9iw7O7 Wf8hy/Ci7+i17b6RH0LC9LiPV4CblBKRFzGM0t9sBOnWPWBjo4v3hHpRYM6jFNELHiPJ j5HCeOihFYFFQjwxiVYvNqAkSNWuRe6cyMBJs= MIME-Version: 1.0 In-Reply-To: References: <91c71e41-b98c-46f6-b3af-bed894cf9d92@kh11g2000pbb.googlegroups.com> <41177e2c-3cf7-4678-8594-5a81290eaa4d@ub4g2000pbc.googlegroups.com> Date: Thu, 23 Feb 2012 22:09:13 +0000 Subject: Re: sum() requires number, not simply __add__ From: Arnaud Delobelle To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1330034956 news.xs4all.nl 6976 [2001:888:2000:d::a6]:44256 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20760 On 23 February 2012 22:04, Chris Angelico wrote: > On Fri, Feb 24, 2012 at 8:59 AM, Arnaud Delobelle wro= te: >> def sum(iterable, start=3D_sentinel, _sentinel=3D_sentinel): > > Is this a reason for Python to introduce a new syntax, such as: > > def foo(blah, optional=3Ddel): > =C2=A0 =C2=A0if optional is del: print("No argument was provided") > > Basically, 'del' is treated like a unique non-providable object, only > possible in an argument list and only if the argument was omitted. No > more proliferation of individual sentinels... what do you think? The problem with these proposals is to avoid the leakage of 'del'. Here you could do: def get_del(x=3Ddel): return x And then you're in trouble again. --=20 Arnaud