例如,我有一个可能是None的对象x或一个float的字符串表示。 我想做以下事情: do_stuff_with(float(x) if x else None) 除了不必输入x两次,就像Ruby的andand库一样: require ‘andand’ do_stuff_with(x.andand.to_f)