<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>fgshun</author_name>
  <author_url>https://blog.hatena.ne.jp/fgshun/</author_url>
  <blog_title>銀月の符号</blog_title>
  <blog_url>https://fgshun.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>関数に与えられた引数の名前を調べる を読んで。 func_code の存在を思い出していました。そして、この方法だと * 引数、 ** 引数の名前が取り出せないので追加を。 inspect モジュールの出番 結論から。inspect.getargspec で得られます。行われているのは func_code らのより丁寧な調査です。 inspect.getargspec を使うとデフォルト値まで取り出せるおまけがついてきます。 &gt;&gt;&gt; def sample2(self, arg0, arg1=None, *args, **kwargs): ... local0 = None ... local1…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffgshun.hatenablog.com%2Fentry%2F20090402%2F1238641319&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>2009-04-02 12:01:59</published>
  <title>関数に与えられた * 引数、 ** 引数の名前も調べる</title>
  <type>rich</type>
  <url>https://fgshun.hatenablog.com/entry/20090402/1238641319</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
