]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
*: Remove obsolete noqa comments
authorBen Darnell <ben@bendarnell.com>
Thu, 19 Mar 2026 19:10:22 +0000 (15:10 -0400)
committerBen Darnell <ben@bendarnell.com>
Thu, 19 Mar 2026 22:33:27 +0000 (18:33 -0400)
Mostly thanks to pyflakes improving compatibility with type
annotations and overloads.

tornado/concurrent.py
tornado/httputil.py
tornado/ioloop.py
tornado/routing.py
tornado/test/import_test.py
tornado/testing.py
tornado/web.py

index a08354ef909ed83ae27aa924a380fae37f5a3ba7..c64c2b23fc3797a104d80fd54195d5daa75283aa 100644 (file)
@@ -241,14 +241,14 @@ def future_add_done_callback(
     pass
 
 
-@typing.overload  # noqa: F811
+@typing.overload
 def future_add_done_callback(
     future: "Future[_T]", callback: Callable[["Future[_T]"], None]
 ) -> None:
     pass
 
 
-def future_add_done_callback(  # noqa: F811
+def future_add_done_callback(
     future: "Union[futures.Future[_T], Future[_T]]", callback: Callable[..., None]
 ) -> None:
     """Arrange to call ``callback`` when ``future`` is complete.
index 66fa156b844c605fbf0c3fb0e103c4a687ba3e0a..b36908a63814bd5253ce66376cbc9ad78b340143 100644 (file)
@@ -162,19 +162,19 @@ class HTTPHeaders(collections.abc.MutableMapping[str, str]):
     def __init__(self, __arg: Mapping[str, list[str]]) -> None:
         pass
 
-    @typing.overload  # noqa: F811
+    @typing.overload
     def __init__(self, __arg: Mapping[str, str]) -> None:
         pass
 
-    @typing.overload  # noqa: F811
+    @typing.overload
     def __init__(self, *args: tuple[str, str]) -> None:
         pass
 
-    @typing.overload  # noqa: F811
+    @typing.overload
     def __init__(self, **kwargs: str) -> None:
         pass
 
-    def __init__(self, *args: typing.Any, **kwargs: str) -> None:  # noqa: F811
+    def __init__(self, *args: typing.Any, **kwargs: str) -> None:
         # Formally, HTTP headers are a mapping from a field name to a "combined field value",
         # which may be constructed from multiple field lines by joining them with commas.
         # In practice, however, some headers (notably Set-Cookie) do not follow this convention,
index e7564de7c6f32487a02792822a63c2733a48ad9b..0865f33b826cf28a75671bdffa7a4487326586f8 100644 (file)
@@ -234,11 +234,11 @@ class IOLoop(Configurable):
 
     @typing.overload
     @staticmethod
-    def current(instance: bool = True) -> IOLoop | None:  # noqa: F811
+    def current(instance: bool = True) -> IOLoop | None:
         pass
 
     @staticmethod
-    def current(instance: bool = True) -> IOLoop | None:  # noqa: F811
+    def current(instance: bool = True) -> IOLoop | None:
         """Returns the current thread's `IOLoop`.
 
         If an `IOLoop` is currently running or has been marked as
@@ -390,13 +390,13 @@ class IOLoop(Configurable):
     ) -> None:
         pass
 
-    @typing.overload  # noqa: F811
+    @typing.overload
     def add_handler(
         self, fd: _S, handler: Callable[[_S, int], None], events: int
     ) -> None:
         pass
 
-    def add_handler(  # noqa: F811
+    def add_handler(
         self, fd: int | _Selectable, handler: Callable[..., None], events: int
     ) -> None:
         """Registers the given handler to receive the given events for ``fd``.
@@ -488,7 +488,6 @@ class IOLoop(Configurable):
         """
 
         class FutureCell(TypedDict):
-            # noqa: F841
             future: Future | None
             timeout_called: bool
 
index 30d241e49ecc06f6a5c15b04cda5ba05312aaeac..7055499afffc4cc14d984cfe98843c2257c555d0 100644 (file)
@@ -706,12 +706,12 @@ def _unquote_or_none(s: str) -> bytes:
     pass
 
 
-@overload  # noqa: F811
+@overload
 def _unquote_or_none(s: None) -> None:
     pass
 
 
-def _unquote_or_none(s: str | None) -> bytes | None:  # noqa: F811
+def _unquote_or_none(s: str | None) -> bytes | None:
     """None-safe wrapper around url_unescape to handle unmatched optional
     groups correctly.
 
index 261d3d346980c5fa54cd0cafc82baa90499adfa7..6af690a315f6ad47ce0befbfd13ffdae0483f419 100644 (file)
@@ -1,4 +1,3 @@
-# flake8: noqa
 import subprocess
 import sys
 import unittest
index 4de6626d9582fee64a20c5e7e14f84312412ff16..2901f4a5373e5dfb599a130c56fd23f084794ef9 100644 (file)
@@ -523,12 +523,12 @@ def gen_test(
     pass
 
 
-@typing.overload  # noqa: F811
+@typing.overload
 def gen_test(func: Callable[..., Union[Generator, "Coroutine"]]) -> Callable[..., None]:
     pass
 
 
-def gen_test(  # noqa: F811
+def gen_test(
     func: Callable[..., Union[Generator, "Coroutine"]] | None = None,
     timeout: float | None = None,
 ) -> (
index 63765eed63ee2064381d680296a77dddff088c7c..12a37ff225aab8355f5fdd10cbb42f549c984185 100644 (file)
@@ -436,18 +436,16 @@ class RequestHandler:
         pass
 
     @overload
-    def get_argument(  # noqa: F811
+    def get_argument(
         self, name: str, default: _ArgDefaultMarker = _ARG_DEFAULT, strip: bool = True
     ) -> str:
         pass
 
     @overload
-    def get_argument(  # noqa: F811
-        self, name: str, default: None, strip: bool = True
-    ) -> str | None:
+    def get_argument(self, name: str, default: None, strip: bool = True) -> str | None:
         pass
 
-    def get_argument(  # noqa: F811
+    def get_argument(
         self,
         name: str,
         default: None | str | _ArgDefaultMarker = _ARG_DEFAULT,
@@ -485,18 +483,18 @@ class RequestHandler:
         pass
 
     @overload
-    def get_body_argument(  # noqa: F811
+    def get_body_argument(
         self, name: str, default: _ArgDefaultMarker = _ARG_DEFAULT, strip: bool = True
     ) -> str:
         pass
 
     @overload
-    def get_body_argument(  # noqa: F811
+    def get_body_argument(
         self, name: str, default: None, strip: bool = True
     ) -> str | None:
         pass
 
-    def get_body_argument(  # noqa: F811
+    def get_body_argument(
         self,
         name: str,
         default: None | str | _ArgDefaultMarker = _ARG_DEFAULT,
@@ -529,18 +527,18 @@ class RequestHandler:
         pass
 
     @overload
-    def get_query_argument(  # noqa: F811
+    def get_query_argument(
         self, name: str, default: _ArgDefaultMarker = _ARG_DEFAULT, strip: bool = True
     ) -> str:
         pass
 
     @overload
-    def get_query_argument(  # noqa: F811
+    def get_query_argument(
         self, name: str, default: None, strip: bool = True
     ) -> str | None:
         pass
 
-    def get_query_argument(  # noqa: F811
+    def get_query_argument(
         self,
         name: str,
         default: None | str | _ArgDefaultMarker = _ARG_DEFAULT,