- 632 名前:デフォルトの名無しさん mailto:sage [2012/02/26(日) 13:55:27.36 ]
- こういうシンプルな書き方ってできないのですか?
for x in a_list if a_condition(x): do_something(x) こう書けるのはわかりますが、filter とか lambda とか面倒で気に入らない for x in filter(lambda x: a_condition(x), a_list): do_something(x) こう書けるのもわかりますが、無駄に冗長でウンコ臭い for x in [x for x in a_list if a_condition(x)]: do_something(x)
|

|