Comment

nasgar

why not?
def f5(self, seq, idfun=lambda x : x):

and remove:

  if idfun is None:
       def idfun(x): return x

Replies

Peter Bengtsson

Because that makes it possible to optionally override what the key should be. Some items aren't hashable. E.g. dicts.

Harsh

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.