Newbies: Re: Returning none

Michael Hudson mwh21 at cam.ac.uk
Fri Sep 3 13:24:49 EDT 1999


"Evan Simpson" <evan at tokenexchange.com> writes:

> Michael Hudson <mwh21 at cam.ac.uk> wrote in message
> news:Pine.LNX.4.10.9909031629210.21765-100000 at atrus.jesus.cam.ac.uk...
> > Got bored.
> [and implemented the whole damn thing!]
> 
> Wow.  That looks ... remarkably painless.

That's why I did it. Hacking the source to Python can be almost as
much fun as hacking Python. If only all C code in the world was
written by Guido.

>  Why don't you think it's a good idea?

Because it would annoy me. It adds a complication to Python's simple
conceptual model that, as John Skaller eloquently explained, is one of
it's main attractions.

Another problem is that given a "callable object" `f', there is no way
to check whether it returns Nothing other than by try:-ing it; and that
sucks, IMHO. You can't even compare it; 

if f() == Nothing:

raises TypeError. 

Perhaps the test at the end of the CALL_FUNCTION should be extended to
allow COMPARE_OP. But that's inconsistent; there's no satisfactory
resolution IMHO, so I vote for the status quo.

I-feel-this-proposal-is-unlikely-to-be-accepted-ly y'rs
Michael




More information about the Python-list mailing list