filter()ing a dict

Carl Banks imbosol at aerojockey.com
Thu Aug 7 18:07:08 EDT 2003


Robin Cull wrote:
> My question is, does anybody else think that when calling filter(f,
> dict), it should return a dict of the keys and values of the former
> dict where the values satisfy the conditions defined by f()?


Why shouldn't filter apply to the keys?  You want it to apply to
values, but don't you think someone else might want it for the keys?
Who's to say what it should be?  Better to just leave it take care of
sequences.


-- 
CARL BANKS
"You don't run Microsoft Windows.  Microsoft Windows runs you."




More information about the Python-list mailing list