Mapping None. Why?

Terry Reedy tjreedy at
Fri Jun 13 22:00:14 CEST 2008

"David C. Ullrich" <dullrich at> wrote in message 
news:dullrich-571EC3.12043113062008 at
| In article
| <d5897630-558e-428a-9bab-e0c9c1de7ba6 at>,
| Paddy <paddy3118 at> 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 why
| the way map works makes sense.

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. 

More information about the Python-list mailing list