{"published":"2018-08-13 22:47:09","author_url":"https://blog.hatena.ne.jp/podhmo/","url":"https://pod.hatenablog.com/entry/2018/08/13/223416","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpod.hatenablog.com%2Fentry%2F2018%2F08%2F13%2F223416\" title=\"functools.partial\u306e\u5143\u3092\u8fbf\u308b - podhmo&#39;s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://pod.hatenablog.com/","categories":["python","memo","functools"],"image_url":null,"blog_title":"podhmo's diary","provider_url":"https://hatena.blog","title":"functools.partial\u306e\u5143\u3092\u8fbf\u308b","height":"190","width":"100%","type":"rich","author_name":"podhmo","description":"\u6642\u6298\u3001functools.partial\u3067\u4f5c\u3089\u308c\u305f\u5024\u306e\u5143\u306e\u5024(\u95a2\u6570)\u3092\u8fbf\u308a\u305f\u304f\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u305d\u306e\u3088\u3046\u306a\u3053\u3068\u3092\u3057\u305f\u304f\u306a\u3063\u305f\u5834\u5408\u306e\u30e1\u30e2\u3002 \u5358\u7d14\u306b\u8fbf\u308a\u305f\u3044\u5834\u5408 \u5358\u7d14\u306b\u8fbf\u308a\u305f\u3044\u5834\u5408\u306f.func\u3092\u898b\u308c\u3070\u826f\u3044\u3002\u3064\u3044\u3067\u306b\u30af\u30e9\u30b9\u3067\u3042\u308b\u5834\u5408\u3082\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3042\u3052\u308b\u3068\u89aa\u5207\u3002 def find_original(fn): if isinstance(fn, partial): fn = fn.func if inspect.isclass(fn): fn = fn.__init__ return fn functools.partial\u306e\u5143\u3092\u8fbf\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002 def f(x, y, *, z): return (x\u2026","version":"1.0","provider_name":"Hatena Blog"}