)]}'
{"HACKING.rst":[{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"d1c47f091f6ea50aaaddf6935fd1f828d601f7a6","unresolved":false,"context_lines":[{"line_number":18,"context_line":"- Do not name anything the same name as a built-in or reserved word"},{"line_number":19,"context_line":"- When defining global constants, define them before functions and classes"},{"line_number":20,"context_line":"- Avoid using \"double quotes\" where you can reasonably use \u0027single quotes\u0027"},{"line_number":21,"context_line":"- Use the \"not in\" operator for collection membership evaluation. Example::"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    if not X in Y:  # BAD, hard to understand"},{"line_number":24,"context_line":"        pass"}],"source_content_type":"text/x-rst","patch_set":2,"id":"AAAAM3%2F%2FP1U%3D","line":21,"updated":"2013-01-31 15:13:24.000000000","message":"collection membership evaluation -\u003e for evaluating membership in a collection","commit_id":"07317af09c344d16c65897bcbd186cf579d6aa04"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"d1c47f091f6ea50aaaddf6935fd1f828d601f7a6","unresolved":false,"context_lines":[{"line_number":20,"context_line":"- Avoid using \"double quotes\" where you can reasonably use \u0027single quotes\u0027"},{"line_number":21,"context_line":"- Use the \"not in\" operator for collection membership evaluation. Example::"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    if not X in Y:  # BAD, hard to understand"},{"line_number":24,"context_line":"        pass"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    if X not in Y:  # OKAY, intuitive"}],"source_content_type":"text/x-rst","patch_set":2,"id":"AAAAM3%2F%2FP1Y%3D","line":23,"updated":"2013-01-31 15:13:24.000000000","message":"hard to understand -\u003e intended behavior is ambiguous","commit_id":"07317af09c344d16c65897bcbd186cf579d6aa04"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"d1c47f091f6ea50aaaddf6935fd1f828d601f7a6","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        pass"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    if not (X in Y or X is Z):  # OKAY, still better than all those \u0027not\u0027s"},{"line_number":30,"context_line":"        pass"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"TODO vs FIXME"}],"source_content_type":"text/x-rst","patch_set":2,"id":"AAAAM3%2F%2FP0w%3D","line":30,"updated":"2013-01-31 15:13:24.000000000","message":"-1 for this example: it\u0027s not as relevant as the above two and touches on another issue without explaining it... unless you change the second \u0027is\u0027 to an \u0027in\u0027\n\nRegardless, I\u0027d suggest adding a second rule:\n\n  - Use the \"X is not Y\" operator when testing for unequal identities, rather than \"not X is Y\"","commit_id":"07317af09c344d16c65897bcbd186cf579d6aa04"}],"keystone/identity/controllers.py":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"4e5c9f7eea32cdc26fd1c7a12074c0126ff14714","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def create_project(self, context, tenant):"},{"line_number":91,"context_line":"        tenant_ref \u003d self._normalize_dict(tenant)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if \u0027name\u0027 not in tenant_ref or not tenant_ref[\u0027name\u0027]:"},{"line_number":94,"context_line":"            msg \u003d \u0027Name field is required and cannot be empty\u0027"},{"line_number":95,"context_line":"            raise exception.ValidationError(message\u003dmsg)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2FK8s%3D","line":93,"updated":"2013-02-04 22:28:04.000000000","message":"maybe we should have something in HACKING.rst that says \u0027consider if using .get() would be more concise.\u0027","commit_id":"4cd7abaa350cc7b465b90a26e87f5c73e32a2d1f"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"060500ebf51df375dd09c245d13f077071a1f81a","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def create_project(self, context, tenant):"},{"line_number":91,"context_line":"        tenant_ref \u003d self._normalize_dict(tenant)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if \u0027name\u0027 not in tenant_ref or not tenant_ref[\u0027name\u0027]:"},{"line_number":94,"context_line":"            msg \u003d \u0027Name field is required and cannot be empty\u0027"},{"line_number":95,"context_line":"            raise exception.ValidationError(message\u003dmsg)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2FKs0%3D","line":93,"in_reply_to":"AAAAM3%2F%2FK8s%3D","updated":"2013-02-05 01:26:08.000000000","message":"i can\u0027t think of a reason why that wouldn\u0027t work here, but it\u0027s not quite a universal substitute for \u0027not in\u0027, e.g.:\n\n  \u003e\u003e\u003e d \u003d dict()\n  \u003e\u003e\u003e k \u003d object()\n  \u003e\u003e\u003e k not in d\n  True\n  \u003e\u003e\u003e not d.get(k)\n  True\n  \u003e\u003e\u003e d[k] \u003d None\n  \u003e\u003e\u003e k not in d\n  False\n  \u003e\u003e\u003e not d.get(k)\n  True","commit_id":"4cd7abaa350cc7b465b90a26e87f5c73e32a2d1f"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"494e217ae00ad1db746ae71a56b4bf62b9aa7186","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def create_project(self, context, tenant):"},{"line_number":91,"context_line":"        tenant_ref \u003d self._normalize_dict(tenant)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if \u0027name\u0027 not in tenant_ref or not tenant_ref[\u0027name\u0027]:"},{"line_number":94,"context_line":"            msg \u003d \u0027Name field is required and cannot be empty\u0027"},{"line_number":95,"context_line":"            raise exception.ValidationError(message\u003dmsg)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2FKkQ%3D","line":93,"in_reply_to":"AAAAM3%2F%2FKlU%3D","updated":"2013-02-05 03:26:50.000000000","message":"Ah, understood. Yes we almost made that mistake to a patch in Quantum.","commit_id":"4cd7abaa350cc7b465b90a26e87f5c73e32a2d1f"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"79f53edf64272fca8d77ef2e532ca35ae41f8c2a","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def create_project(self, context, tenant):"},{"line_number":91,"context_line":"        tenant_ref \u003d self._normalize_dict(tenant)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if \u0027name\u0027 not in tenant_ref or not tenant_ref[\u0027name\u0027]:"},{"line_number":94,"context_line":"            msg \u003d \u0027Name field is required and cannot be empty\u0027"},{"line_number":95,"context_line":"            raise exception.ValidationError(message\u003dmsg)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2FKlU%3D","line":93,"in_reply_to":"AAAAM3%2F%2FKrU%3D","updated":"2013-02-05 03:13:37.000000000","message":"You\u0027re correct; my point is simply that \u0027k not in d\u0027 is not equivalent to \u0027not d.get(k)\u0027 for all use cases, so I wouldn\u0027t want to add preference between for one into HACKING.","commit_id":"4cd7abaa350cc7b465b90a26e87f5c73e32a2d1f"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"82f3f86c38a2bbe02f59ea4a21f6bf7c5f0eb383","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def create_project(self, context, tenant):"},{"line_number":91,"context_line":"        tenant_ref \u003d self._normalize_dict(tenant)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if \u0027name\u0027 not in tenant_ref or not tenant_ref[\u0027name\u0027]:"},{"line_number":94,"context_line":"            msg \u003d \u0027Name field is required and cannot be empty\u0027"},{"line_number":95,"context_line":"            raise exception.ValidationError(message\u003dmsg)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2FKrU%3D","line":93,"in_reply_to":"AAAAM3%2F%2FKs0%3D","updated":"2013-02-05 01:37:17.000000000","message":"Dolph, I don\u0027t quite understand your point. I also think line 93 is identical to \"if not tenant_ref.get(\u0027name\u0027)\"","commit_id":"4cd7abaa350cc7b465b90a26e87f5c73e32a2d1f"}]}
