Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '"this': 0.03; 'argument': 0.05; 'recommends': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'pathological': 0.16; 'roy': 0.16; 'singleton': 0.16; 'wished': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'compare': 0.26; 'right.': 0.26; 'pass': 0.26; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'compared': 0.30; 'message-id:@mail.gmail.com': 0.30; 'equality': 0.31; 'cases': 0.33; 'skip:_ 10': 0.34; 'received:google.com': 0.35; "i'll": 0.36; 'ben': 0.38; 'whatever': 0.38; 'called': 0.40; 'more': 0.64; 'between': 0.67; 'mar': 0.68; 'smith': 0.68; 'article': 0.77; 'protect': 0.79; 'write:': 0.91; '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:content-transfer-encoding; bh=GaUwj4JbTwgS6ilW87PnFh4Ack5DYlUGTJP7dJi6R+4=; b=czEFJqgG1ze8qLqsqj1N5vSo0ENW2OX7fj1JJliylrhQtgAf95s+RW1T1gsdzfAkR9 7gKNT2DJJtFmOu8QJqUBXU1BCn8tJF20CiSw1ZZ9iWz/tfJkbjsTfVkybnxFYRMB2VjN 5FUDsUru3dDdne4+LzWw/CS+MaGWJd0ZfVWRGdBQzKK1fuB8HC9C7KaG5JggQbJQzQKS TNVis1yTC1Yawja/D7wxelrlF2JLx6LJa1zRYIBbQKzLZ/7eWBOeeCVwy5WkCP76DzSs opTrhqtdfrn2L+3hGQKbm0ypjsB7GXO18gdg6GTDjaOBaOyRSosd6j8Atemua+TtkdvN in7A== MIME-Version: 1.0 X-Received: by 10.68.197.36 with SMTP id ir4mr22450593pbc.46.1393888168855; Mon, 03 Mar 2014 15:09:28 -0800 (PST) In-Reply-To: References: <53144e8d$0$2149$426a74cc@news.free.fr> <1d1dfa1b-b715-4d8f-9c12-f0d3dc1a22c9@googlegroups.com> <85ppm3httu.fsf@benfinney.id.au> <20140303155112.46e34ff8@bigbox.christie.dr> Date: Tue, 4 Mar 2014 10:09:28 +1100 Subject: Re: Reference From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393888187 news.xs4all.nl 2957 [2001:888:2000:d::a6]:57426 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67616 On Tue, Mar 4, 2014 at 10:02 AM, Roy Smith wrote: > In article , > Ben Finney wrote: > >> That's right. Python provides this singleton and then recommends you >> compare with =E2=80=98is=E2=80=99, precisely to protect against patholog= ical cases like >> a =E2=80=9Creturn True when compared for equality with None=E2=80=9D dat= a type. > > Going off on a tangent, I've often wished Python provided more kinds of > None-ness. I'll often write: > > def f(arg=3DNone): > whatever > > where it would be nice to differentiate between "this was called with no > arguments" and "this was called with an argument of None". That's why you have your own sentinel. _NONE_PASSED=3Dobject() def f(arg=3D_NONE_PASSED): if f is not _NONE_PASSED: pass ChrisA