On Thu, 12 Jun 2008 12:05:02 -0700 (PDT), Paddy
[EMAIL PROTECTED] wrote:
Iam wondering why the peculiar behavior of map when the function in
given as None:
If you start with a value x and then apply no function
at all to it, what results is x.
Help on built-in function map in module
On Jun 13, 12:49 pm, David C. Ullrich [EMAIL PROTECTED] wrote:
On Thu, 12 Jun 2008 12:05:02 -0700 (PDT), Paddy
[EMAIL PROTECTED] wrote:
Iam wondering why the peculiar behavior of map when the function in
given as None:
If you start with a value x and then apply no function
at all to it,
In article
[EMAIL PROTECTED],
Paddy [EMAIL PROTECTED] wrote:
On Jun 13, 12:49 pm, David C. Ullrich [EMAIL PROTECTED] wrote:
On Thu, 12 Jun 2008 12:05:02 -0700 (PDT), Paddy
[EMAIL PROTECTED] wrote:
Iam wondering why the peculiar behavior of map when the function in
given as None:
David C. Ullrich [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| In article
| [EMAIL PROTECTED],
| Paddy [EMAIL PROTECTED] wrote:
|
| True, but None is not a function. It's a sentinel value to turn on the
| functionality.
|
| Uh, thanks. I think I knew that - I was just suggesting
On Fri, Jun 13, 2008 at 2:00 PM, Terry Reedy [EMAIL PROTECTED] wrote:
filter(None, iterable) works the same way: None- identity function,
The immediate reason is the Python has no builtin id().
But apparently there is also historical precedent in the functional
community for this convention.
Iam wondering why the peculiar behavior of map when the function in
given as None:
Help on built-in function map in module __builtin__:
map(...)
map(function, sequence[, sequence, ...]) - list
Return a list of the results of applying the function to the items
of
the argument
Paddy schrieb:
Iam wondering why the peculiar behavior of map when the function in
given as None:
Help on built-in function map in module __builtin__:
map(...)
map(function, sequence[, sequence, ...]) - list
Return a list of the results of applying the function to the items
of
the
On Thu, Jun 12, 2008 at 1:05 PM, Paddy [EMAIL PROTECTED] wrote:
Iam wondering why the peculiar behavior of map when the function in
given as None:
Because that's the way it's always been! Seriously, I don't know. I
can tell you that it's going away in Python 3.0, though.
Ian
--
On Thu, Jun 12, 2008 at 1:32 PM, Diez B. Roggisch [EMAIL PROTECTED] 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
Ian Kelly wrote:
On Thu, Jun 12, 2008 at 1:05 PM, Paddy [EMAIL PROTECTED] wrote:
Iam wondering why the peculiar behavior of map when the function in
given as None:
Because that's the way it's always been! Seriously, I don't know. I
can tell you that it's going away in Python 3.0, though.
Ian Kelly schrieb:
On Thu, Jun 12, 2008 at 1:32 PM, Diez B. Roggisch [EMAIL PROTECTED] 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
Paddy [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
|
| Iam wondering why the peculiar behavior of map when the function in
| given as None:
The 'peculiar behavior' is the same as zip (except for padding short
iterators versus truncating long iterators. Map was added years before
Paddy wrote:
On looking up map on Wikipedia there is no mention of this special
behaviour,
So my question is why?
My question is why you are looking up the semantics of Python functions on
Wikipedia instead of the Python documentation. I don't see any particular
discussion of map() there at
On Jun 12, 8:55 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
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
Oh no!
Sorry to give
On Jun 12, 9:48 pm, Robert Kern [EMAIL PROTECTED] wrote:
Paddy wrote:
On looking up map on Wikipedia there is no mention of this special
behaviour,
So my question is why?
My question is why you are looking up the semantics of Python functions on
Wikipedia instead of the Python
On Jun 12, 9:36 pm, Terry Reedy [EMAIL PROTECTED] wrote:
Paddy [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
|
| Iam wondering why the peculiar behavior of map when the function in
| given as None:
The 'peculiar behavior' is the same as zip (except for padding short
iterators
16 matches
Mail list logo