[Python-Dev] nodef

Greg Ewing greg.ewing at canterbury.ac.nz
Thu May 24 06:17:55 CEST 2007


Martin Blais wrote:
> I don't know
> what lives in the iterable, so why should I make assumptions?
 >
> I think Python needs a builtin for this very purpose.  I propose
> 'nodef', a unique object whose sole purpose is to serve as a default
> value.

If the aforementioned iterable can yield *anything*,
then it might yield this 'nodef' value as well.

For this reason, there *can't* exist any *standard*
guaranteed-unambiguous sentinel value. Each use
case needs its own, to ensure it's truly unambiguous
in the context of that use case.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list