def index_of_object(alist, obj):
    """Effectively implements list.index(obj) but returns the index of
    the first item in the list that *is* the supplied object (rather than
    comparing values) """
    for idx, body in enumerate(alist):
        if body is obj:
            return idx
    raise Exception('Object {0} not found in list'.format(str(obj)))
