unittest.TestCase, lambda and __getitem__

Scott David Daniels Scott.Daniels at Acm.Org
Mon Sep 13 15:07:05 EDT 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