Jim Jewett wrote:
I'm not convinced, because I've seen so many times when a lambda actually is crucial to the bug.
I think this is just a special case of a more general problem, that a line number is not always a sufficiently fine-grained piece of information when you're trying to pinpoint an error. You can get the same thing even when lambdas are not involved. It's particularly bad when an expression spans more than one line, because CPython currently doesn't even tell you the line containing the error, but the one where the whole statement started. Ideally, the traceback would show you not just the exact line, but the exact *token* where the error occurred. The technology exists to do this, it's just a matter of deciding to incorporate it into Python. -- Greg