)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"0343a5ca2b532b0b949981747d5bbf2e2ee86652","unresolved":false,"context_lines":[{"line_number":20,"context_line":"to negative versions, which are not possible in microversions"},{"line_number":21,"context_line":"and mean matches() (without override args) will be false. The"},{"line_number":22,"context_line":"use of explicit values (instead of None) is so python3 is happy"},{"line_number":23,"context_line":"(and it is better anyway)."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Change-Id: I71d091d037abcd068601b32722a09094ae74e658"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"df7087c5_6308b2d8","line":23,"updated":"2018-03-21 14:11:51.000000000","message":"Yeah, this works for me.","commit_id":"e346558d5f67ae2a3a848f6d8ad6166c761b39d1"}],"microversion_parse/__init__.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7de5c2b76304696926c6d6b30458874176a34632","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                 be determined."},{"line_number":37,"context_line":"        \"\"\""},{"line_number":38,"context_line":"        if min_version is None:"},{"line_number":39,"context_line":"            min_version \u003d self.min_version"},{"line_number":40,"context_line":"        if max_version is None:"},{"line_number":41,"context_line":"            max_version \u003d self.max_version"},{"line_number":42,"context_line":"        return min_version \u003c\u003d self \u003c\u003d max_version"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_b45bf0f3","line":39,"range":{"start_line":39,"start_character":26,"end_line":39,"end_character":42},"updated":"2018-03-15 13:42:12.000000000","message":"This, and self.max_version, are not defined on the class. So unless they are set as on L200-1, calling this method with the default kwargs will raise an AttributeError.","commit_id":"023756d6ae19dfe6f04d2f0094885a8b6e091070"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e8e16c07fffa45dde9089eb590b2c38bbba5a060","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                 be determined."},{"line_number":37,"context_line":"        \"\"\""},{"line_number":38,"context_line":"        if min_version is None:"},{"line_number":39,"context_line":"            min_version \u003d self.min_version"},{"line_number":40,"context_line":"        if max_version is None:"},{"line_number":41,"context_line":"            max_version \u003d self.max_version"},{"line_number":42,"context_line":"        return min_version \u003c\u003d self \u003c\u003d max_version"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_b40f7086","line":39,"range":{"start_line":39,"start_character":26,"end_line":39,"end_character":42},"in_reply_to":"df7087c5_b45bf0f3","updated":"2018-03-15 13:49:59.000000000","message":"That\u0027s right, that\u0027s intentional, the docstring says as much (but has a typo).\n\nIf AttributeError happens, it is because the Version class has not been created properly. See lines 200 and 201 below.\n\nEither:\n\nyou must create the Version with min and max being set\nor\nyou must provide the kwargs","commit_id":"023756d6ae19dfe6f04d2f0094885a8b6e091070"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"863c56b2093088502fab96535b013b6a7d159900","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        :raises: AttributeError: If min or max_version cannot"},{"line_number":36,"context_line":"                                 be determined."},{"line_number":37,"context_line":"        \"\"\""},{"line_number":38,"context_line":"        # NOTE(cdent): min_version and max_version are expected"},{"line_number":39,"context_line":"        # to be set by the code that is creating the Version, if"},{"line_number":40,"context_line":"        # they are known."},{"line_number":41,"context_line":"        if min_version is None:"},{"line_number":42,"context_line":"            min_version \u003d self.min_version"},{"line_number":43,"context_line":"        if max_version is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_64b1bce1","line":40,"range":{"start_line":38,"start_character":8,"end_line":40,"end_character":25},"updated":"2018-03-20 14:11:48.000000000","message":"Regardless, the __init__ should define these as None or 0 or 999999 if they need to be part of the class. I understand that in practice they will be initialized when used, but it still is bad class design to refer to attributes that aren\u0027t declared on the class.","commit_id":"15ea09649c594af5f0f8ce61e9d93e1448d0949a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a6d0fbae4c56d8d0ea6d09cec1e3dacf9423517a","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        :raises: AttributeError: If min or max_version cannot"},{"line_number":36,"context_line":"                                 be determined."},{"line_number":37,"context_line":"        \"\"\""},{"line_number":38,"context_line":"        # NOTE(cdent): min_version and max_version are expected"},{"line_number":39,"context_line":"        # to be set by the code that is creating the Version, if"},{"line_number":40,"context_line":"        # they are known."},{"line_number":41,"context_line":"        if min_version is None:"},{"line_number":42,"context_line":"            min_version \u003d self.min_version"},{"line_number":43,"context_line":"        if max_version is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_84d3b0d5","line":40,"range":{"start_line":38,"start_character":8,"end_line":40,"end_character":25},"in_reply_to":"df7087c5_64b1bce1","updated":"2018-03-20 14:17:01.000000000","message":"That\u0027s rather complex to do with a namedtuple, we have to modify __new__ in some funky ways (last I checked) if they are really going to be instance attributes, which we\u0027d like them to be.\n\nDoing it this way was a shortcut to preserve the existing semantics of the class. In placement, where the mix and max come from a global, these are set up as properties, which the global makes easy to do.\n\nIf you\u0027ve got a tidy way to do it, please share.","commit_id":"15ea09649c594af5f0f8ce61e9d93e1448d0949a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9980ddfaed5c93fa69c695ff357c65f2f40c7c0d","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        :raises: AttributeError: If min or max_version cannot"},{"line_number":36,"context_line":"                                 be determined."},{"line_number":37,"context_line":"        \"\"\""},{"line_number":38,"context_line":"        # NOTE(cdent): min_version and max_version are expected"},{"line_number":39,"context_line":"        # to be set by the code that is creating the Version, if"},{"line_number":40,"context_line":"        # they are known."},{"line_number":41,"context_line":"        if min_version is None:"},{"line_number":42,"context_line":"            min_version \u003d self.min_version"},{"line_number":43,"context_line":"        if max_version is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_aa755b9a","line":40,"range":{"start_line":38,"start_character":8,"end_line":40,"end_character":25},"in_reply_to":"df7087c5_84d3b0d5","updated":"2018-03-20 14:49:38.000000000","message":"When you use a tuple, named or not, __new__ is the standard way of adding things. I guess I don\u0027t see doing this as any \"funkier\" than modifying __init__.\n\n  class Version(collections.namedtuple(\"Version\", \"major, minor\")):\n      def __new__(cls, major, minor):\n          self \u003d super(Version, cls).__new__(cls, major, minor)\n          self.min_version \u003d None\n          self.max_version \u003d None\n          return self","commit_id":"15ea09649c594af5f0f8ce61e9d93e1448d0949a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"bff67ec0aa5d26ac7e52e7df1faf6a96f7e4c9bd","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        :raises: AttributeError: If min or max_version cannot"},{"line_number":36,"context_line":"                                 be determined."},{"line_number":37,"context_line":"        \"\"\""},{"line_number":38,"context_line":"        # NOTE(cdent): min_version and max_version are expected"},{"line_number":39,"context_line":"        # to be set by the code that is creating the Version, if"},{"line_number":40,"context_line":"        # they are known."},{"line_number":41,"context_line":"        if min_version is None:"},{"line_number":42,"context_line":"            min_version \u003d self.min_version"},{"line_number":43,"context_line":"        if max_version is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_8ace57b2","line":40,"range":{"start_line":38,"start_character":8,"end_line":40,"end_character":25},"in_reply_to":"df7087c5_aa755b9a","updated":"2018-03-20 14:54:05.000000000","message":"Huh, I had for some reason thought it was more complex than that, not sure what misled me, but if that works, then groovy.","commit_id":"15ea09649c594af5f0f8ce61e9d93e1448d0949a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"e83654b45427e76546c3c7c77087ce125dfe3331","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        # NOTE(cdent): min_version and max_version are expected"},{"line_number":43,"context_line":"        # to be set by the code that is creating the Version, if"},{"line_number":44,"context_line":"        # they are known."},{"line_number":45,"context_line":"        if min_version is None:"},{"line_number":46,"context_line":"            min_version \u003d self.min_version"},{"line_number":47,"context_line":"        if max_version is None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_300d3e3e","line":44,"updated":"2018-03-20 16:16:19.000000000","message":"Based on the py35 test failure, we either need to initialize the min/max_version to some value (0.0 / 99999.0 ?), or check that they are non-None below.","commit_id":"6b9c88b539cf3d5cf12ff98b045481f889b48c19"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"932386f3c0ce2bf764541c0132ffa347482c318f","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        # NOTE(cdent): min_version and max_version are expected"},{"line_number":43,"context_line":"        # to be set by the code that is creating the Version, if"},{"line_number":44,"context_line":"        # they are known."},{"line_number":45,"context_line":"        if min_version is None:"},{"line_number":46,"context_line":"            min_version \u003d self.min_version"},{"line_number":47,"context_line":"        if max_version is None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_5bca536e","line":44,"in_reply_to":"df7087c5_300d3e3e","updated":"2018-03-20 16:30:59.000000000","message":"blarg, didn\u0027t run the py35 tests. serves me right.","commit_id":"6b9c88b539cf3d5cf12ff98b045481f889b48c19"}],"microversion_parse/tests/test_extract_version.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7de5c2b76304696926c6d6b30458874176a34632","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        max_version \u003d microversion_parse.Version(1, 5)"},{"line_number":41,"context_line":"        min_version \u003d microversion_parse.Version(1, 5)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self.assertTrue(self.version.matches(min_version, max_version))"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def test_version_matches_no_extremes(self):"},{"line_number":46,"context_line":"        self.assertRaises(AttributeError, self.version.matches)"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_14017caf","line":43,"updated":"2018-03-15 13:42:12.000000000","message":"Copy/paste this line again, but leave out the min/max (they *are* optional). You will see the AttributeError.","commit_id":"023756d6ae19dfe6f04d2f0094885a8b6e091070"},{"author":{"_account_id":10670,"name":"Michael McCune","email":"elmiko@redhat.com","username":"mimccune"},"change_message_id":"5c9ed8d3845e594106e17e92ca9e3962ea8b1ec9","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        self.assertTrue(version.matches())"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def test_version_zero_no_defaults(self):"},{"line_number":60,"context_line":"        \"\"\"If a version is \u00270.0\u0027 we want to it be able to match.\"\"\""},{"line_number":61,"context_line":"        version \u003d microversion_parse.Version(0, 0)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        self.assertFalse(version.matches())"}],"source_content_type":"text/x-python","patch_set":5,"id":"df7087c5_6602000c","line":60,"updated":"2018-03-21 14:27:06.000000000","message":"i find this confusing with the `assertFalse` below","commit_id":"e346558d5f67ae2a3a848f6d8ad6166c761b39d1"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"4f35ef5c405e5f2f04e4a807e7d93b057a00365b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        self.assertTrue(version.matches())"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def test_version_zero_no_defaults(self):"},{"line_number":60,"context_line":"        \"\"\"If a version is \u00270.0\u0027 we want to it be able to match.\"\"\""},{"line_number":61,"context_line":"        version \u003d microversion_parse.Version(0, 0)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        self.assertFalse(version.matches())"}],"source_content_type":"text/x-python","patch_set":5,"id":"df7087c5_a602580a","line":60,"in_reply_to":"df7087c5_6602000c","updated":"2018-03-21 14:51:09.000000000","message":"Yeah, I did a double-take, too. It\u0027s essentially the same as what is being tested on L47.","commit_id":"e346558d5f67ae2a3a848f6d8ad6166c761b39d1"}]}
