class X: def __eq__(self, rhs): return True def __repr__(self): return '' l = ['a', X(), 'c'] print(append(l, 'd')) # => ['a', , 'd'] au lieu de ['a', , 'c', 'd']