by wfunction · 9y ago · 0 comments
Too much nonsense in your comment. Really now? How about you give a realistic example where syntactic sugar doesn't substitute for it? Like what am I supposed to pass to sort(key)? And incidentally, this tuple unpacking problem comes up when sorting frequently... and that's the prime example on their web page (and a realistic one at that) for where you're supposed to use lambdas: https://docs.python.org/3/tutorial/controlflow.html#lambda-e... If you're telling me this isn't Pythonic, you're really just not being sensible.
I suggest you look at namedtuple: https://docs.python.org/3/library/collections.html#collectio...
I think you should watch some Raymond Hettinger's talks, he is discussing many little things like this.