[Tutor] map, filter and lambda functions

Remco Gerlich scarblac@pino.selwerd.nl
Thu, 23 Aug 2001 11:03:55 +0200


On  0, Sheila King <sheila@thinkspot.net> wrote:
> Ah, thanks. That's what I was missing. It certainly wasn't clear to me
> from anything that I had read, that it was supposed to be a function
> OBJECT as opposed to a function invocation.

If you give a function invocation as an argument, like say:

somefunc(otherfunc(x), y)

What happens is that otherfunc(x) is called, and its *result* is passed to
somefunc. That's true for all Python expressions, and therefore for map() as
well.

Map() needs to have some object it can call, usually a function object, it
can fill in the arguments by itself. It couldn't do much with only the
result for some x.

-- 
Remco Gerlich