[Python-ideas] a identity function?
benjamin at python.org
Mon Mar 23 01:13:26 CET 2009
I've found as I write more and more decorators I need an identity function
often. For example I might write:
if reason == "good reason":
return lambda x: x
# do fancy stuff here
I hate lambdas, so usually I write
It'd be nice to have a shortcut in the stdlib, though. Would this go well in the
operator or functools modules well?
More information about the Python-ideas