⬅︎ Back to Fastest way to uniqify a list in Python
Because that makes it possible to optionally override what the key should be. Some items aren't hashable. E.g. dicts.
why not? def f5(self, seq, idfun=lambda x : x): and remove: if idfun is None: def idfun(x): return x
Peter - nasgar's merely replacing your identity function plug with an inline lambda in the function def. I think that is valid to do (achieves the same thing), but does look harder to read.
Comment
Because that makes it possible to optionally override what the key should be. Some items aren't hashable. E.g. dicts.
Parent comment
why not? def f5(self, seq, idfun=lambda x : x): and remove: if idfun is None: def idfun(x): return x
Replies
Peter - nasgar's merely replacing your identity function plug with an inline lambda in the function def. I think that is valid to do (achieves the same thing), but does look harder to read.