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!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; 'suppose': 0.05; 'sure.': 0.05; 'received:edu.au': 0.07; 'sanity': 0.07; 'none.': 0.09; 'subject:None': 0.09; 'exception': 0.12; 'wrote:': 0.15; '"right"': 0.16; 'being,': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'missing,': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'subject:design': 0.16; 'subject:versus': 0.16; 'cc:addr:python- list': 0.16; 'say,': 0.19; 'language': 0.20; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'subject: -- ': 0.25; 'raise': 0.28; 'right,': 0.28; 'cc:addr:python.org': 0.30; 'values': 0.31; 'go.': 0.32; 'too': 0.32; 'instead': 0.34; 'header:User-Agent:1': 0.34; 'there': 0.34; 'describe': 0.34; 'none': 0.35; 'explicit': 0.35; 'charset:us- ascii': 0.36; 'data.': 0.36; 'received:au': 0.36; 'unless': 0.37; 'using': 0.37; 'subject:: ': 0.38; 'steven': 0.38; 'data': 0.39; "there's": 0.39; 'easily': 0.61; 'received:202': 0.66; 'cameron': 0.67; 'validate': 0.67; 'special': 0.67 Date: Fri, 15 Jul 2011 20:38:08 +1000 From: Cameron Simpson To: Steven D'Aprano Subject: Re: None versus MISSING sentinel -- request for design feedback MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4e2013c6$0$29983$c3e8da3$5496439d@news.astraweb.com> User-Agent: Mutt/1.5.20 (2009-06-14) References: <4e2013c6$0$29983$c3e8da3$5496439d@news.astraweb.com> 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310726293 news.xs4all.nl 23943 [2001:888:2000:d::a6]:47391 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9534 On 15Jul2011 20:17, Steven D'Aprano wrote: | Cameron Simpson wrote: | > I suppose there's no scope for having the append-to-the-list step sanity | > check for the sentinel (be it None or otherwise)? | | It is not my responsibility to validate data during construction, only to do | the right thing when given that data. The right thing being, raise an | exception if values are not numeric, unless an explicit "missing" value | (whatever that ends up being). Well there you go. You need to use MISSING, not None. As you say, None can easily be a mistake and you want to be sure. If what you describe as "right" is right, then I too would be using a special sentinal instead of None. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ The English language has a word to describe a group of anarcho-collectivists without resorting to spiffy hyphenated coined phrases: a mob. - Tim Mefford,