unittest.TestCase, lambda and __getitem__

Scott David Daniels Scott.Daniels at Acm.Org
Mon Sep 13 21:07:05 CEST 2004


Roy Smith wrote:
>.... I think you need to just create a little function and call it:
> 
> def tryIndex (object, index):
>    return obj [index]

For python 2.4 and beyond, the function is called operator.getitem,
so I'd call it getitem.

-Scott David Daniels
Scott.Daniels at Acm.Org




More information about the Python-list mailing list