try:
__if x.has('A') and use :
____foo()
__else:
____bar()
except ValueError:
__bar()

こういうのって例外クラス作ってexceptでまとめて受けたほうがいいですか?
同じ内容のbar()が散乱するのって気になる?