From 65fa6441b132c244ab796014efaa3a4d215fd43f Mon Sep 17 00:00:00 2001 From: Midgard Date: Sat, 18 Jul 2020 23:50:49 +0200 Subject: [PATCH] Remove incorrect comment The comment says that mypy gives a "Missing return statement" but it links to an issue on the mypy bug tracker about the same error message reported after exhaustive enum matching. This is a completely different situation, here the "Missing return statement" is warranted: this part of the code is reachable so an explicit `return None` is wanted for this function that returns an Optional. --- app/views/order.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/views/order.py b/app/views/order.py index b4cbe5c..adcf56b 100644 --- a/app/views/order.py +++ b/app/views/order.py @@ -330,9 +330,6 @@ def close_order(order_id: int) -> typing.Optional[Response]: order.courier_id = courier.id db.session.commit() return redirect(url_for("order_bp.order_from_id", order_id=order_id)) - # The line below is to make sure mypy doesn't say - # "Missing return statement" - # https://github.com/python/mypy/issues/4223 return None