)]}'
{"cinderclient/utils.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"ad21305620c66ea2efcb60800a63be4089e92eaa","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        pt.add_row(row)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    if len(pt._rows) \u003e 0:"},{"line_number":162,"context_line":"        print strutils.safe_encode(pt.get_string(sortby\u003dfields[0]))"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"def print_dict(d, property\u003d\"Property\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAO3%2F%2F93o%3D","line":162,"updated":"2013-05-15 22:41:33.000000000","message":"Fine by me, but I\u0027m just curious, was there something you didn\u0027t like about using len(objs)?","commit_id":"95e142a1738cc01a84de427a7c96435a5b01cbf3"},{"author":{"_account_id":7217,"name":"Hugh Saunders","email":"hugh@wherenow.org","username":"hughsaunders"},"change_message_id":"257f99b97e4a37ba4e4988331619d599dc8401f8","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        pt.add_row(row)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    if len(pt._rows) \u003e 0:"},{"line_number":162,"context_line":"        print strutils.safe_encode(pt.get_string(sortby\u003dfields[0]))"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"def print_dict(d, property\u003d\"Property\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAO3%2F%2F9NE%3D","line":162,"in_reply_to":"AAAAO3%2F%2F93o%3D","updated":"2013-05-16 06:10:06.000000000","message":"Hi John, \nPlease see https://bugs.launchpad.net/python-cinderclient/+bug/1180059\n\nThe problem is that objs may be a generator, so calling len() on it causes \"ERROR: object of type \u0027generator\u0027 has no len()\".\n\nExample: cinder absolute-limits:\nhttps://github.com/openstack/python-cinderclient/blob/master/cinderclient/v1/shell.py#L598-L603\n\nThis passes cs.limits.get().absolute to utils.print_list.\nBut absolute is a property that returns a generator: \n\nhttps://github.com/openstack/python-cinderclient/blob/master/cinderclient/v1/limits.py#L12-L15\n\nSo we end up with len() on a generator.\n\npt._rows is always a list, so it is safe to call len() on it.","commit_id":"95e142a1738cc01a84de427a7c96435a5b01cbf3"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"c33bd5e0a04ecf0d65a02c2308f50baf14e62ef3","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        pt.add_row(row)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    if len(pt._rows) \u003e 0:"},{"line_number":162,"context_line":"        print strutils.safe_encode(pt.get_string(sortby\u003dfields[0]))"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"def print_dict(d, property\u003d\"Property\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAO3%2F%2F8HE%3D","line":162,"in_reply_to":"AAAAO3%2F%2F9NE%3D","updated":"2013-05-16 17:02:47.000000000","message":"Ohh, thanks!!  Don\u0027t know how I missed that.","commit_id":"95e142a1738cc01a84de427a7c96435a5b01cbf3"}]}
