<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>saruhei1989</author_name>
  <author_url>https://blog.hatena.ne.jp/saruhei1989/</author_url>
  <blog_title>さるへい備忘録</blog_title>
  <blog_url>https://saruhei1989.hatenablog.com/</blog_url>
  <categories>
    <anon>python</anon>
    <anon>プログラミング</anon>
  </categories>
  <description>Pythonの関数定義に欠かせないデフォルト引数ですが、とある罠にひっかかったので備忘録として残しておきます。 まずは、以下のようなコードを用意します # coding: utf-8 import datetime import time def arg_test(message: str, now=datetime.datetime.now()): print(message) print(now) if __name__ == &quot;__main__&quot;: arg_test('デフォルト引数利用1') arg_test('デフォルト引数非利用1', datetime.datetime.now()…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsaruhei1989.hatenablog.com%2Fentry%2F2021%2F12%2F15%2F150205&quot; title=&quot;デフォルト引数に関数を使う場合の注意点 - さるへい備忘録&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>2021-12-15 15:02:05</published>
  <title>デフォルト引数に関数を使う場合の注意点</title>
  <type>rich</type>
  <url>https://saruhei1989.hatenablog.com/entry/2021/12/15/150205</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
