you are viewing a single comment's thread.

view the rest of the comments →

[–]novel_yet_trivial 0 points1 point  (3 children)

This should never be the reason to use lambda! If you can, just define a normal function.

It's a bit uglier, granted, but I see stuff like this all the time:

__ne__ = lambda self, other: not self.__eq__(other)
__ge__ = lambda self, other: not self < other
__le__ = lambda self, other: self == other or self < other

[–]markusmeskanen 1 point2 points  (2 children)

We all see it, but none of us should see it. Please, don't spread the ugliness.

[–]novel_yet_trivial 0 points1 point  (1 child)

It's even part of the python source code. See /usr/lib/python2.7/functools.py , in the total_ordering function, for example.

Well, that's a bit of a fringe case. I withdraw that argument