Real-world use cases for map's None fill-in feature?

Aahz aahz at pythoncraft.com
Thu Jan 12 19:31:52 EST 2006


In article <mailman.194.1136781640.27775.python-list at python.org>,
Raymond Hettinger <python at rcn.com> wrote:
>
>Request for more information
>----------------------------
>My request for readers of comp.lang.python is to search your own code
>to see if map's None fill-in feature was ever used in real-world code
>(not toy examples).  I'm curious about the context, how it was used,
>and what alternatives were rejected (i.e. did the fill-in feature
>improve the code).  Likewise, I'm curious as to whether anyone has seen
>a zip-style fill-in feature employed to good effect in some other
>programming language.

I've counted 63 cases of ``map(None, ...`` in my company's code base.
You're probably right that most of them could/should use zip() instead;
I see at least a few cases of

    map(None, field_names, values)

but it's not clear what the expectation is for the size of the two lists.
(None of the uses were created by me -- I abhor map(). ;-)
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"19. A language that doesn't affect the way you think about programming,
is not worth knowing."  --Alan Perlis



More information about the Python-list mailing list