)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3c0f3f2e0616054edddaeafad55ee0aec27cfb24","unresolved":false,"context_lines":[{"line_number":9,"context_line":"With py3 hasattr now expects a specific AttributeError [1] to be thrown if"},{"line_number":10,"context_line":"an attribute is not found when calling getter. Previously with py2 any"},{"line_number":11,"context_line":"exception thrown by getter was caught by hasattr and taken to mean that"},{"line_number":12,"context_line":"the attribute was not present [2]."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"obj_load_attr should in turn avoid throwing NotImplementedError as this"},{"line_number":15,"context_line":"breaks hasattr in py3."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a122d0e_cdb44dd6","line":12,"updated":"2016-04-21 13:49:11.000000000","message":"Sure, but obj_load_attr() is not touched for things where we don\u0027t have an attribute, it\u0027s touched for things where we *do* and any access (even hasattr) will cause it to be loaded.\n\nIf you want to tell if something is loaded or not, then you should use __contains__ or obj_attr_is_set(). Objects that implement this interface are also expected to implement obj_load_attr(), which is why it raises NotImplementedError now. So, whatever case you\u0027re solving for is probably misuse and/or an object that didn\u0027t implement that method.","commit_id":"3817bb53e1d9e23a38a7414828b3b99395864c03"}],"oslo_versionedobjects/base.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3c0f3f2e0616054edddaeafad55ee0aec27cfb24","unresolved":false,"context_lines":[{"line_number":576,"context_line":"        This should load self.$attrname and cache any data that might"},{"line_number":577,"context_line":"        be useful for future load operations."},{"line_number":578,"context_line":"        \"\"\""},{"line_number":579,"context_line":"        raise NotImplementedError("},{"line_number":580,"context_line":"            _(\"Cannot load \u0027%s\u0027 in the base class\") % attrname)"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"    def save(self, context):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_0d7be57c","side":"PARENT","line":579,"updated":"2016-04-21 13:49:11.000000000","message":"This is part of our API now, you can\u0027t really change it.","commit_id":"730659ed6f92226380007f71432233c9e78cb5bd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3c0f3f2e0616054edddaeafad55ee0aec27cfb24","unresolved":false,"context_lines":[{"line_number":576,"context_line":"        This should load self.$attrname and cache any data that might"},{"line_number":577,"context_line":"        be useful for future load operations."},{"line_number":578,"context_line":"        \"\"\""},{"line_number":579,"context_line":"        raise AttributeError("},{"line_number":580,"context_line":"            _(\"Cannot load \u0027%s\u0027 in the base class\") % attrname)"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"    def save(self, context):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_add63125","line":579,"updated":"2016-04-21 13:49:11.000000000","message":"This is not right. hasattr() means \"does this thing have an attribute\", which is necessarily true of we\u0027re in the load routine.\n\nThe obj_load_attr() bit here is to lazy-load the value of something that _is_ a field, but is not set or loaded. So, it would be very confusing for something above this to touch a field that _is_ a valid, declared field, and get an AttributeError.","commit_id":"3817bb53e1d9e23a38a7414828b3b99395864c03"}]}
