2013-09-06から1日間の記事一覧
dict_a.update(dict_b)だと、dict_aの値をdict_bの値で上書きしてしまうので、上書きしないでマージする方法を調べてた。 # coding=utf-8 DEFAULT_OPTIONS = {'foo': 1, 'bar': 2} def sample_method(options=None): if not options: options = {} # 入力値…
dict_a.update(dict_b)だと、dict_aの値をdict_bの値で上書きしてしまうので、上書きしないでマージする方法を調べてた。 # coding=utf-8 DEFAULT_OPTIONS = {'foo': 1, 'bar': 2} def sample_method(options=None): if not options: options = {} # 入力値…