{"id":240,"date":"2019-01-09T19:52:32","date_gmt":"2019-01-09T10:52:32","guid":{"rendered":"http:\/\/idealive.jp\/blog\/?p=240"},"modified":"2019-01-28T18:47:54","modified_gmt":"2019-01-28T09:47:54","slug":"%e7%a6%85%e3%81%ae%e4%b8%96%e7%95%8c","status":"publish","type":"post","link":"https:\/\/idealive.jp\/blog\/2019\/01\/09\/%e7%a6%85%e3%81%ae%e4%b8%96%e7%95%8c\/","title":{"rendered":"\u7985\u306e\u4e16\u754c"},"content":{"rendered":"<p>\u3069\u3046\u3082\u3053\u3093\u306b\u3061\u306f\u3002<\/p>\n<p>\u7985\u306e\u4e16\u754c\u306e\u8a71\u3067\u3059\u3002\u305f\u3060\u3057\u3001Python\u306e\u3001\u3067\u3059\u304c\u3002<\/p>\n<hr \/>\n<blockquote><p>\u306f\u3058\u3081\u306b\u3001\u3053\u306e\u8a18\u4e8b\u3092\u57f7\u7b46\u3059\u308b\u306b\u3042\u305f\u308a\u3001\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002<br \/>\n<a href=\"https:\/\/web.archive.org\/web\/20140526061824\/http:\/\/stackoverflow.com\/questions\/228181\/the-zen-of-python\">stackoverflow The Zen of Python[closed]<\/a><br \/>\n<a href=\"http:\/\/d.hatena.ne.jp\/gumilab\/20120229\/1330479257\">\u6211\u3005\u306fPython\u306b\u4f55\u3092\u6c42\u3081\u3066\u3044\u308b\u304b\uff1f<\/a><br \/>\n<a href=\"https:\/\/qiita.com\/IshitaTakeshi\/items\/e4145921c8dbf7ba57ef\">\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u6301\u3064\u3079\u304d\u5fc3\u69cb\u3048 (The Zen of Python)<\/a><\/p><\/blockquote>\n<hr \/>\n<p>\u3055\u3066\u3001\u672c\u984c\u3002<\/p>\n<p>\u3054\u5b58\u77e5\u306e\u901a\u308a\u3001Python\u306e\u57fa\u672c\u7684\u306a\u601d\u60f3\u3068\u3057\u3066\u3001<a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0020\/\" target=\"_blank\" rel=\"noopener\">Zen of Python<\/a>\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nPython\u306b\u9650\u3089\u305a\u3001\u5168\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u610f\u8b58\u3059\u3079\u304d\u5185\u5bb9\u3001\u3068\u8a00\u3063\u3066\u3082\u5dee\u3057\u652f\u3048\u306a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001Python\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u4e0a\u3067<\/p>\n<p><code>&gt;&gt;&gt;\u00a0import this<\/code><\/p>\n<p>\u3068\u5165\u529b\u3059\u308b\u3060\u3051\u3067\u3001\u305d\u306e\u5185\u5bb9\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u300c\u304a\u307e\u3048\u3055\u3093\u3001\u3053\u308c\u77e5\u3063\u3066\u308b\u304b\u3044\uff1f\u77e5\u3089\u306a\u304d\u3083\u30e2\u30b0\u308a\u3060\u305c\uff1f\u300d\u3068\u8a00\u308f\u308c\u3066\u3044\u308b\u307f\u305f\u3044\u3067\u3059\u306d\u3002<br \/>\n\u306a\u3093\u3060\u304b\u3061\u3087\u3063\u3068\u30aa\u30b5\u30ec\uff08\u7570\u8ad6\u306f\u53d7\u3051\u3064\u3051\u307e\u305b\u3093\uff09\u3002<\/p>\n<p>\u5185\u5bb9\u3092\u601d\u3046\u307e\u307e\u306b\u8a33\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3082\u306e\u3059\u3054\u304f\u500b\u4eba\u7684\u306a\u898b\u89e3\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul style=\"list-style-type: disc\">\n<li>Beautiful is better than ugly.<br \/>\n<code>\u3088\u308a\u7f8e\u3057\u304f<\/code><\/li>\n<li>Explicit is better than implicit.<br \/>\n<code>\u3088\u308a\u660e\u793a\u7684\u306b<\/code><\/li>\n<li>Simple is better than complex.<br \/>\n<code>\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u306b<\/code><\/li>\n<li>Complex is better than complicated.<br \/>\n<code>\u3067\u3082\u3001\u3084\u3084\u3053\u3057\u304f\u306a\u308b\u304f\u3089\u3044\u306a\u3089\u306a\u8907\u96d1\u306a\u65b9\u304c\u30de\u30b7<\/code><\/li>\n<li>Flat is better than nested.<br \/>\n<code>\u30cd\u30b9\u30c8\u306a\u3093\u304b\u30af\u30bd\u304f\u3089\u3048<\/code><\/li>\n<li>Sparse is better than dense.<br \/>\n<code>\u8a70\u3081\u3059\u304e\u306a\u3044<\/code><\/li>\n<li>Readability counts.<br \/>\n<code>\u8aad\u307f\u3084\u3059\u3055\u306f\u6b63\u7fa9\u3060<\/code><\/li>\n<li>Special cases aren&#8217;t special enough to break the rules.<br \/>\n<code>\u3069\u3093\u306a\u306b\u7279\u6b8a\u306a\u3053\u3068\u3082\u3001\u30eb\u30fc\u30eb\u3092\u7834\u308b\u7406\u7531\u306b\u306f\u306a\u3089\u306a\u3044<\/code><\/li>\n<li>Although practicality beats purity.<br \/>\n<code>\u3067\u3082\u3001\u305d\u3046\u3082\u8a00\u3063\u3066\u3089\u308c\u306a\u3044\u73fe\u5b9f\u3082\u3042\u308b<\/code><\/li>\n<li>Errors should never pass silently.<br \/>\n<code>\u30a8\u30e9\u30fc\u306f\u96a0\u3059\u306a<\/code><\/li>\n<li>Unless explicitly silenced.<br \/>\n<code>\u3067\u3082\u3001\u308f\u3056\u3068\u96a0\u308c\u3066\u3044\u308b\u3082\u306e\u306f\u3001\u898b\u3066\u898b\u306c\u3075\u308a\u3057\u3066\u3044\u3044<\/code><\/li>\n<li>In the face of ambiguity, refuse the temptation to guess.<br \/>\n<code>\u3042\u3044\u307e\u3044\u306a\u3082\u306e\u3092\u9069\u5f53\u306b\u63a8\u6e2c\u3059\u308b\u306a<\/code><\/li>\n<li>There should be one&#8211; and preferably only one &#8211;obvious way to do it.<br \/>\n<code>\u771f\u5b9f\uff08\uff1d\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e\u65b9\u6cd5\uff09\u306f\u3044\u3064\u3082\u3072\u3068\u3064\uff01<\/code><\/li>\n<li>Although that way may not be obvious at first unless you&#8217;re Dutch.<br \/>\n<code>\u3067\u3082\u3001\u305d\u308c\u306f <span style=\"text-decoration: line-through\">\u540d\u63a2\u5075<\/span>\u00a0\u30aa\u30e9\u30f3\u30c0\u4eba\u306b\u3057\u304b\u7406\u89e3\u3067\u304d\u306a\u3044\u304b\u3082<\/code><\/li>\n<li>Now is better than never.<br \/>\n<code>\u3044\u3064\u3084\u308b\u306e\uff1f\u4eca\u3067\u3057\u3087\u3063\uff1f<\/code><\/li>\n<li>Although never is often better than *right* now.<br \/>\n<code>\u3067\u3082\u3001\u4eca\u300c\u3059\u3050\u300d\u3058\u3083\u306a\u3044\u65b9\u304c\u3044\u3044\u3053\u3068\u3082<\/code><\/li>\n<li>If the implementation is hard to explain, it&#8217;s a bad idea.<br \/>\n<code>\u8aac\u660e\u3067\u304d\u306a\u3044\u30b3\u30fc\u30c9\uff1f\u30af\u30bd\u304f\u3089\u3048<\/code><\/li>\n<li>If the implementation is easy to explain, it may be a good idea.<br \/>\n<code>\u8aac\u660e\u3067\u304d\u308b\u30b3\u30fc\u30c9\u3092\u6301\u3063\u3066\u3053\u3044<\/code><\/li>\n<li>Namespaces are one honking great idea &#8212; let&#8217;s do more of those!<br \/>\n<code>\u3059\u3070\u3089\u3057\u3044\u30a2\u30a4\u30c7\u30a2\u306f\u7a4d\u6975\u7684\u306b\u4f7f\u304a\u3046\uff01\u540d\u524d\u7a7a\u9593\u306e\u3088\u3046\u306a\u3001\u306d<\/code><\/li>\n<\/ul>\n<p>\u3069\u3063\u3061\u3084\u306d\u3093\uff01\u7684\u306a\u8868\u73fe\u3082\u591a\u3044\u3067\u3059\u304c\u3001\u7d0d\u5f97\u3067\u304d\u308b\u5185\u5bb9\u3067\u3059\u3002<br \/>\n\u3053\u3046\u3044\u3046\u306e\u3001\u5404\u4f01\u696d\u3055\u3093\u306e\u65b0\u4eba\u6559\u80b2\u7684\u306a\u3068\u3053\u308d\u3067\u53e9\u304d\u8fbc\u3093\u3067\u3082\u3044\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3059\u304b\u306d\uff1f<\/p>\n<p>\u5404\u6587\u306e\u5f8c\u308d\u306b\u96a0\u3055\u308c\u3066\u3044\u308b\u610f\u5473\u5408\u3044\u307f\u305f\u3044\u306a\u3082\u306e\u306f\u3001<br \/>\n\u57f7\u7b46\u306b\u3042\u305f\u308a\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u305f\u8a18\u4e8b\u3092\u3054\u53c2\u7167\u3044\u305f\u3060\u304f\u3082\u306e\u3068\u3057\u3066\u3001<br \/>\n\u79c1\u304c\u8a9e\u308a\u305f\u304b\u3063\u305f\u3053\u3068\u3092\u5c11\u3005\u3002<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u3063\u3066\u3001\u4eba\u9593\u304c\u4f5c\u308b\u3082\u306e\u3067\u3001<br \/>\n\u4eba\u9593\u306f\u4eba\u305d\u308c\u305e\u308c\u500b\u6027\u304c\u3042\u308a\u3001\u7d4c\u9a13\u3084\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3082\u9055\u3046\u3057<br \/>\n\u8003\u3048\u3001\u3053\u3060\u308f\u308a\u306a\u3093\u3066\u3082\u306e\u3082\u9055\u3063\u3066\u5f53\u7136\u3002<br \/>\n\u4f5c\u308a\u4e0a\u3052\u3089\u308c\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3060\u3063\u3066\u9055\u3063\u3066\u304f\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3067\u3082\u3001\u5404\u30d7\u30ed\u30b0\u30e9\u30de\u306e\u81ea\u6211\u306e\u90e8\u5206\u3092\u6975\u529b\u6291\u3048\u3066\u3001<br \/>\n\u306a\u308b\u3079\u304f\u307f\u3093\u306a\u540c\u3058\u65b9\u5411\u306b\u5411\u304b\u3063\u3066\u3044\u3053\u3046\u305c\u3001\u3068\u3044\u3046\u306e\u304c<br \/>\nPython\u306e\u601d\u60f3\u3067\u3042\u308a\u3001\u7406\u60f3\u5f62\u306a\u3093\u3060\u3068\u79c1\u306f\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u300czen of python = Python\u306e\u7985\u300d\u306a\u3093\u3066\u4ef0\u3005\u3057\u3044\u30bf\u30a4\u30c8\u30eb\u3064\u3051\u305f\u306a\u3001<br \/>\n\u3068\u521d\u3081\u306f\u601d\u3063\u3066\u307e\u3057\u305f\u3002\u3067\u3082\u3001\u3088\u304f\u3088\u304f\u8003\u3048\u308b\u3068\u3001\u7985\u306e\u4e16\u754c\u306f\u3001<\/p>\n<ul style=\"list-style-type: disc\">\n<li>\u6975\u529b\u81ea\u5206\u306e\u610f\u5fd7\u3092\u6291\u3048\u8fbc\u307f<\/li>\n<li>\u305f\u3060\u4e00\u3064\u306e\u3053\u3068\u306b\u5411\u304d\u5408\u3063\u3066<\/li>\n<li>\u609f\u308a\u3092\u958b\u304f<\/li>\n<\/ul>\n<p>\u3082\u306e\u3060\u305d\u3046\u3067\u3059\u3002<br \/>\n\u305d\u3046\u601d\u3046\u3068\u3001zen of python \u3082<\/p>\n<ul style=\"list-style-type: disc\">\n<li>\u6975\u529b\u81ea\u5206\u306e\u610f\u5fd7\u3092\u6291\u3048\u8fbc\u307f\uff08\uff1dzen of python\u306e\u5b9a\u3081\u305f\u30eb\u30fc\u30eb\u306b\u5f93\u3046\uff09<\/li>\n<li>\u305f\u3060\u4e00\u3064\u306e\u3053\u3068\u306b\u5411\u304d\u5408\u3063\u3066\uff08\uff1dPython\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3059\u308b\uff09<\/li>\n<li>\u609f\u308a\u3092\u958b\u304f\uff08\uff1d\u5168Python\u6280\u8853\u8005\u304c\u898b\u305f\u3089\u5168\u54e1\u308f\u304b\u308b\u3082\u306e\u304c\u3067\u304d\u3042\u304c\u308b\uff09<\/li>\n<\/ul>\n<p>\u3068\u8a00\u3063\u3066\u3044\u308b\u3068\u8003\u3048\u3066\u3082\u3044\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u304b\u306e\u5b54\u5b50\u3082\u3001\u300c\u56db\u5341\u306b\u3057\u3066\u60d1\u308f\u305a\u300d\u306a\u3093\u3066\u8a00\u8449\u3092\u6b8b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u304d\u3063\u3068\u3001\u8107\u76ee\u3082\u632f\u3089\u305a\u306b\u5b66\u554f\u306b\u9081\u9032\u3057\u300140\u6b73\u306b\u3066\u60d1\u3046\u3053\u3068\u304c\u306a\u304f\u306a\u3063\u305f\u3001<br \/>\n\u609f\u308a\u306e\u5883\u5730\u307f\u305f\u3044\u306a\u3068\u3053\u308d\u306b\u305f\u3069\u308a\u7740\u3044\u305f\u3001\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3057\u3087\u3046\u3002<br \/>\nzen of python\u306b\u5f93\u3063\u305f\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u3059\u308c\u3070\u3001<br \/>\n\u300c\u543e\u25cb\u25cb\u306b\u3057\u3066Python\u3092\u5b66\u3073\u3001\u25cb\u25cb\u306b\u3057\u3066\u60d1\u308f\u305a\u300d<br \/>\n\u306a\u3093\u3066\u3053\u3068\u3092\u8a00\u3046\u4eba\u304c\u51fa\u3066\u304f\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u898f\u7d04\u306a\u3093\u304b\u3001\u7834\u308b\u305f\u3081\u306b\u3042\u308b\u3093\u3060\uff01\u306a\u3093\u3066\u3053\u3068\u3092\u8a00\u308f\u305a\u306b<br \/>\nzen of python\u3092\u610f\u8b58\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3001\u5fc3\u304c\u3051\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3044\u3084\u3001\u5fc3\u304c\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u9577\u6587\u306b\u304a\u4ed8\u304d\u5408\u3044\u3044\u305f\u3060\u3044\u3066\u3001\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\u3002<br \/>\nr.tanaka\u304c\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3046\u3082\u3053\u3093\u306b\u3061\u306f\u3002 \u7985\u306e\u4e16\u754c\u306e\u8a71\u3067\u3059\u3002\u305f\u3060\u3057\u3001Python\u306e\u3001\u3067\u3059\u304c\u3002 \u306f\u3058\u3081\u306b\u3001\u3053\u306e\u8a18\u4e8b\u3092\u57f7\u7b46\u3059\u308b\u306b\u3042\u305f\u308a\u3001\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002 stackoverflow The Zen of Python[c&#8230;<a class=\"read-more-link button\" href=\"https:\/\/idealive.jp\/blog\/2019\/01\/09\/%e7%a6%85%e3%81%ae%e4%b8%96%e7%95%8c\/\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":4,"featured_media":564,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-240","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/240"}],"collection":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":36,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":276,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/240\/revisions\/276"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/media\/564"}],"wp:attachment":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}