Cleanup type checking

This commit is contained in:
Adam Hopkins
2021-02-21 21:29:41 +02:00
parent 209579f280
commit d402d0362e
9 changed files with 63 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
from enum import Enum, auto
from functools import partial
from typing import Any, Callable, Coroutine, List, Optional, Set, Union
from typing import Any, Callable, Coroutine, List, Optional, Union
from sanic.models.futures import FutureListener

View File

@@ -30,7 +30,7 @@ class RouteMixin:
self._future_routes: Set[FutureRoute] = set()
self._future_statics: Set[FutureStatic] = set()
self.name = ""
self.strict_slashes = False
self.strict_slashes: Optional[bool] = False
def _apply_route(self, route: FutureRoute) -> Route:
raise NotImplementedError # noqa
@@ -41,7 +41,7 @@ class RouteMixin:
def route(
self,
uri: str,
methods: Iterable[str] = frozenset({"GET"}),
methods: Optional[Iterable[str]] = None,
host: Optional[str] = None,
strict_slashes: Optional[bool] = None,
stream: bool = False,