)]}'
{"oslo_config/types.py":[{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"de332a13dbbf5314b527146d7ede508ee81e9630","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    \"\"\""},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def __init__(self, min\u003dNone, max\u003dNone, type_name\u003d\u0027integer value\u0027,"},{"line_number":212,"context_line":"                 choices\u003dNone):"},{"line_number":213,"context_line":"        super(Integer, self).__init__(type_name\u003dtype_name)"},{"line_number":214,"context_line":"        self.min \u003d min"},{"line_number":215,"context_line":"        self.max \u003d max"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_b0dd3172","line":212,"updated":"2015-12-01 14:43:49.000000000","message":"IMHO, choices conflicts with min/max. If we set choices, means we only accept the values in choices ,we shouldn\u0027t set min/max at the same time. A ValueError should be raised.\n\n\nMaybe something like :\n\nif choices is not None:\n   if min is not None or max is not None:\n          raise ValueError(\"Can\u0027t set choices and min/max at the same time\")","commit_id":"aaf57ccc00bda074fb445a6bb49ccac4b847112d"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"e15985c7b739b7079b22593fd5ded5e0d963cac6","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    \"\"\""},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def __init__(self, min\u003dNone, max\u003dNone, type_name\u003d\u0027integer value\u0027,"},{"line_number":212,"context_line":"                 choices\u003dNone):"},{"line_number":213,"context_line":"        super(Integer, self).__init__(type_name\u003dtype_name)"},{"line_number":214,"context_line":"        self.min \u003d min"},{"line_number":215,"context_line":"        self.max \u003d max"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_dbbeb2fe","line":212,"in_reply_to":"9a8ffd7b_6c7036dd","updated":"2015-12-02 03:07:38.000000000","message":"Tan Lin,\n\nI saw you next commit  which depends on this,  I see what you mean :-).\n\nBut class Integer is called by others like  IntOpt and PortOpt,   the problem is \nPortOpt set min\u003d1 and max\u003d65535 by default,  that means PortOpt always set min/max so we need fix that only in PortOpt,  and  raise ValueError when choices  and min/max is set at the same time here.   \n\nThis does similar things like StrOpt in :\nhttps://github.com/openstack/oslo.config/blob/master/oslo_config/types.py#L73\n\nWhat do you think ?","commit_id":"aaf57ccc00bda074fb445a6bb49ccac4b847112d"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"7eef3d9721442feea56f36bc2a64d7755288fb24","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    \"\"\""},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def __init__(self, min\u003dNone, max\u003dNone, type_name\u003d\u0027integer value\u0027,"},{"line_number":212,"context_line":"                 choices\u003dNone):"},{"line_number":213,"context_line":"        super(Integer, self).__init__(type_name\u003dtype_name)"},{"line_number":214,"context_line":"        self.min \u003d min"},{"line_number":215,"context_line":"        self.max \u003d max"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_6c7036dd","line":212,"in_reply_to":"9a8ffd7b_b0dd3172","updated":"2015-12-02 00:49:46.000000000","message":"Thanks ChangBo, this is also my initial idea. But then I found PortOpt also use Integer type and assign min\u003d1 max\u003d65535. In this case, if we only take care about the value of choices, then we miss the chance to use choices and could potential set PortOpt\u003d-1, which is not what we want. So that\u0027s why I make it like this. You can assign the choices values as well as min/max but the choices must  in the range.","commit_id":"aaf57ccc00bda074fb445a6bb49ccac4b847112d"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"40fb10ec2fe9129da8b97a60515bdbbbfd12e5bb","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    \"\"\""},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def __init__(self, min\u003dNone, max\u003dNone, type_name\u003d\u0027integer value\u0027,"},{"line_number":212,"context_line":"                 choices\u003dNone):"},{"line_number":213,"context_line":"        super(Integer, self).__init__(type_name\u003dtype_name)"},{"line_number":214,"context_line":"        self.min \u003d min"},{"line_number":215,"context_line":"        self.max \u003d max"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_96756599","line":212,"in_reply_to":"9a8ffd7b_dbbeb2fe","updated":"2015-12-07 03:45:03.000000000","message":"OK, I will make this way.","commit_id":"aaf57ccc00bda074fb445a6bb49ccac4b847112d"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"962c6320f5bcd10e2642e81e400122cf59c4a079","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if min is not None and max is not None and max \u003c min:"},{"line_number":218,"context_line":"            raise ValueError(\u0027Max value is less than min value\u0027)"},{"line_number":219,"context_line":"        if choices is not None:"},{"line_number":220,"context_line":"            choices.sort()"},{"line_number":221,"context_line":"            if min is not None and choices[0] \u003c min:"},{"line_number":222,"context_line":"                raise ValueError(\u0027minimal of choices is less than \u0027"},{"line_number":223,"context_line":"                                 \u0027min value\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a8ffd7b_d85998fe","line":220,"updated":"2015-12-02 23:45:08.000000000","message":"This assumes choices is a list, which is not the case with StrOpt.  I\u0027ve seen choices set as either a list or tuple for StrOpt.  To be consistent, I think the same should be handled here.","commit_id":"cbb16ae4f49b0cf80f6464136b3c7af348f16911"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"b31afa65956e49ae2eec58d27de1ccf786483052","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            raise ValueError(\u0027Max value is less than min value\u0027)"},{"line_number":219,"context_line":"        if choices is not None:"},{"line_number":220,"context_line":"            choices.sort()"},{"line_number":221,"context_line":"            if min is not None and choices[0] \u003c min:"},{"line_number":222,"context_line":"                raise ValueError(\u0027minimal of choices is less than \u0027"},{"line_number":223,"context_line":"                                 \u0027min value\u0027)"},{"line_number":224,"context_line":"            if max is not None and choices[-1] \u003e max:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a8ffd7b_4dde4712","line":221,"updated":"2015-12-03 01:39:30.000000000","message":"I think choices and min/max should be mutually exclusive. Will make the code easier.  I don\u0027t see the use case for having both at the same time.\n\nAlso no need to be sorting.","commit_id":"cbb16ae4f49b0cf80f6464136b3c7af348f16911"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"be552f9040e89885142cf36777d3b13381697c51","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            (self.__class__ \u003d\u003d other.__class__) and"},{"line_number":270,"context_line":"            (self.min \u003d\u003d other.min) and"},{"line_number":271,"context_line":"            (self.max \u003d\u003d other.max) and"},{"line_number":272,"context_line":"            (self.choices \u003d\u003d other.choices)"},{"line_number":273,"context_line":"        )"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_1e866bb9","line":272,"updated":"2015-12-07 06:52:58.000000000","message":"Hopefully its understood to all that order and type will cause this to return False. For example:\n\n[1, 2, 3]  !\u003d [3, 2, 1]\n\n[1, 2, 3]  !\u003d (1, 2, 3)","commit_id":"290faf96fd13b0ab2820997ebc27d41eca04c447"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"08ee9c507593583554b813dffce5325b7ce28102","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            (self.__class__ \u003d\u003d other.__class__) and"},{"line_number":270,"context_line":"            (self.min \u003d\u003d other.min) and"},{"line_number":271,"context_line":"            (self.max \u003d\u003d other.max) and"},{"line_number":272,"context_line":"            (self.choices \u003d\u003d other.choices)"},{"line_number":273,"context_line":"        )"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_325916ff","line":272,"in_reply_to":"7a740942_1e866bb9","updated":"2015-12-07 08:38:23.000000000","message":"Thanks, set will helpful on that.","commit_id":"290faf96fd13b0ab2820997ebc27d41eca04c447"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"88e5e7fb70b72095b49075ce0c4a0fa8d770c8c8","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    .. versionchanged:: 2.7"},{"line_number":207,"context_line":"       Added *type_name* parameter."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    .. versionchanged:: 3.1"},{"line_number":210,"context_line":"       Added *choices* parameter."},{"line_number":211,"context_line":"    \"\"\""},{"line_number":212,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_56ab4875","line":209,"updated":"2015-12-07 23:33:03.000000000","message":"oslo.config 3.1 was just released unfortunately.  So this needs to go to 3.2.0","commit_id":"dd8b84422be5399f7aec6482dd84b0876b5a3b0f"},{"author":{"_account_id":11650,"name":"Tom Cammann","email":"tom.cammann@hpe.com","username":"cammann"},"change_message_id":"4023bcdfc4c9a8443642d8421b2c4fbe9932525e","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        return value"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _check_range(self, value):"},{"line_number":241,"context_line":"        if self.choices is not None:"},{"line_number":242,"context_line":"            if value in self.choices:"},{"line_number":243,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_4a1e5060","line":240,"updated":"2015-12-07 15:53:30.000000000","message":"Method name is now misleading, it would preferable this had its own check method.\n\n    if value is not None:\n        if choices is None:\n             self._check_range(value)\n        else:\n             self._check_choice(value)","commit_id":"dd8b84422be5399f7aec6482dd84b0876b5a3b0f"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"e8462471f20ebb61a37cca500a1086029fd06796","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            (self.__class__ \u003d\u003d other.__class__) and"},{"line_number":270,"context_line":"            (self.min \u003d\u003d other.min) and"},{"line_number":271,"context_line":"            (self.max \u003d\u003d other.max) and"},{"line_number":272,"context_line":"            (set(self.choices) \u003d\u003d set(other.choices) if self.choices else"},{"line_number":273,"context_line":"             self.choices \u003d\u003d other.choices)"},{"line_number":274,"context_line":"        )"},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_79477077","line":272,"updated":"2015-12-07 15:17:50.000000000","message":"what about other.choices \u003d None and self.choices is not None ?\nNeed also check other.choices before converting to a set ?","commit_id":"dd8b84422be5399f7aec6482dd84b0876b5a3b0f"}]}
