)]}'
{"rally/plugins/openstack/cleanup/manager.py":[{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"47faee7f1b3587495d7c958d22f659c795c53e51","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            key \u003d str((user[\"credential\"], sorted(self.api_versions.items())))"},{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            key \u003d user[\"credential\"]"},{"line_number":58,"context_line":"        if key not in self.__class__.cache:"},{"line_number":59,"context_line":"            self.__class__.cache[key] \u003d osclients.Clients("},{"line_number":60,"context_line":"                user[\"credential\"], api_info\u003dself.api_versions)"},{"line_number":61,"context_line":"        return self.__class__.cache[key]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_652fb5f6","line":58,"updated":"2016-02-22 15:33:32.000000000","message":"You can use class property `self.cache\u0027 directly","commit_id":"b0d6ff4be0a6b44cdaf7e5c16aeeaad572844c4e"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"314fa80a35916250601ca02a6b2c64098c84b8ab","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            key \u003d str((user[\"credential\"], sorted(self.api_versions.items())))"},{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            key \u003d user[\"credential\"]"},{"line_number":58,"context_line":"        if key not in self.__class__.cache:"},{"line_number":59,"context_line":"            self.__class__.cache[key] \u003d osclients.Clients("},{"line_number":60,"context_line":"                user[\"credential\"], api_info\u003dself.api_versions)"},{"line_number":61,"context_line":"        return self.__class__.cache[key]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_55efb886","line":58,"in_reply_to":"bae84128_55a218af","updated":"2016-02-22 15:58:33.000000000","message":"Your example has a mistake at line \"\u003e\u003e\u003e f.bar \u003d 2\"\n\nLook at http://paste.openstack.org/show/487761/","commit_id":"b0d6ff4be0a6b44cdaf7e5c16aeeaad572844c4e"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"a62162572518b4620655619c7777d445e4a75fba","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            key \u003d str((user[\"credential\"], sorted(self.api_versions.items())))"},{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            key \u003d user[\"credential\"]"},{"line_number":58,"context_line":"        if key not in self.__class__.cache:"},{"line_number":59,"context_line":"            self.__class__.cache[key] \u003d osclients.Clients("},{"line_number":60,"context_line":"                user[\"credential\"], api_info\u003dself.api_versions)"},{"line_number":61,"context_line":"        return self.__class__.cache[key]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_55a218af","line":58,"in_reply_to":"bae84128_652fb5f6","updated":"2016-02-22 15:51:33.000000000","message":"You can\u0027t, actually. self.cache references the \u0027cache\u0027 attribute of the current instance; if there is no such attribute, it defers to the class attribute. But if you set it, then it sets the attribute on the instance, not on the class. So if you use self.cache, then the cache ceases to be shared between the SeekAndDestroy objects. You can see this in action if you either change all of these instances to self.cache and run the tests; or do a simple test in your favorite REPL:\n\n    \u003e\u003e\u003e class Foo(object):\n    ...     bar \u003d 1\n    ... \n    \u003e\u003e\u003e Foo.bar\n    1\n    \u003e\u003e\u003e f \u003d Foo()\n    \u003e\u003e\u003e f.bar\n    1\n    \u003e\u003e\u003e f.bar \u003d 2\n    \u003e\u003e\u003e Foo.bar\n    1\n    \u003e\u003e\u003e f.bar\n    2\n    \u003e\u003e\u003e f.__class__.bar\n    1\n\n\nAs you can see, once the *instance* variable has been set it masks the class variable.","commit_id":"b0d6ff4be0a6b44cdaf7e5c16aeeaad572844c4e"}]}
