[OFFTOPIC] Maps and functions (was Re: Apply a function to each list member?)

Charles G Waldman cgw at fnal.gov
Fri Nov 5 07:38:59 EST 1999

Malcolm Tredinnick writes:
 > Correct. In fact, since we're being precise, let me point out that
 > (mathematically speaking), all functions are maps (or mappings), but not
 > all mappings are functions. The point is that a function should have only a
 > single "output" for any given input (i.e. it should be many-to-one or
 > one-to-one, not one-to-many). So some mapping that sends, say, the number 2
 > to the numbers 3 and 4 is not a function (but a mapping that sends both the
 > numbers 3 and 4 to the number 2 is a function, since for each input there
 > is only a single output).

Hmm... what kind of "map" are you thinking of that could send 2 to
"both 3 and 4"?  I think such a thing is not a mapping, at least not
according to any definition of "map" that I've ever seen.  If you
look, for instance, in any basic topology text, you will see that
"map" and "function" mean exactly the same thing, when used as nouns.
"Map" also has a sense as a transitive verb, which means "to apply a
function to", which is where the Python/functional programming usage
comes from.

More information about the Python-list mailing list