hasattr(x, 'foo')
でclass x にfooという属性があるかをTrue, Falseで返す
returns whether class x has attribution foo for True or False