Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20759
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!ecngs!feeder.ecngs.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.007 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'python': 0.08; 'think?': 0.09; 'am,': 0.12; 'def': 0.13; 'argument': 0.15; '"del"': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'keyword.': 0.16; 'omitted.': 0.16; 'subject:() ': 0.16; 'subject:sum': 0.16; 'wrote:': 0.18; 'subject:not': 0.19; 'received:209.85.210.174': 0.21; 'received:mail- iy0-f174.google.com': 0.21; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'optional': 0.23; 'object,': 0.24; 'skip:_ 20': 0.26; 'message-id:@mail.gmail.com': 0.29; '24,': 0.29; 'fairly': 0.30; 'basically,': 0.30; 'subject:number': 0.30; 'syntax,': 0.30; 'chris': 0.30; 'list': 0.32; 'fri,': 0.34; 'to:addr:python-list': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.40; 'unique': 0.61; 'header:Received:6': 0.61; 'more': 0.61; 'as:': 0.70; 'introduce': 0.82 |
| Received-SPF | pass (google.com: domain of rosuav@gmail.com designates 10.42.131.129 as permitted sender) client-ip=10.42.131.129; |
| Authentication-Results | mr.google.com; spf=pass (google.com: domain of rosuav@gmail.com designates 10.42.131.129 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=czmXksDR2KpBQdNihs1txCQRoqXFCNn7ldG+k1FoEI4=; b=Zp2f1wZgWqcyCbJtsAdwq5KnmRW8WXxjfe6QFclLPbmwnaM8TPX3/O45kIdnPQGiCz F8EfVZg52d+jQa7cqL6cI/5MR4IAsQVhb8XNnIbfPBTxv6Ltc+jku+99BeomoXlVSgJR CzzeI/kRAb3Zqucp6Zpl3Wmhcr7NAkdZhGNTc= |
| MIME-Version | 1.0 |
| In-Reply-To | <CAJ6cK1ZkwgvwKpoA+UUYxZbSn+GSqtAHBCMZwbkwTyQKELcGqQ@mail.gmail.com> |
| References | <91c71e41-b98c-46f6-b3af-bed894cf9d92@kh11g2000pbb.googlegroups.com> <41177e2c-3cf7-4678-8594-5a81290eaa4d@ub4g2000pbc.googlegroups.com> <CAJ6cK1bzw23=_bx-85HTUksQD8nFMhFijs_xJiMeQYCc4kHQcw@mail.gmail.com> <CAPTjJmoEQ+XrHwd94Hntmehfg12bSksfok7fanJyGeSuo-M95w@mail.gmail.com> <CAJ6cK1ZkwgvwKpoA+UUYxZbSn+GSqtAHBCMZwbkwTyQKELcGqQ@mail.gmail.com> |
| Date | Fri, 24 Feb 2012 09:04:23 +1100 |
| Subject | Re: sum() requires number, not simply __add__ |
| From | Chris Angelico <rosuav@gmail.com> |
| 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 <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.96.1330034667.3037.python-list@python.org> (permalink) |
| Lines | 16 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1330034667 news.xs4all.nl 6903 [2001:888:2000:d::a6]:38720 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:20759 |
Show key headers only | View raw
On Fri, Feb 24, 2012 at 8:59 AM, Arnaud Delobelle <arnodel@gmail.com> wrote:
> def sum(iterable, start=_sentinel, _sentinel=_sentinel):
Is this a reason for Python to introduce a new syntax, such as:
def foo(blah, optional=del):
if 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?
(I picked "del" because it's an existing keyword. Fairly arbitrary
choice though.)
Chris Angelico
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
sum() requires number, not simply __add__ Buck Golemon <buck@yelp.com> - 2012-02-23 13:19 -0800
Re: sum() requires number, not simply __add__ Buck Golemon <buck@yelp.com> - 2012-02-23 13:23 -0800
Re: sum() requires number, not simply __add__ Arnaud Delobelle <arnodel@gmail.com> - 2012-02-23 21:41 +0000
Re: sum() requires number, not simply __add__ Chris Angelico <rosuav@gmail.com> - 2012-02-24 08:53 +1100
Re: sum() requires number, not simply __add__ Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-23 23:33 +0000
Re: sum() requires number, not simply __add__ Chris Angelico <rosuav@gmail.com> - 2012-02-24 10:39 +1100
Re: sum() requires number, not simply __add__ Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2012-02-24 12:41 +0100
Re: sum() requires number, not simply __add__ Roy Smith <roy@panix.com> - 2012-02-24 08:23 -0500
Re: sum() requires number, not simply __add__ Terry Reedy <tjreedy@udel.edu> - 2012-02-24 16:58 -0500
Re: sum() requires number, not simply __add__ Arnaud Delobelle <arnodel@gmail.com> - 2012-02-23 21:59 +0000
Re: sum() requires number, not simply __add__ Ian Kelly <ian.g.kelly@gmail.com> - 2012-02-23 15:00 -0700
Re: sum() requires number, not simply __add__ Chris Angelico <rosuav@gmail.com> - 2012-02-24 09:04 +1100
Re: sum() requires number, not simply __add__ Arnaud Delobelle <arnodel@gmail.com> - 2012-02-23 22:09 +0000
Re: sum() requires number, not simply __add__ Arnaud Delobelle <arnodel@gmail.com> - 2012-02-23 21:32 +0000
Re: sum() requires number, not simply __add__ Chris Rebert <clp2@rebertia.com> - 2012-02-23 13:32 -0800
Re: sum() requires number, not simply __add__ Buck Golemon <buck@yelp.com> - 2012-02-23 13:38 -0800
Re: sum() requires number, not simply __add__ Ian Kelly <ian.g.kelly@gmail.com> - 2012-02-23 14:54 -0700
Re: sum() requires number, not simply __add__ Stefan Behnel <stefan_ml@behnel.de> - 2012-02-23 22:42 +0100
Re: sum() requires number, not simply __add__ Duncan Booth <duncan.booth@invalid.invalid> - 2012-02-24 11:40 +0000
Re: sum() requires number, not simply __add__ Peter Otten <__peter__@web.de> - 2012-02-24 09:29 +0100
csiph-web