On Fri, 2005-03-11 at 12:18, Raymond Hettinger wrote: > I suspect that lambda will be the only bone of contention. The reduce() > function can be moved to the functional module. The map() and filter() > functions are already covered by the itertools module.
I'm fine seeing reduce() eventually go; I've used it maybe a handful of times in all my years of Python. Using a list comprehension instead of map() is fine too, but I'll miss the filter(None, seq) idiom. Ping's suggested list comprehension abbreviation, i.e.: [x in seq if x] == [x for x in seq if x] might help. > Lambda will be more difficult. Eric Raymond adapted an anti-gun control > slogan and said "you can pry lambda out of my cold dead hands." A bunch > of folks will sorely miss the ability to create anonymous functions on > the fly. When lambda is used for deferred argument evaluation (a la PEP > 312), the def syntax is a crummy substitute. Yeah, I'm with you here. As warty as lambda is, it just is so damn convenient some times. I've recently been using it as a companion to property(), providing concise definitions of read-only attributes. -Barry
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
