<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yuheiomori0718</author_name>
  <author_url>https://blog.hatena.ne.jp/yuheiomori0718/</author_url>
  <blog_title>メモ置き場</blog_title>
  <blog_url>https://y0m0r.hateblo.jp/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>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 = {} # 入力値を上書きしてしまう # options.update(default_options) # 入力値に不足があればdefault値を設定する options = dict(DEFAULT_OPTIONS.item…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fy0m0r.hateblo.jp%2Fentry%2F20130906%2F1378478382&quot; title=&quot;Pythonで上書きせずに辞書をマージする - メモ置き場&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-09-06 23:39:42</published>
  <title>Pythonで上書きせずに辞書をマージする</title>
  <type>rich</type>
  <url>https://y0m0r.hateblo.jp/entry/20130906/1378478382</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
