)]}'
{"quantum/api/v2/attributes.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6cd07ec5a95d8124db44053fe5ad457fbda481a9","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    elif isinstance(max_len, int):"},{"line_number":59,"context_line":"        if 0 \u003c\u003d len(data) \u003c\u003d max_len:"},{"line_number":60,"context_line":"            pass"},{"line_number":61,"context_line":"        elif max_len \u003c 0:"},{"line_number":62,"context_line":"            msg \u003d _(\"Maximum length \u0027%s\u0027 is a negative integer\") % max_len"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALn%2F%2FvRM%3D","line":61,"updated":"2012-11-09 02:43:44.000000000","message":"\u0027max_len \u003d 0\u0027 looks invalid too.","commit_id":"7b6ddb193bc204470e0d50c1b1f62714a9278b19"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6cd07ec5a95d8124db44053fe5ad457fbda481a9","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    elif isinstance(max_len, int):"},{"line_number":59,"context_line":"        if 0 \u003c\u003d len(data) \u003c\u003d max_len:"},{"line_number":60,"context_line":"            pass"},{"line_number":61,"context_line":"        elif max_len \u003c 0:"},{"line_number":62,"context_line":"            msg \u003d _(\"Maximum length \u0027%s\u0027 is a negative integer\") % max_len"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALn%2F%2FvPY%3D","line":61,"in_reply_to":"AAAALn%2F%2FvPk%3D","updated":"2012-11-09 03:07:47.000000000","message":"Yes. :)","commit_id":"7b6ddb193bc204470e0d50c1b1f62714a9278b19"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6cd07ec5a95d8124db44053fe5ad457fbda481a9","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    elif isinstance(max_len, int):"},{"line_number":59,"context_line":"        if 0 \u003c\u003d len(data) \u003c\u003d max_len:"},{"line_number":60,"context_line":"            pass"},{"line_number":61,"context_line":"        elif max_len \u003c 0:"},{"line_number":62,"context_line":"            msg \u003d _(\"Maximum length \u0027%s\u0027 is a negative integer\") % max_len"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALn%2F%2FvQQ%3D","line":61,"in_reply_to":"AAAALn%2F%2FvQ0%3D","updated":"2012-11-09 02:57:30.000000000","message":"I have another question. Should we validate \u0027max_len\u0027? Actually this is function only invoke by developer. How about use contract programming(use assert)?","commit_id":"7b6ddb193bc204470e0d50c1b1f62714a9278b19"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":58,"context_line":"    elif isinstance(max_len, int):"},{"line_number":59,"context_line":"        if 0 \u003c\u003d len(data) \u003c\u003d max_len:"},{"line_number":60,"context_line":"            pass"},{"line_number":61,"context_line":"        elif max_len \u003c 0:"},{"line_number":62,"context_line":"            msg \u003d _(\"Maximum length \u0027%s\u0027 is a negative integer\") % max_len"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALn%2F%2FvPk%3D","line":61,"in_reply_to":"AAAALn%2F%2FvQQ%3D","updated":"2012-11-09 03:05:56.000000000","message":"I get your point. you mean that the \"max_len\" is defined by only developers, right? Then would an assert between lines 58 and 59 be proper?","commit_id":"7b6ddb193bc204470e0d50c1b1f62714a9278b19"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":58,"context_line":"    elif isinstance(max_len, int):"},{"line_number":59,"context_line":"        if 0 \u003c\u003d len(data) \u003c\u003d max_len:"},{"line_number":60,"context_line":"            pass"},{"line_number":61,"context_line":"        elif max_len \u003c 0:"},{"line_number":62,"context_line":"            msg \u003d _(\"Maximum length \u0027%s\u0027 is a negative integer\") % max_len"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALn%2F%2FvQ0%3D","line":61,"in_reply_to":"AAAALn%2F%2FvRM%3D","updated":"2012-11-09 02:48:14.000000000","message":"That was a case I was struggling with.\n\nHowever, the original code allowed this so I just kept it that way.\n\nBut it could be useful to assure an input string is blank in some cases","commit_id":"7b6ddb193bc204470e0d50c1b1f62714a9278b19"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid string\") % data"},{"line_number":57,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":58,"context_line":"        return msg"},{"line_number":59,"context_line":"    elif max_len is not None:"},{"line_number":60,"context_line":"        if len(data) \u003e max_len:"},{"line_number":61,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""},{"line_number":62,"context_line":"                    \"%(max_len)s\") % locals()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2Fufs%3D","line":59,"updated":"2012-11-09 19:08:36.000000000","message":"Why do we need this change?","commit_id":"ae63493f2b8b1ad9a5ffd801a821fd75e684feaf"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid string\") % data"},{"line_number":57,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":58,"context_line":"        return msg"},{"line_number":59,"context_line":"    elif max_len is not None:"},{"line_number":60,"context_line":"        if len(data) \u003e max_len:"},{"line_number":61,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""},{"line_number":62,"context_line":"                    \"%(max_len)s\") % locals()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2Ft18%3D","line":59,"in_reply_to":"AAAALn%2F%2FuCs%3D","updated":"2012-11-10 17:23:58.000000000","message":"The conditions are not orthogonal, but there is a \"return\" at the end of the first if (probably that\u0027s what you meant by orthogonal anyway)","commit_id":"ae63493f2b8b1ad9a5ffd801a821fd75e684feaf"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid string\") % data"},{"line_number":57,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":58,"context_line":"        return msg"},{"line_number":59,"context_line":"    elif max_len is not None:"},{"line_number":60,"context_line":"        if len(data) \u003e max_len:"},{"line_number":61,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""},{"line_number":62,"context_line":"                    \"%(max_len)s\") % locals()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2FuCs%3D","line":59,"in_reply_to":"AAAALn%2F%2FuFA%3D","updated":"2012-11-10 03:05:32.000000000","message":"I actually found the change to be a little confusing. But I guess that it is a matter of taste.","commit_id":"ae63493f2b8b1ad9a5ffd801a821fd75e684feaf"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid string\") % data"},{"line_number":57,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":58,"context_line":"        return msg"},{"line_number":59,"context_line":"    elif max_len is not None:"},{"line_number":60,"context_line":"        if len(data) \u003e max_len:"},{"line_number":61,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 exceeds maximum length of \""},{"line_number":62,"context_line":"                    \"%(max_len)s\") % locals()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2FuFA%3D","line":59,"in_reply_to":"AAAALn%2F%2Fufs%3D","updated":"2012-11-10 01:15:14.000000000","message":"This is only for readability. I thought this method had to go through two if statements when first looking at the lines aligned on the first indent. Since the conditions are orthogonal, I think it is better to \u0027elif\u0027 here.","commit_id":"ae63493f2b8b1ad9a5ffd801a821fd75e684feaf"}]}
