ex: 辞書の中で、valueのtypeがDecimalの場合のみintに変換する
from decimal import Decimal
before = {'a': Decimal(100), 'b':20, 'c':'cccc', 'd': Decimal(200)}
after = dict([(k, int(v) if type(v) is Decimal else v) for k,v in before.items()])
print(after)
# {'a': 100, 'd': 200, 'c': 'cccc', 'b': 20}
最初にkey,valueのタプルにしてから、変換して再度dictに戻している。
走査関数でもっとどうにかできないものか。