On 1/14/2010 12:44 PM, D'Arcy J.M. Cain wrote:
On Thu, 14 Jan 2010 09:07:47 -0800
Chris Rebert<c...@rebertia.com>  wrote:
Even more succinctly:

def ishex(s):
     return all(c in string.hexdigits for c in s)

I'll see your two-liner and raise you.  :-)

ishex = lambda s: all(c in string.hexdigits for c in s)

This is inferior because the resulting function object has generic name attribute '<lambda>' instead of the specific name 'ishax'.

Please do not push such inferior code on new programmers.

Terry Jan Reedy


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to