Mapping None. Why?

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


"David C. Ullrich" <dullrich at sprynet.com> wrote in message 
news:dullrich-571EC3.12043113062008 at text.giganews.com...
| In article
| <d5897630-558e-428a-9bab-e0c9c1de7ba6 at j22g2000hsf.googlegroups.com>,
| Paddy <paddy3118 at googlemail.com> 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