class MyClass: def method(self, i): if i is 5: print 'five' elif not (i is 2): print 'not two' else: print '2'