Re: Mapping None. Why?
- From: "Diez B. Roggisch" <deets@xxxxxxxxxxxxx>
- Date: Thu, 12 Jun 2008 21:55:55 +0200
Ian Kelly schrieb:
On Thu, Jun 12, 2008 at 1:32 PM, Diez B. Roggisch <deets@xxxxxxxxxxxxx> wrote:Because it is undefined what should happen in case of no function given at
all - and because there is no identity function in python pre-defined, it
could be considered sensible to make None the quivalent of that function.
It makes more sense to raise an error when a non-function is passed
where a function is expected. If we're going to have a special
behaviour for None, why not have special behaviours for True, False,
and 42 as well? The proper solution to the lack of a built-in packing
(not identity) function is to define a packing function, not to
special-case an arbitrary value to *mean* the packing function in
certain situations.
You are right with the packing-function, it's not identity of course.
However I don't see that this as an area that is really important (especially since map is being replaced by list-comps most of the time).
And the OP's question was about map not being conforming to the definition on wikipedia - which I don't think it's not. It is not defined what map is to do with None (or NULL or nil or... ) as argument.
Diez
.
- Follow-Ups:
- Re: Mapping None. Why?
- From: Paddy
- Re: Mapping None. Why?
- References:
- Mapping None. Why?
- From: Paddy
- Re: Mapping None. Why?
- From: Diez B. Roggisch
- Re: Mapping None. Why?
- From: Ian Kelly
- Mapping None. Why?
- Prev by Date: Re: Mapping None. Why?
- Next by Date: ANN: eGenix pyOpenSSL Distribution 0.7.0-0.9.8h-1
- Previous by thread: Re: Mapping None. Why?
- Next by thread: Re: Mapping None. Why?
- Index(es):
Relevant Pages
|