{"body":"Here, the assertions are both defensive programming and checked \ndocumentation. I consider this to be a far superior solution than this:\n\nif target == x:\n    run_x_code()\nelif target == y:\n    run_y_code()\nelif target == z:\n    run_z_code()\nelse:\n    # This can never happen. But just in case it does...\n    raise RuntimeError(\"an unexpected error occurred\")\n\n\nThis tempts some helpful developer to \"clean it up\" by removing the \n\"unnecessary\" test for value==c and removing the \"dead code\" of the \nRuntimeError. Besides, \"unexpected error\" messages are embarrassing when \nthey occur, and they will.","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/vvpp1hm1","modified":1532975267,"id":"vvpp1hm1","size":599,"lines":18,"own_paste":false,"theme":"","date":1532975267}