[Python-3000] Special object to return from functions that return only None

Kevin Jacobs <jacobs@bioinformed.com> bioinformed at gmail.com
Tue Apr 25 15:07:02 CEST 2006


On 4/19/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>
> Edward C. Jones wrote:
>
> > I suggest a singleton object "UseForbidden" ("Py_UseForbidden" in C).
>
> It should be called "Mu". :-)
>
> Although such an object could cause a lot of pain to
> debuggers and other such introspective code.
>

Actually this sounds a lot like a signaling Not-a-number (sNaN) from
IEEE754.  One can pass around a sNaN, but any use will raise a (numeric)
exception.  Similarly, you want a signaling Not-an-Object (sNaO) that also
doesn't like to be passed as a function argument.  It is the last bit that
makes it a pain, since what if your function is log_error_value(sNaO)?

-Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20060425/640395bb/attachment.htm 


More information about the Python-3000 mailing list