ianaré wrote:
> ....
> files.sort(key=lambda x: x.lower())
> files.sort(key=lambda x: os.path.dirname(x))
This is exactly why some of us hate lambda. It encourages
long-way-around thinking.
files.sort(key=lambda x: os.path.dirname(x))
is better written as:
files.sort(key=os.path.dirname)
Learn to have your skin itch when you see:
... lambda name:<expr>(name)
And yes, I concede that it _is_ useful in your .lower expression.
It's not that lambda is bad, rather that it seems to encourages
this 'lambda x:f(x)' stuff.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list