None versus MISSING sentinel -- request for design feedback
cs at zip.com.au
Fri Jul 15 12:38:08 CEST 2011
On 15Jul2011 20:17, Steven D'Aprano <steve+comp.lang.python at pearwood.info> 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
Cameron Simpson <cs at zip.com.au> DoD#743
The English language has a word to describe a group of anarcho-collectivists
without resorting to spiffy hyphenated coined phrases: a mob.
- Tim Mefford, <tim at physics.orst.edu>
More information about the Python-list