On 07/28/2010 04:15 PM, wheres pythonmonks wrote:

f( *map(lambda x: int(x), struct.unpack('2s2s2s','123456')))
102

But this seems too complicated.


Well, you don't need the lambda at all
int   ===    lambda x: int(x)

So just write

It's like writing:
def myint(x):
    return int(x)


Nick,

Warm thanks to Steven D' Aprano who taught me that just yesterday in the Tutor list ;)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to