Using isA and getA in a python way

C Gillespie csgcsg39 at
Mon Sep 20 14:31:44 CEST 2004

Dear All,

I have long list of if statements in the form of:

if obj.isA(): return obj.getA()
if obj.isB(): return obj.getB()
if obj.isC(): return obj.getC()
if obj.isD(): return obj.getD()

Is there a nicer way of doing this, perhap going through the list

Many thanks


More information about the Python-list mailing list