From 3c2978c9ca21e1dd1bab36403e9a20e1133f709f Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Sat, 24 May 2025 17:10:20 +0300 Subject: [PATCH] examples: Add type annotations Signed-off-by: Povilas Kanapickas --- examples/hello-python/app/web.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/hello-python/app/web.py b/examples/hello-python/app/web.py index 6173ab7..10746b8 100644 --- a/examples/hello-python/app/web.py +++ b/examples/hello-python/app/web.py @@ -3,8 +3,8 @@ import asyncio # noqa: F401 import os -import aioredis -from aiohttp import web +import aioredis # type: ignore[import-not-found] +from aiohttp import web # type: ignore[import-not-found] REDIS_HOST = os.environ.get("REDIS_HOST", "localhost") REDIS_PORT = int(os.environ.get("REDIS_PORT", "6379")) @@ -16,13 +16,13 @@ routes = web.RouteTableDef() @routes.get("/") -async def hello(request): # pylint: disable=unused-argument +async def hello(request: web.Request) -> web.Response: # pylint: disable=unused-argument counter = await redis.incr("mycounter") return web.Response(text=f"counter={counter}") @routes.get("/hello.json") -async def hello_json(request): # pylint: disable=unused-argument +async def hello_json(request: web.Request) -> web.Response: # pylint: disable=unused-argument counter = await redis.incr("mycounter") data = {"counter": counter} return web.json_response(data) @@ -31,7 +31,7 @@ async def hello_json(request): # pylint: disable=unused-argument app.add_routes(routes) -def main(): +def main() -> None: web.run_app(app, port=8080)