Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:verizon.net': 0.07; 'terry': 0.07; 'caller': 0.09; 'default.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:None': 0.09; 'api': 0.11; 'am,': 0.13; 'packages.': 0.13; 'wrote:': 0.15; 'reedy': 0.16; 'remember.': 0.16; 'sequence,': 0.16; 'subject:design': 0.16; 'subject:versus': 0.16; 'def': 0.16; 'that?': 0.19; 'jan': 0.19; 'column': 0.22; 'header:In-Reply- To:1': 0.22; 'specify': 0.25; 'subject: -- ': 0.25; 'specified': 0.25; 'separately': 0.30; 'values': 0.31; 'to:addr:python-list': 0.34; 'header:X-Complaints-To:1': 0.34; 'header:User-Agent:1': 0.34; 'none': 0.35; 'module.': 0.35; 'could': 0.37; 'received:org': 0.38; 'subject:: ': 0.38; 'steven': 0.38; 'think': 0.38; 'header:Mime-Version:1': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; 'missing': 0.40; 'your': 0.60; 'special': 0.67 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: None versus MISSING sentinel -- request for design feedback Date: Fri, 15 Jul 2011 17:35:29 -0400 References: <4e1fd009$0$29986$c3e8da3$5496439d@news.astraweb.com> <4e201439$0$29983$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 In-Reply-To: <4e201439$0$29983$c3e8da3$5496439d@news.astraweb.com> 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310765743 news.xs4all.nl 23861 [2001:888:2000:d::a6]:60182 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9572 On 7/15/2011 6:19 AM, Steven D'Aprano wrote: Use None as default. Requiring users to use your special value would be a nuisance. They may have data prepared separately from your module. > Rob Williscroft wrote: >> MISSING = MissingObject() >> def mean( sequence, missing = MISSING ): This is also a good idea. > So you think the right API is to allow the caller to specify what counts as > a missing value at runtime? Are you aware of any other statistics packages > that do that? AFAIK, standard feature on major packages. BMDP, SAS and SPSS as I remember. Missing values could be specified on a per column basis. -- Terry Jan Reedy