◐ Shell
reader mode source ↗

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, gvanrossum
Date 2008-02-25.04:52:15
SpamBayes Score 0.15496226
Marked as misclassified No
Message-id <1203915151.7.0.530941719704.issue2186@psf.upfronthosting.co.za>
In-reply-to
Content
In the absence of an identity function, map accepting None is useful in 
the cases like this:

converters = {..}
y = map(converters.get(c), x)

That will now have to be rewritten as

conv = converters.get(c)
if conv is None:
   y = list(x)
else:
   y = map(conv, x)

and subtle bugs will be introduced if x is used instead of list(x) in 
the None case.

Another alternative,

y = map(converters.get(c, lambda x:x), x)

will be much slower.

Take my opinion with a grain of salt because I also believe None should 
be callable with None(x) -> x and None(x,y,..) -> (x,y,..).
History
Date User Action Args
2008-02-25 04:52:31belopolskysetspambayes_score: 0.154962 -> 0.15496226
recipients: + belopolsky, gvanrossum
2008-02-25 04:52:31belopolskysetspambayes_score: 0.154962 -> 0.154962
messageid: <1203915151.7.0.530941719704.issue2186@psf.upfronthosting.co.za>
2008-02-25 04:52:15belopolskylinkissue2186 messages
2008-02-25 04:52:15belopolskycreate