{"id":292,"date":"2003-03-14T01:57:17","date_gmt":"2003-03-14T06:57:17","guid":{"rendered":"\/?p=292"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"python_coding_standards","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2003\/03\/14\/python_coding_standards\/","title":{"rendered":"Python Coding Standards"},"content":{"rendered":"<p>\n\n<a href=\"http:\/\/radio.weblogs.com\/0100490\/2003\/03\/12.html#a418\">Bill Bumgarner<\/a> links to a post describing <a href=\"http:\/\/lists.osafoundation.org\/pipermail\/dev\/2003-March\/000479.html\">Yahoo&rsquo;s Python coding guidelines<\/a>. As he points out, they suggest an Objective-C&ndash;inspired naming convention for methods. It looks a little funny, since the selector and arguments aren&rsquo;t intermixed, but it has the advantage of better interaction with <a href=\"http:\/\/www.c-command.com\/bbautocomplete\">dumb auto-completion<\/a>.\n\n<\/p>\n\n\n\n<p>\n\nI really like the Objective-C messaging syntax, especially when combined with Apple&rsquo;s naming conventions. When you have an <code><a href=\"http:\/\/developer.apple.com\/techpubs\/macosx\/Cocoa\/Reference\/Foundation\/ObjC_classic\/Classes\/NSMutableArray.html#\/\/apple_ref\/occ\/cl\/NSMutableArray\">NSMutableArray<\/a><\/code>, there is absolutely no ambiguity between <code>-addObject:<\/code> and <code>-addObjectsFromArray:<\/code>. In Python, I still confuse <code>append()<\/code> and <code>extend()<\/code>, perhaps because in Lisp <code>append<\/code> is for appending the elements of a list, whereas in Python it&rsquo;s for appending an object.\n\n<\/p>","protected":false},"excerpt":{"rendered":"<p>Bill Bumgarner links to a post describing Yahoo&rsquo;s Python coding guidelines. As he points out, they suggest an Objective-C&ndash;inspired naming convention for methods. It looks a little funny, since the selector and arguments aren&rsquo;t intermixed, but it has the advantage of better interaction with dumb auto-completion. I really like the Objective-C messaging syntax, especially when [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=292"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/292\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}