)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"826cdc7607ad24b93a229e2e958a2887f8596fdb","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add some initial unit testing for encoding.py"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Also add the \u0027__eq__\u0027 and \u0027__ne__\u0027 functions to the Serializable class."},{"line_number":12,"context_line":"This should make unit testing users of the class easier when doing a"},{"line_number":13,"context_line":"self.assertEqual() or self.assertNotEqual()"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_53a27eaf","line":11,"updated":"2015-08-25 14:38:21.000000000","message":"Whoa. I think there are two separate things in this patch. And if they are both in one patch, it seems to me that this is the more important thing because it is a change to the code. But anyway...","commit_id":"19927d9fbafcbeee9f9cff91750877d0cb71fb21"}],"ironic_python_agent/encoding.py":[{"author":{"_account_id":10380,"name":"Josh Gachnang","email":"josh@pcsforeducation.com","username":"JoshNang"},"change_message_id":"5ecfcaaebcf5cdae124edd847115871cb6569dd9","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __eq__(self, other):"},{"line_number":28,"context_line":"        return ("},{"line_number":29,"context_line":"            (self.__class__ \u003d\u003d other.__class__) and"},{"line_number":30,"context_line":"            (self.serialize() \u003d\u003d other.serialize())"},{"line_number":31,"context_line":"        )"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_c81b32c9","line":29,"updated":"2015-08-28 20:52:27.000000000","message":"I disagree we should be checking the same class here. If I subclass a Serializable into object A, subclass object A into B, and compare some instance of A and B with the same values of the serializable_fields, we should consider those equal, regardless of them being different classes. The simplest example is comparing a standard string to a unicode string:\n\n\u003e\u003e\u003e \u0027a\u0027 \u003d\u003d u\u0027a\u0027\n\nTrue\n\n\u003e\u003e\u003e type(\u0027a\u0027)\n\n\u003ctype \u0027str\u0027\u003e\n\n\u003e\u003e\u003e type(u\u0027a\u0027)\n\n\u003ctype \u0027unicode\u0027\u003e","commit_id":"cbb65a07cb97e8f003771095ad0a8b7cae0c3fd7"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"093f141b472dc5e6eac353eb6f0e47e30d4d2490","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __eq__(self, other):"},{"line_number":28,"context_line":"        return ("},{"line_number":29,"context_line":"            (self.__class__ \u003d\u003d other.__class__) and"},{"line_number":30,"context_line":"            (self.serialize() \u003d\u003d other.serialize())"},{"line_number":31,"context_line":"        )"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_f44aa726","line":29,"in_reply_to":"da20952f_403aaee8","updated":"2015-09-10 18:12:03.000000000","message":"Changed as requested :)","commit_id":"cbb65a07cb97e8f003771095ad0a8b7cae0c3fd7"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"f4ccd2b1579ac963555a0c65780e8a370d651b37","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __eq__(self, other):"},{"line_number":28,"context_line":"        return ("},{"line_number":29,"context_line":"            (self.__class__ \u003d\u003d other.__class__) and"},{"line_number":30,"context_line":"            (self.serialize() \u003d\u003d other.serialize())"},{"line_number":31,"context_line":"        )"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_403aaee8","line":29,"in_reply_to":"da20952f_c81b32c9","updated":"2015-09-10 18:02:33.000000000","message":"Are you sure? Seems wrong to me, but I can do it that way :)\n\n class Memory(Serializable):\n   serializable_fields \u003d (\u0027total\u0027, \u0027physical_mb\u0027)\n\n class HardDrive(Serializable):\n   serializable_fields \u003d (\u0027total\u0027, \u0027physical_mb\u0027)\n\nWe should consider them equal if they have the same values?","commit_id":"cbb65a07cb97e8f003771095ad0a8b7cae0c3fd7"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"cf9e66299bc90af7b62b7cf88bf74f94b1928349","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def __hash__(self):"},{"line_number":34,"context_line":"        # Use the \u0027id\u0027 of the object to generate the hash"},{"line_number":35,"context_line":"        return hash(id(self))"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"class RESTJSONEncoder(json.JSONEncoder):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_d7b50e32","line":35,"updated":"2015-09-11 08:14:28.000000000","message":"this is the default implementation :) but it misses the whole point: object that are equal must have equal hashes. so in your implementation it should be hash(self.serialize()). But! As dicts are not hashable, I wonder if we just make this unhashable as well... IIRC it\u0027s done by just writing \"del __hash__\" but I may be wrong.","commit_id":"393bfb95f28ef847b9544ae52cd6bf9f2b714b8e"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"5718ab8df0e6d252de7f859fbf58b30c9a01504e","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def __hash__(self):"},{"line_number":34,"context_line":"        # Use the \u0027id\u0027 of the object to generate the hash"},{"line_number":35,"context_line":"        return hash(id(self))"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"class RESTJSONEncoder(json.JSONEncoder):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_c5bb07c3","line":35,"in_reply_to":"da20952f_d7b50e32","updated":"2015-09-11 14:33:38.000000000","message":"Once you create a __eq__ function the default implementation disappears. So there is no __hash__ function.\n\nSo I am basically this is being compatible with how it was before this patch.\n\nUnfortunately these objects are getting stuffed into sets (or maybe dicts) and thus need to be hashable. Maybe that is the real problem.\n\nAnother constrain of hash is that it should not change. Some of these classes or derived classes are mutable.\n\nIdeas welcomed :)","commit_id":"393bfb95f28ef847b9544ae52cd6bf9f2b714b8e"}],"ironic_python_agent/tests/unit/test_encoding.py":[{"author":{"_account_id":10380,"name":"Josh Gachnang","email":"josh@pcsforeducation.com","username":"JoshNang"},"change_message_id":"98ef732ecca9556445298adf1ab72d19dca80bd6","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def test_childclass_equal(self):"},{"line_number":40,"context_line":"        obj1 \u003d SerializableTesting(\u0027hello\u0027, \u0027world\u0027)"},{"line_number":41,"context_line":"        obj2 \u003d SerializableTesting(\u0027hello\u0027, \u0027world\u0027)"},{"line_number":42,"context_line":"        self.assertEqual(obj1, obj2)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_39d2b235","line":42,"updated":"2015-08-22 16:25:26.000000000","message":"You should throw in a negative test, just to be sure.","commit_id":"610e49137152ebac8e0977d1a92bfe2febce4dfe"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"a6a259c7622037c009b72f0f83714a738659b80e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def test_childclass_equal(self):"},{"line_number":40,"context_line":"        obj1 \u003d SerializableTesting(\u0027hello\u0027, \u0027world\u0027)"},{"line_number":41,"context_line":"        obj2 \u003d SerializableTesting(\u0027hello\u0027, \u0027world\u0027)"},{"line_number":42,"context_line":"        self.assertEqual(obj1, obj2)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_998f3ecc","line":42,"in_reply_to":"fa1b9901_39d2b235","updated":"2015-08-22 17:05:35.000000000","message":"Yeah, I was thinking about that later :)\n\nWill do.","commit_id":"610e49137152ebac8e0977d1a92bfe2febce4dfe"}]}
