From 51bf8a36c2fa279ccd3321daa082ce9bb34fb3cb Mon Sep 17 00:00:00 2001 From: Dave Warnock Date: Sat, 16 Nov 2024 23:59:51 +0000 Subject: [PATCH] Two tiny corrections found by mypy 1.13 (#1032) * Fixed reuse of local route_type as different types * added dict type to self.methods --- robyn/processpool.py | 4 ++-- robyn/ws.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/robyn/processpool.py b/robyn/processpool.py index 54673889b..f1b0839f6 100644 --- a/robyn/processpool.py +++ b/robyn/processpool.py @@ -188,8 +188,8 @@ def spawn_process( for middleware_type, middleware_function in global_middlewares: server.add_global_middleware(middleware_type, middleware_function) - for route_type, endpoint, function in route_middlewares: - server.add_middleware_route(route_type, endpoint, function) + for http_route_type, endpoint, function in route_middlewares: + server.add_middleware_route(http_route_type, endpoint, function) if Events.STARTUP in event_handlers: server.add_startup_handler(event_handlers[Events.STARTUP]) diff --git a/robyn/ws.py b/robyn/ws.py index 231b7b759..f9f08231e 100644 --- a/robyn/ws.py +++ b/robyn/ws.py @@ -23,7 +23,7 @@ class WebSocket: def __init__(self, robyn_object: "Robyn", endpoint: str, config: Config = Config(), dependencies: DependencyMap = DependencyMap()) -> None: self.robyn_object = robyn_object self.endpoint = endpoint - self.methods = {} + self.methods: dict = {} self.config = config self.dependencies = dependencies