)]}'
{"statusbot/bot.py":[{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"ada0bc9b32c1787894019e59c714ca647a1706c6","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"def get_opt(config, section, name):"},{"line_number":134,"context_line":"    \"\"\"Return an option value when present or None\"\"\""},{"line_number":135,"context_line":"    if config.has_option(section, name):"},{"line_number":136,"context_line":"        return config.get(section, name)"},{"line_number":137,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"6bf8b445_73783efd","line":134,"updated":"2021-11-10 15:37:39.000000000","message":"I\u0027m unclear on the reason for this over just using config.get(). Is it in order to avoid needing a try/except block for cases when the section doesn\u0027t exist?","commit_id":"ffa9604027820982f700701359f68f151efbc317"},{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"533d09ef713e8ff4103a75271ab1fd28d175e47a","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"def get_opt(config, section, name):"},{"line_number":134,"context_line":"    \"\"\"Return an option value when present or None\"\"\""},{"line_number":135,"context_line":"    if config.has_option(section, name):"},{"line_number":136,"context_line":"        return config.get(section, name)"},{"line_number":137,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"c40e8adc_f839ba4f","line":134,"updated":"2021-11-10 17:44:12.000000000","message":"Nah, this is fine, I just wasn\u0027t sure if the point of this function was to guard against a missing section raising configparser.NoSectionError but now that I play with it a bit more I see that a missing option even raises configparser.NoOptionError as well. However the entire function could simply be:\n\n    return config.get(section, name, fallback\u003dNone)\n\nThe fallback keyword argument seems to be sufficient to avoid both exceptions. This probably makes the convenience wrapper itself a questionable bit of added complexity.","commit_id":"ffa9604027820982f700701359f68f151efbc317"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"0b5cea4b7df8b1fff029f7addb2ebce6c68b3c35","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"def get_opt(config, section, name):"},{"line_number":134,"context_line":"    \"\"\"Return an option value when present or None\"\"\""},{"line_number":135,"context_line":"    if config.has_option(section, name):"},{"line_number":136,"context_line":"        return config.get(section, name)"},{"line_number":137,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"1e8fed97_9d1678e3","line":134,"in_reply_to":"6bf8b445_73783efd","updated":"2021-11-10 17:18:16.000000000","message":"This is to avoid the current repetition. Would you prefer using try/except?","commit_id":"ffa9604027820982f700701359f68f151efbc317"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"3125beeaf112a889b1a31e3f016d4db5173b8cad","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"def get_opt(config, section, name):"},{"line_number":134,"context_line":"    \"\"\"Return an option value when present or None\"\"\""},{"line_number":135,"context_line":"    if config.has_option(section, name):"},{"line_number":136,"context_line":"        return config.get(section, name)"},{"line_number":137,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"be3df733_fd5af305","line":134,"in_reply_to":"c40e8adc_f839ba4f","updated":"2021-11-10 19:28:18.000000000","message":"Thank you for the suggestion, I didn\u0027t knew about the fallback argument. I\u0027ve update the call sites and removed the wrapper.","commit_id":"ffa9604027820982f700701359f68f151efbc317"}]}
