)]}'
{"swift/obj/server.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d9f1b4bd00bd00b5a6785bf4768e66f5ac7f3bb","unresolved":false,"context_lines":[{"line_number":1034,"context_line":"                if req.method not in self.allowed_methods:"},{"line_number":1035,"context_line":"                    res \u003d HTTPMethodNotAllowed()"},{"line_number":1036,"context_line":"                else:"},{"line_number":1037,"context_line":"                    res \u003d getattr(self, req.method)(req)"},{"line_number":1038,"context_line":"            except DiskFileCollision:"},{"line_number":1039,"context_line":"                res \u003d HTTPForbidden(request\u003dreq)"},{"line_number":1040,"context_line":"            except HTTPException as error_response:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_b7232d04","line":1037,"updated":"2016-07-01 03:09:46.000000000","message":"what is the point of this?  someone is just going to have to unroll it if they ever want to debug some attributes or something about the returned method before calling it...\n\ns/method/handler/ would be more obvious, getting rid of intermediary name makes the second call less obvious","commit_id":"a8ffec700656bc5ce9623217304055c9b02e7bf5"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"32f026d7860dd0460fa6979ffc9db339587c5d2b","unresolved":false,"context_lines":[{"line_number":1034,"context_line":"                if req.method not in self.allowed_methods:"},{"line_number":1035,"context_line":"                    res \u003d HTTPMethodNotAllowed()"},{"line_number":1036,"context_line":"                else:"},{"line_number":1037,"context_line":"                    res \u003d getattr(self, req.method)(req)"},{"line_number":1038,"context_line":"            except DiskFileCollision:"},{"line_number":1039,"context_line":"                res \u003d HTTPForbidden(request\u003dreq)"},{"line_number":1040,"context_line":"            except HTTPException as error_response:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_18b506ec","line":1037,"in_reply_to":"3aaa91ec_520ad020","updated":"2016-07-01 07:08:44.000000000","message":"ah, i missed patch 329713 - i\u0027ll mention that in the commit, but i\u0027m not sure of the justification on that patch either?\n\n... the AttributeError explosion increasing was great, the same on this change is great!  The double-call-squashing - less so for me.\n\ni suppose I actually care more about readability than consistency, unless the consistency helps with maintainability somehow - this is just too small to matter either way.","commit_id":"a8ffec700656bc5ce9623217304055c9b02e7bf5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d4ede92091a6b1c25886d6ef2c02aa6237deac58","unresolved":false,"context_lines":[{"line_number":1034,"context_line":"                if req.method not in self.allowed_methods:"},{"line_number":1035,"context_line":"                    res \u003d HTTPMethodNotAllowed()"},{"line_number":1036,"context_line":"                else:"},{"line_number":1037,"context_line":"                    res \u003d getattr(self, req.method)(req)"},{"line_number":1038,"context_line":"            except DiskFileCollision:"},{"line_number":1039,"context_line":"                res \u003d HTTPForbidden(request\u003dreq)"},{"line_number":1040,"context_line":"            except HTTPException as error_response:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_520ad020","line":1037,"in_reply_to":"3aaa91ec_b7232d04","updated":"2016-07-01 03:22:28.000000000","message":"Mainly, I did this for consistency with similar code in account/server.py and container/server.py","commit_id":"a8ffec700656bc5ce9623217304055c9b02e7bf5"}],"swift/proxy/server.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d9f1b4bd00bd00b5a6785bf4768e66f5ac7f3bb","unresolved":false,"context_lines":[{"line_number":383,"context_line":"            controller.trans_id \u003d req.environ[\u0027swift.trans_id\u0027]"},{"line_number":384,"context_line":"            self.logger.client_ip \u003d get_remote_client(req)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"            if req.method not in controller.allowed_methods:"},{"line_number":387,"context_line":"                return HTTPMethodNotAllowed(request\u003dreq, headers\u003d{"},{"line_number":388,"context_line":"                    \u0027Allow\u0027: \u0027, \u0027.join(controller.allowed_methods)})"},{"line_number":389,"context_line":"            handler \u003d getattr(controller, req.method)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_d2152740","line":386,"updated":"2016-07-01 03:09:46.000000000","message":"this a win, replace two getattr calls with a property function that does caching to a attr lookup - the returned value is a fast-inclusion-testing set; also don\u0027t create the default set() everytime.  Plus it\u0027s easier to read; more obvious.\n\nhowever, one of the getattr removals was a freebe - the getattr call for the allowed_methods property seems to be indicating that some controller objects might not have always had the allowed_methods property?  It may have been overly cautious or possible some tests may have configured custom controllers that may not have always inherited from BaseController?\n\nThe near wash still comes out a win for me because of the improved checking in the property that also ensure\u0027s the getattr for req.method will return a *callable* with the publicly_accessible attribute - unless it was modified at run time - then the caching becomes an annoying landmine.","commit_id":"a8ffec700656bc5ce9623217304055c9b02e7bf5"}]}
