)]}'
{"horizon/utils/memoized.py":[{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"63985dfa422bb7ae19e6d55cab98b56010dd9a23","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            warnings.warn("},{"line_number":97,"context_line":"                \"The key %r is not hashable and cannot be memoized.\" % key,"},{"line_number":98,"context_line":"                UnhashableKeyWarning, 2)"},{"line_number":99,"context_line":"            value \u003d func(*args, **kwargs)"},{"line_number":100,"context_line":"        return value"},{"line_number":101,"context_line":"    return wrapped"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F8x%2Bo%3D","line":99,"updated":"2013-12-20 11:56:31.000000000","message":"This is not a part of the change, but anyway - Isn\u0027t it strange, that in case of TypeError, we will call the func() again? \nAlso - how can we be sure that it isn\u0027t the func() that raised the TypeError? Why not first calling:\n\n    try:\n        value \u003d func(*args, **kwargs)\n    except:\n        # log user func error?, or just skip try-except.. \n        raise\n\nand then\n \n    try:\n        cache[key] \u003d value\n    except TypeError:\n        # Unhashable warning goes here\n\nIn this case we will call func() only once. Calling it twice could lead to unexpected results.","commit_id":"b7537a8b8155fcf112067eb7d9d12339e280e44f"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"5a569022fdf87609d10cf497dc4f4dfadd184a6a","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            warnings.warn("},{"line_number":97,"context_line":"                \"The key %r is not hashable and cannot be memoized.\" % key,"},{"line_number":98,"context_line":"                UnhashableKeyWarning, 2)"},{"line_number":99,"context_line":"            value \u003d func(*args, **kwargs)"},{"line_number":100,"context_line":"        return value"},{"line_number":101,"context_line":"    return wrapped"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F8x7I%3D","line":99,"in_reply_to":"AAAATn%2F8x%2Bo%3D","updated":"2013-12-20 12:09:26.000000000","message":"Um, why would I put a try around the function call or the assignment to cache? I don\u0027t understand what you are proposing, would you be so kind and provide a more complete example?\n\nNote, that this except is for the try block around value \u003d cache[key].","commit_id":"b7537a8b8155fcf112067eb7d9d12339e280e44f"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"1ddfcc06fb1c93126b553b4a231b68fc38ea5b63","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            warnings.warn("},{"line_number":97,"context_line":"                \"The key %r is not hashable and cannot be memoized.\" % key,"},{"line_number":98,"context_line":"                UnhashableKeyWarning, 2)"},{"line_number":99,"context_line":"            value \u003d func(*args, **kwargs)"},{"line_number":100,"context_line":"        return value"},{"line_number":101,"context_line":"    return wrapped"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F8xsQ%3D","line":99,"in_reply_to":"AAAATn%2F8x7I%3D","updated":"2013-12-20 12:52:15.000000000","message":"It is not just \n\n    value \u003d cache[key], \n\nbut \n\n    value \u003d cache[key] \u003d func(*args, **kwargs)\n\nDouble assignment.\n\nAnd regarding the try-except on cache[key] - see the comment of the except above.","commit_id":"b7537a8b8155fcf112067eb7d9d12339e280e44f"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"1c1e3df8a6b7851d6b0219655abe66779227d11c","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            warnings.warn("},{"line_number":97,"context_line":"                \"The key %r is not hashable and cannot be memoized.\" % key,"},{"line_number":98,"context_line":"                UnhashableKeyWarning, 2)"},{"line_number":99,"context_line":"            value \u003d func(*args, **kwargs)"},{"line_number":100,"context_line":"        return value"},{"line_number":101,"context_line":"    return wrapped"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F8xgg%3D","line":99,"in_reply_to":"AAAATn%2F8xrQ%3D","updated":"2013-12-20 13:30:09.000000000","message":"Ops, you\u0027re right. I\u0027ve missed somehow the except block on line 89. Just assumed except on 91 as for line 90...\nOkay, everything is fine.","commit_id":"b7537a8b8155fcf112067eb7d9d12339e280e44f"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"a19d7e94d5ddba520a64deac50d868402964df48","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            warnings.warn("},{"line_number":97,"context_line":"                \"The key %r is not hashable and cannot be memoized.\" % key,"},{"line_number":98,"context_line":"                UnhashableKeyWarning, 2)"},{"line_number":99,"context_line":"            value \u003d func(*args, **kwargs)"},{"line_number":100,"context_line":"        return value"},{"line_number":101,"context_line":"    return wrapped"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F8xrQ%3D","line":99,"in_reply_to":"AAAATn%2F8xsQ%3D","updated":"2013-12-20 12:56:49.000000000","message":"No, I\u0027m pretty sure that the try block only contains value \u003d cache[key] on line 88, please look again.","commit_id":"b7537a8b8155fcf112067eb7d9d12339e280e44f"}]}
