#!/usr/local/bin/python2 class B(object): def __getitem__(key, value): pass class C(B): pass print hasattr(C, '__getiem__')