)]}'
{"rally/common/utils.py":[{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"424df27bb85de035fdbd3ad7188d5d7bf357c7b8","unresolved":false,"context_lines":[{"line_number":488,"context_line":"    :returns: str, pseudo random name"},{"line_number":489,"context_line":"    \"\"\""},{"line_number":490,"context_line":"    if not choice:"},{"line_number":491,"context_line":"        choice \u003d string.ascii_letters + string.digits"},{"line_number":492,"context_line":"    rand_part \u003d \"\".join(random.choice(choice) for i in range(length))"},{"line_number":493,"context_line":"    return prefix + rand_part"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a0c5dc1_d2b7baf3","line":491,"updated":"2015-05-13 09:57:12.000000000","message":"This is calculated each time the function is called - it is better to calculate this once since this is a true constant value.\n\nAnother benefit is having access to this constant from outside (re-use this choice, tests).\n\nExample:\n\n RANDOM_CHOICE_DFLT \u003d string.ascii_letters + string.digits\n\n def generate_random_name(prefix\u003d\"\", length\u003d16, choice\u003dRANDOM_CHOICE_DFLT):\n     ...","commit_id":"1b06e9d02a4571ebe6e5be392bee1777309c7228"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"e29903119c921579c78604640ffdac128afe72c2","unresolved":false,"context_lines":[{"line_number":488,"context_line":"    :returns: str, pseudo random name"},{"line_number":489,"context_line":"    \"\"\""},{"line_number":490,"context_line":"    if not choice:"},{"line_number":491,"context_line":"        choice \u003d string.ascii_letters + string.digits"},{"line_number":492,"context_line":"    rand_part \u003d \"\".join(random.choice(choice) for i in range(length))"},{"line_number":493,"context_line":"    return prefix + rand_part"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a0c5dc1_355f20e7","line":491,"in_reply_to":"9a0c5dc1_b20d6640","updated":"2015-05-13 10:15:10.000000000","message":"\"choice\u003dstring.ascii_letters + string.digits\" looks ugly:)\n\n\"string.ascii_letters + string.digits\" moves to private variable, since I don\u0027t see any reasons for ability to use/edit this variable from other places.","commit_id":"1b06e9d02a4571ebe6e5be392bee1777309c7228"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"c01fa1fcc2c7db619ab47056307228d23cd4121c","unresolved":false,"context_lines":[{"line_number":488,"context_line":"    :returns: str, pseudo random name"},{"line_number":489,"context_line":"    \"\"\""},{"line_number":490,"context_line":"    if not choice:"},{"line_number":491,"context_line":"        choice \u003d string.ascii_letters + string.digits"},{"line_number":492,"context_line":"    rand_part \u003d \"\".join(random.choice(choice) for i in range(length))"},{"line_number":493,"context_line":"    return prefix + rand_part"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a0c5dc1_b20d6640","line":491,"in_reply_to":"9a0c5dc1_d2b7baf3","updated":"2015-05-13 10:08:08.000000000","message":"If we do no need constant, then we still have to calculate default value once:\n\n def generate_random_name(prefix\u003d\"\", length\u003d16,\n                          choice\u003dstring.ascii_letters + string.digits):\n     ...","commit_id":"1b06e9d02a4571ebe6e5be392bee1777309c7228"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"5c903a64cd80a187a6cf750c311b0c6310cb4960","unresolved":false,"context_lines":[{"line_number":480,"context_line":""},{"line_number":481,"context_line":"# NOTE(andreykurilin): Actually, this variable should be named as"},{"line_number":482,"context_line":"# \"_ASCII_LETTERS_AND_DIGITS\", but since world is not ideal, name of variable"},{"line_number":483,"context_line":"# can be non-ideal too."},{"line_number":484,"context_line":"_DIGITS_AND_ASCII_LETTERS \u003d string.ascii_letters + string.digits"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a0c5dc1_63a60255","line":483,"updated":"2015-05-13 11:30:42.000000000","message":"Agreed 100%","commit_id":"340a382b8bd3692f7a356c256465cdbfdb10b3a0"}]}
