From c17230ef9443d7e9932ac425ddbca4ad850f96a2 Mon Sep 17 00:00:00 2001 From: guacs <126393040+guacs@users.noreply.github.com> Date: Sat, 8 Jul 2023 23:35:24 -0700 Subject: [PATCH] Update request type on middleware types (#2754) Co-authored-by: Adam Hopkins --- sanic/models/handler_types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/models/handler_types.py b/sanic/models/handler_types.py index 4a0fbfa6..7d123d0b 100644 --- a/sanic/models/handler_types.py +++ b/sanic/models/handler_types.py @@ -3,11 +3,12 @@ from typing import Any, Callable, Coroutine, Optional, TypeVar, Union import sanic -from sanic.request import Request +from sanic import request from sanic.response import BaseHTTPResponse, HTTPResponse Sanic = TypeVar("Sanic", bound="sanic.Sanic") +Request = TypeVar("Request", bound="request.Request") MiddlewareResponse = Union[ Optional[HTTPResponse], Coroutine[Any, Any, Optional[HTTPResponse]]