Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #9664
| Date | 2011-07-16 17:31 -0700 |
|---|---|
| From | Ethan Furman <ethan@stoneleaf.us> |
| Subject | Re: None versus MISSING sentinel -- request for design feedback |
| References | (3 earlier) <mailman.1060.1310727853.1164.python-list@python.org> <4e203706$0$29972$c3e8da3$5496439d@news.astraweb.com> <ivpeip$l9$1@speranza.aioe.org> <mailman.1071.1310749444.1164.python-list@python.org> <98cb2oF3vpU1@mid.individual.net> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1146.1310862722.1164.python-list@python.org> (permalink) |
Gregory Ewing wrote: > Ethan Furman wrote: >> some of the return values (Logical, Date, DateTime, and probably >> Character) will have their own dedicated singletons (Null, NullDate, >> NullDateTime, NullChar -- which will all compare equal to None) > > That doesn't seem like a good idea to me. It's common practice > to use 'is' rather than '==' when comparing things to None. > > Why do you want to use special null values for these types? Okay, after spending some time thinking about this question I don't believe I have a good answer. I think it was probably something I thought of back when I started this project (which is basically what I learned Python on) and I've since learned enough that whatever reason I had back then has been replaced with more thorough knowledge and better practices. The best reason I have at this point is being able to know what the Null value is supposed to represent -- True/False, a Date, etc. -- however, even that is weakened by my decision to use None for Null in the case of Character and Numerics; so there is probably no reason to not use None in the case of Logicals, Dates, DateTimes, and Times. Thank you for the question! ~Ethan~
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
None versus MISSING sentinel -- request for design feedback Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-15 15:28 +1000
Re: None versus MISSING sentinel -- request for design feedback Chris Angelico <rosuav@gmail.com> - 2011-07-15 16:08 +1000
Re: None versus MISSING sentinel -- request for design feedback "bruno.desthuilliers@gmail.com" <bruno.desthuilliers@gmail.com> - 2011-07-15 00:53 -0700
Re: None versus MISSING sentinel -- request for design feedback Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-15 20:46 +1000
Re: None versus MISSING sentinel -- request for design feedback Chris Angelico <rosuav@gmail.com> - 2011-07-15 21:04 +1000
Re: None versus MISSING sentinel -- request for design feedback Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-15 22:48 +1000
Re: None versus MISSING sentinel -- request for design feedback Mel <mwilson@the-wire.com> - 2011-07-15 09:16 -0400
Re: None versus MISSING sentinel -- request for design feedback Ethan Furman <ethan@stoneleaf.us> - 2011-07-15 10:18 -0700
Re: None versus MISSING sentinel -- request for design feedback Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-16 14:24 +1200
Re: None versus MISSING sentinel -- request for design feedback Ethan Furman <ethan@stoneleaf.us> - 2011-07-16 17:31 -0700
Re: None versus MISSING sentinel -- request for design feedback Rob Williscroft <rtw@rtw.me.uk> - 2011-07-15 07:43 +0000
Re: None versus MISSING sentinel -- request for design feedback Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-15 20:19 +1000
Re: None versus MISSING sentinel -- request for design feedback "OKB (not okblacke)" <brenNOSPAMbarn@NObrenSPAMbarn.net> - 2011-07-15 17:40 +0000
Re: None versus MISSING sentinel -- request for design feedback Terry Reedy <tjreedy@udel.edu> - 2011-07-15 17:35 -0400
Re: None versus MISSING sentinel -- request for design feedback Cameron Simpson <cs@zip.com.au> - 2011-07-15 17:44 +1000
Re: None versus MISSING sentinel -- request for design feedback "bruno.desthuilliers@gmail.com" <bruno.desthuilliers@gmail.com> - 2011-07-15 02:58 -0700
Re: None versus MISSING sentinel -- request for design feedback Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-15 20:17 +1000
Re: None versus MISSING sentinel -- request for design feedback Cameron Simpson <cs@zip.com.au> - 2011-07-15 20:38 +1000
Re: None versus MISSING sentinel -- request for design feedback "bruno.desthuilliers@gmail.com" <bruno.desthuilliers@gmail.com> - 2011-07-15 00:59 -0700
Re: None versus MISSING sentinel -- request for design feedback Teemu Likonen <tlikonen@iki.fi> - 2011-07-15 11:28 +0300
Re: None versus MISSING sentinel -- request for design feedback "bruno.desthuilliers@gmail.com" <bruno.desthuilliers@gmail.com> - 2011-07-15 03:02 -0700
Re: None versus MISSING sentinel -- request for design feedback Teemu Likonen <tlikonen@iki.fi> - 2011-07-15 13:56 +0300
Re: None versus MISSING sentinel -- request for design feedback Eric Snow <ericsnowcurrently@gmail.com> - 2011-07-15 11:02 -0600
csiph-web