A small suggestion for Python

David Allen s2mdalle at titan.vcu.edu
Fri Jan 12 16:22:43 EST 2001


In article <93nf0g$amfvv$1 at ID-11957.news.dfncis.de>, "Emile van Sebille"
<emile at fenx.com> wrote:

> If such a thing were to be added, might it also be good to raise an
> exception when not assigning the return value?   If so, perhaps a nothing
> would not object to being a sink hole (ala /dev/null).

I don't know.  It would annoy the hell out of me
if I had to put map() calls that I wasn't using
the result of in a try block.

Say you have a function called "send_file" that
sends a file to some host.  And you have an array
of files.  It's easy to say

map(send_file, myfiles)

and be done with it.  I don't think that should
raise an Exception, do you?

The behavior that the function returns something is
explicit, but that it returns something, and forcing
you to do something about the fact that it returns
something are totally different things.

-- 
David Allen
http://opop.nols.com/
----------------------------------------
Majority, n.: That quality that distinguishes a crime from a law



More information about the Python-list mailing list