)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"3f94bb0556c30f56428b523c6e25dc4968d53064","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Alexander Maretskiy \u003camaretskiy@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-04-29 18:24:51 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[Common] Add class rally.common.utils.FrozenDict"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Class FrozenDict represents dict which is locked for updates"},{"line_number":10,"context_line":"by default. It will be used in cases when we want to prevent"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1a122d0e_9f5396e2","line":7,"updated":"2016-04-30 16:12:36.000000000","message":"Apologies since I see the naming was already addressed, but I\u0027m new here :-)\n\nI saw the name and wondered why this wasn\u0027t just using https://pypi.python.org/pypi/frozendict.\n\nThen I read further and I see that this can actually be \"unfrozen\" (unlocked).\n\nPerhaps it should be called \"LockableDict\" ?  Someone familiar with the existing frozendict would be confused here (as I was).","commit_id":"a3bafe3413d4eb2ec9dba4a3b914e8a260deed23"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"042f9cf4509c6a1a4650d925a0ccf6f953fbfba8","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Alexander Maretskiy \u003camaretskiy@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-04-29 18:24:51 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[Common] Add class rally.common.utils.FrozenDict"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Class FrozenDict represents dict which is locked for updates"},{"line_number":10,"context_line":"by default. It will be used in cases when we want to prevent"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1a122d0e_2043f16d","line":7,"in_reply_to":"1a122d0e_9f5396e2","updated":"2016-05-04 08:57:17.000000000","message":"We can not use arbitrary PYPI package due to limitations from https://github.com/openstack/requirements project. Unexpected package in our requirements.txt will cause our gates to fail.\n\nName \"LockableDict\" sounds reasonable, however this is closer to \"LockedDict\" because it is locked from the beginning.\nIt was actually ReadOnlyDict in first patch set.\nI can rename it if this is agreed with most core reviewers.","commit_id":"a3bafe3413d4eb2ec9dba4a3b914e8a260deed23"}],"rally/common/utils.py":[{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"c1bc5fd352f54a2a90b3968d0062307452e6f228","unresolved":false,"context_lines":[{"line_number":546,"context_line":""},{"line_number":547,"context_line":""},{"line_number":548,"context_line":"class ReadOnlyDict(dict):"},{"line_number":549,"context_line":"    \"\"\"This represents dict which can be locked for updates.\"\"\""},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    def lock(self):"},{"line_number":552,"context_line":"        self._is_locked \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_28a74e50","line":549,"updated":"2016-04-18 22:18:27.000000000","message":"How about delete? There is a lot of already existing recipes http://legacy.python.org/dev/peps/pep-0416/ Also I think that more acceptable name in python community FrozenDict","commit_id":"43a9038be693bc267f28fc2fc3d6930f751e03a5"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"0841daa6a213f9cbcb07b1984233d3673d37eaf7","unresolved":false,"context_lines":[{"line_number":546,"context_line":""},{"line_number":547,"context_line":""},{"line_number":548,"context_line":"class ReadOnlyDict(dict):"},{"line_number":549,"context_line":"    \"\"\"This represents dict which can be locked for updates.\"\"\""},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    def lock(self):"},{"line_number":552,"context_line":"        self._is_locked \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_e0cf227d","line":549,"in_reply_to":"1a122d0e_28a74e50","updated":"2016-04-19 07:36:51.000000000","message":"Delete - good catch, will do!\n\npep-0416 is rejected\n\nFrozenDict is external package, it is not allowed by requirements","commit_id":"43a9038be693bc267f28fc2fc3d6930f751e03a5"},{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"7b37f2687b90d70f7f5e4e551b18f4c6ffd1f4ab","unresolved":false,"context_lines":[{"line_number":545,"context_line":"            return"},{"line_number":546,"context_line":""},{"line_number":547,"context_line":""},{"line_number":548,"context_line":"class FrozenDict(dict):"},{"line_number":549,"context_line":"    \"\"\"This represents dict which can be locked for updates.\"\"\""},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    _is_locked \u003d False"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_dee415ad","line":548,"updated":"2016-04-20 23:07:08.000000000","message":"It will not work as expected https://ideone.com/eCtkbA","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"468bf03748918d450f660c0fb5a148dddd88bc9b","unresolved":false,"context_lines":[{"line_number":545,"context_line":"            return"},{"line_number":546,"context_line":""},{"line_number":547,"context_line":""},{"line_number":548,"context_line":"class FrozenDict(dict):"},{"line_number":549,"context_line":"    \"\"\"This represents dict which can be locked for updates.\"\"\""},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    _is_locked \u003d False"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_0c15c29a","line":548,"in_reply_to":"1a122d0e_dee415ad","updated":"2016-04-21 03:46:33.000000000","message":"Roman, \n\nYour code from sample is wrong.. \n\n\nPlease read about \"reference type\" https://en.wikipedia.org/wiki/Reference_type \n\nAnd keep in mind that all variables in python has are references not objects it self.","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"468bf03748918d450f660c0fb5a148dddd88bc9b","unresolved":false,"context_lines":[{"line_number":548,"context_line":"class FrozenDict(dict):"},{"line_number":549,"context_line":"    \"\"\"This represents dict which can be locked for updates.\"\"\""},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    _is_locked \u003d False"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def _check_if_locked(self):"},{"line_number":554,"context_line":"        if self._is_locked:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_2cb87e74","line":551,"updated":"2016-04-21 03:46:33.000000000","message":"I would prefer to have more cool interface. \n\nwhat about the next: \n\n   a \u003d FrozenDict() \n\n   with a.unlock(): \n      a[\"this\"] \u003d \"works\"\n\n   a[\"this\"] \u003d \"doens\u0027t_work\" \n\nand you can call any amount time with a.unlock() and it will work. \n\n\nso by default _is_locked should be True (and it should be ignored by __init__ method) \n\nand we should remove .lock() method.\n\n\nThis will make way better interface and it will reduce amount of potential bugs (like forgetting to put .lock())","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"5b270733ff1300cf565a61001e2d314a1c781067","unresolved":false,"context_lines":[{"line_number":548,"context_line":"class FrozenDict(dict):"},{"line_number":549,"context_line":"    \"\"\"This represents dict which can be locked for updates.\"\"\""},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    _is_locked \u003d False"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def _check_if_locked(self):"},{"line_number":554,"context_line":"        if self._is_locked:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_30f6088f","line":551,"in_reply_to":"1a122d0e_2cb87e74","updated":"2016-04-21 08:44:32.000000000","message":"Will do","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"},{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"7b37f2687b90d70f7f5e4e551b18f4c6ffd1f4ab","unresolved":false,"context_lines":[{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def _check_if_locked(self):"},{"line_number":554,"context_line":"        if self._is_locked:"},{"line_number":555,"context_line":"            raise RuntimeError(\"Trying to change read-only dict %r\" % self)"},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    def lock(self):"},{"line_number":558,"context_line":"        self._is_locked \u003d True"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_5edc8545","line":555,"updated":"2016-04-20 23:07:08.000000000","message":"If the dict is too big its not user friendly to see a big string representation or even a big dict","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"468bf03748918d450f660c0fb5a148dddd88bc9b","unresolved":false,"context_lines":[{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def _check_if_locked(self):"},{"line_number":554,"context_line":"        if self._is_locked:"},{"line_number":555,"context_line":"            raise RuntimeError(\"Trying to change read-only dict %r\" % self)"},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    def lock(self):"},{"line_number":558,"context_line":"        self._is_locked \u003d True"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_0ccae21a","line":555,"in_reply_to":"1a122d0e_5edc8545","updated":"2016-04-21 03:46:33.000000000","message":"I think it is very useful, because if you make mistake in your code you will see full trace + content of dict which may help you to debug the situation faster and without debugger","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"},{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"8f6d64318ce6f15da3c46e92a401a022aad4d47a","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        if self._is_locked:"},{"line_number":555,"context_line":"            raise RuntimeError(\"Trying to change read-only dict %r\" % self)"},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    def lock(self):"},{"line_number":558,"context_line":"        self._is_locked \u003d True"},{"line_number":559,"context_line":"        return self"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_1e668d29","line":557,"updated":"2016-04-20 23:18:41.000000000","message":"Also if we don\u0027t call this function we will get simple dict but its type would be FrozenDict! Is it was designed so? I thought we could just pass the dict during initialize. After that we could only view it. Isn\u0027t it better without lock function?","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"468bf03748918d450f660c0fb5a148dddd88bc9b","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        self._is_locked \u003d True"},{"line_number":559,"context_line":"        return self"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    def __setitem__(self, *args, **kwargs):"},{"line_number":562,"context_line":"        self._check_if_locked()"},{"line_number":563,"context_line":"        return super(FrozenDict, self).__setitem__(*args, **kwargs)"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_cca90a26","line":561,"updated":"2016-04-21 03:46:33.000000000","message":"this implementation looks like a copy paste... \n\nany way to make it smarter? e.g. iterating over all methods...","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"5b270733ff1300cf565a61001e2d314a1c781067","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        self._is_locked \u003d True"},{"line_number":559,"context_line":"        return self"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    def __setitem__(self, *args, **kwargs):"},{"line_number":562,"context_line":"        self._check_if_locked()"},{"line_number":563,"context_line":"        return super(FrozenDict, self).__setitem__(*args, **kwargs)"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_3b11c952","line":561,"in_reply_to":"1a122d0e_cca90a26","updated":"2016-04-21 08:44:32.000000000","message":"Iteration over methods was actually the first approach I tried, however it does not work for magic methods __setitem__ and __delitem__.\n\nHaving both overriding and iteration will overcomplicate code, so I\u0027ve chosen simple overriding for all methods","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"}],"tests/unit/common/test_utils.py":[{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"7b37f2687b90d70f7f5e4e551b18f4c6ffd1f4ab","unresolved":false,"context_lines":[{"line_number":491,"context_line":"    def test_lock_and_try_to_update(self):"},{"line_number":492,"context_line":"        d \u003d utils.FrozenDict()"},{"line_number":493,"context_line":"        self.assertIsInstance(d, dict)"},{"line_number":494,"context_line":"        self.assertEqual(d, {})"},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"        d \u003d utils.FrozenDict(foo\u003d\"bar\")"},{"line_number":497,"context_line":"        d[123] \u003d 456"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_43003266","line":494,"updated":"2016-04-20 23:07:08.000000000","message":"Wrong order of parameters in assertEqual","commit_id":"81ce7b37b8ec669ac7e49046a49d1aab327709ff"}]}
