]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
*: Remove redundant (object) base classes
authorBen Darnell <ben@bendarnell.com>
Thu, 13 Jun 2024 17:51:48 +0000 (13:51 -0400)
committerBen Darnell <ben@bendarnell.com>
Thu, 13 Jun 2024 17:51:48 +0000 (13:51 -0400)
This was only necessary in python 3.

This change was made with a version of pyupgrade that was modified
to perform only this change.

33 files changed:
demos/chat/chatdemo.py
tornado/auth.py
tornado/gen.py
tornado/http1connection.py
tornado/httpclient.py
tornado/httpserver.py
tornado/httputil.py
tornado/ioloop.py
tornado/iostream.py
tornado/locale.py
tornado/locks.py
tornado/options.py
tornado/process.py
tornado/routing.py
tornado/tcpclient.py
tornado/tcpserver.py
tornado/template.py
tornado/test/circlerefs_test.py
tornado/test/concurrent_test.py
tornado/test/gen_test.py
tornado/test/httpserver_test.py
tornado/test/ioloop_test.py
tornado/test/iostream_test.py
tornado/test/netutil_test.py
tornado/test/options_test.py
tornado/test/simple_httpclient_test.py
tornado/test/tcpclient_test.py
tornado/test/web_test.py
tornado/test/websocket_test.py
tornado/util.py
tornado/web.py
tornado/websocket.py
tornado/wsgi.py

index 28c12108f27d29a2f31fe7bf92ada287d444b3ec..8cc6f65aa5f99565ca7612a04c1ed36b13bb921a 100755 (executable)
@@ -25,7 +25,7 @@ define("port", default=8888, help="run on the given port", type=int)
 define("debug", default=True, help="run in debug mode")
 
 
-class MessageBuffer(object):
+class MessageBuffer:
     def __init__(self):
         # cond is notified whenever the message cache is updated
         self.cond = tornado.locks.Condition()
index 2f115f576a626eb101e738e799da8643c1ce6442..0a98beb27393bdd67625054161400bdce59dcc25 100644 (file)
@@ -91,7 +91,7 @@ class AuthError(Exception):
     pass
 
 
-class OpenIdMixin(object):
+class OpenIdMixin:
     """Abstract implementation of OpenID and Attribute Exchange.
 
     Class attributes:
@@ -284,7 +284,7 @@ class OpenIdMixin(object):
         return httpclient.AsyncHTTPClient()
 
 
-class OAuthMixin(object):
+class OAuthMixin:
     """Abstract implementation of OAuth 1.0 and 1.0a.
 
     See `TwitterMixin` below for an example implementation.
@@ -552,7 +552,7 @@ class OAuthMixin(object):
         return httpclient.AsyncHTTPClient()
 
 
-class OAuth2Mixin(object):
+class OAuth2Mixin:
     """Abstract implementation of OAuth 2.0.
 
     See `FacebookGraphMixin` or `GoogleOAuth2Mixin` below for example
index 7d87477486ff07f9ade4b1627584d0a5d9c81c75..1eb5e7984432acee66bd3274c5f3e5328a95b933 100644 (file)
@@ -300,7 +300,7 @@ class Return(Exception):
         self.args = (value,)
 
 
-class WaitIterator(object):
+class WaitIterator:
     """Provides an iterator to yield the results of awaitables as they finish.
 
     Yielding a set of awaitables like this:
@@ -668,7 +668,7 @@ def sleep(duration: float) -> "Future[None]":
     return f
 
 
-class _NullFuture(object):
+class _NullFuture:
     """_NullFuture resembles a Future that finished with a result of None.
 
     It's not actually a `Future` to avoid depending on a particular event loop.
@@ -713,7 +713,7 @@ In native coroutines, the equivalent of ``yield gen.moment`` is
 """
 
 
-class Runner(object):
+class Runner:
     """Internal implementation of `tornado.gen.coroutine`.
 
     Maintains information about pending callbacks and their results.
index 1a23f5c7fde8b952e322efdc45fe214d0bb60479..53cfca9686ca7a908b02b3c460b6aa535fa7dca1 100644 (file)
@@ -46,7 +46,7 @@ class _QuietException(Exception):
         pass
 
 
-class _ExceptionLoggingContext(object):
+class _ExceptionLoggingContext:
     """Used with the ``with`` statement when calling delegate methods to
     log any exceptions with the given logger.  Any exceptions caught are
     converted to _QuietException
@@ -70,7 +70,7 @@ class _ExceptionLoggingContext(object):
             raise _QuietException
 
 
-class HTTP1ConnectionParameters(object):
+class HTTP1ConnectionParameters:
     """Parameters for `.HTTP1Connection` and `.HTTP1ServerConnection`."""
 
     def __init__(
@@ -761,7 +761,7 @@ class _GzipMessageDelegate(httputil.HTTPMessageDelegate):
         return self._delegate.on_connection_close()
 
 
-class HTTP1ServerConnection(object):
+class HTTP1ServerConnection:
     """An HTTP/1.x server."""
 
     def __init__(
index 3011c371b83f62f45e1198fc817a5969413c8e12..b26ed449ef67ca480673bbc66c3dd9d0fbad78e5 100644 (file)
@@ -56,7 +56,7 @@ from tornado.util import Configurable
 from typing import Type, Any, Union, Dict, Callable, Optional, cast
 
 
-class HTTPClient(object):
+class HTTPClient:
     """A blocking HTTP client.
 
     This interface is provided to make it easier to share code between
@@ -336,7 +336,7 @@ class AsyncHTTPClient(Configurable):
         super(AsyncHTTPClient, cls).configure(impl, **kwargs)
 
 
-class HTTPRequest(object):
+class HTTPRequest:
     """HTTP client request object."""
 
     _headers = None  # type: Union[Dict[str, str], httputil.HTTPHeaders]
@@ -571,7 +571,7 @@ class HTTPRequest(object):
         self._body = utf8(value)
 
 
-class HTTPResponse(object):
+class HTTPResponse:
     """HTTP Response object.
 
     Attributes:
@@ -732,7 +732,7 @@ class HTTPClientError(Exception):
 HTTPError = HTTPClientError
 
 
-class _RequestProxy(object):
+class _RequestProxy:
     """Combines an object with a dictionary of defaults.
 
     Used internally by AsyncHTTPClient implementations.
index 757f711b24debba00383949da371f20101e90daf..58c74e472d2b7715545bc90b4e61d2124af81407 100644 (file)
@@ -295,7 +295,7 @@ class _CallableAdapter(httputil.HTTPMessageDelegate):
         del self._chunks
 
 
-class _HTTPRequestContext(object):
+class _HTTPRequestContext:
     def __init__(
         self,
         stream: iostream.IOStream,
index e2e51dfa1bd38531489d3e8b0dd91a5569863e9e..ecd53742c3ad2f07b38ce1abd800f6102f9de842 100644 (file)
@@ -253,7 +253,7 @@ class HTTPHeaders(StrMutableMapping):
     __unicode__ = __str__
 
 
-class HTTPServerRequest(object):
+class HTTPServerRequest:
     """A single HTTP request.
 
     All attributes are type `str` unless otherwise noted.
@@ -494,7 +494,7 @@ class HTTPOutputError(Exception):
     pass
 
 
-class HTTPServerConnectionDelegate(object):
+class HTTPServerConnectionDelegate:
     """Implement this interface to handle requests from `.HTTPServer`.
 
     .. versionadded:: 4.0
@@ -523,7 +523,7 @@ class HTTPServerConnectionDelegate(object):
         pass
 
 
-class HTTPMessageDelegate(object):
+class HTTPMessageDelegate:
     """Implement this interface to handle an HTTP request or response.
 
     .. versionadded:: 4.0
@@ -569,7 +569,7 @@ class HTTPMessageDelegate(object):
         pass
 
 
-class HTTPConnection(object):
+class HTTPConnection:
     """Applications use this interface to write their responses.
 
     .. versionadded:: 4.0
index 5a880b0cdfae2c2ce5748dcc16acb29e0c06c583..612aac3e8c6fb58692ec3b0ec2b233f81bbe806e 100644 (file)
@@ -819,7 +819,7 @@ class IOLoop(Configurable):
         self._pending_tasks.discard(f)
 
 
-class _Timeout(object):
+class _Timeout:
     """An IOLoop timeout, a UNIX timestamp and a callback"""
 
     # Reduce memory overhead when there are lots of pending callbacks
@@ -848,7 +848,7 @@ class _Timeout(object):
         return self.tdeadline <= other.tdeadline
 
 
-class PeriodicCallback(object):
+class PeriodicCallback:
     """Schedules the given callback to be called periodically.
 
     The callback is called every ``callback_time`` milliseconds when
index e3956c4d1f6d1113c9e0a7343e396468b0fd7ea9..a8955148fd6568e23a47d7065cbd4388d10badf4 100644 (file)
@@ -114,7 +114,7 @@ class StreamBufferFullError(Exception):
     """Exception raised by `IOStream` methods when the buffer is full."""
 
 
-class _StreamBuffer(object):
+class _StreamBuffer:
     """
     A specialized buffer that tries to avoid copies when large pieces
     of data are encountered.
@@ -204,7 +204,7 @@ class _StreamBuffer(object):
         self._first_pos = pos
 
 
-class BaseIOStream(object):
+class BaseIOStream:
     """A utility class to write to and read from a non-blocking file or socket.
 
     We support a non-blocking ``write()`` and a family of ``read_*()``
index c5526703b18b5287a1029d7c0a0bee1b9fd4c618..3fb1a686164f3995b0ccf996b6533e29e9ab2ce6 100644 (file)
@@ -221,7 +221,7 @@ def get_supported_locales() -> Iterable[str]:
     return _supported_locales
 
 
-class Locale(object):
+class Locale:
     """Object representing a locale.
 
     After calling one of `load_translations` or `load_gettext_translations`,
index 1bcec1b3af3dd0a6a552b6e066c8c7547c8a5ac4..6d794687db08b62b4108cb31997a7ac2f2c827d0 100644 (file)
@@ -28,7 +28,7 @@ if typing.TYPE_CHECKING:
 __all__ = ["Condition", "Event", "Semaphore", "BoundedSemaphore", "Lock"]
 
 
-class _TimeoutGarbageCollector(object):
+class _TimeoutGarbageCollector:
     """Base class for objects that periodically clean up timed-out waiters.
 
     Avoids memory leak in a common pattern like:
@@ -155,7 +155,7 @@ class Condition(_TimeoutGarbageCollector):
         self.notify(len(self._waiters))
 
 
-class Event(object):
+class Event:
     """An event blocks coroutines until its internal flag is set to True.
 
     Similar to `threading.Event`.
@@ -255,7 +255,7 @@ class Event(object):
             return timeout_fut
 
 
-class _ReleasingContextManager(object):
+class _ReleasingContextManager:
     """Releases a Lock or Semaphore at the end of a "with" statement.
 
     with (yield semaphore.acquire()):
@@ -484,7 +484,7 @@ class BoundedSemaphore(Semaphore):
         super().release()
 
 
-class Lock(object):
+class Lock:
     """A lock for coroutines.
 
     A Lock begins unlocked, and `acquire` locks it immediately. While it is
index cb66b77114331a092e46bf249a155e4e7796a5f6..46c740b584574bb9bd1a8caa207b3f85eaa59b42 100644 (file)
@@ -130,7 +130,7 @@ class Error(Exception):
     pass
 
 
-class OptionParser(object):
+class OptionParser:
     """A collection of options, a dictionary with object-like access.
 
     Normally accessed via static functions in the `tornado.options` module,
@@ -498,7 +498,7 @@ class OptionParser(object):
         return _Mockable(self)
 
 
-class _Mockable(object):
+class _Mockable:
     """`mock.patch` compatible wrapper for `OptionParser`.
 
     As of ``mock`` version 1.0.1, when an object uses ``__getattr__``
@@ -528,7 +528,7 @@ class _Mockable(object):
         setattr(self._options, name, self._originals.pop(name))
 
 
-class _Option(object):
+class _Option:
     # This class could almost be made generic, but the way the types
     # interact with the multiple argument makes this tricky. (default
     # and the callback use List[T], but type is still Type[T]).
index 12e3eb648d1d036198c5958303d8e78c22abedea..339ef659b1cfbdc72b222109bfc34488ca24ed64 100644 (file)
@@ -185,7 +185,7 @@ def task_id() -> Optional[int]:
     return _task_id
 
 
-class Subprocess(object):
+class Subprocess:
     """Wraps ``subprocess.Popen`` with IOStream support.
 
     The constructor is the same as ``subprocess.Popen`` with the following
index a145d719164d0a66f4a41820d97c2b76d8a81f9d..607e9f1d73d60a66b2f37d0f5418b04bcd3738e7 100644 (file)
@@ -438,7 +438,7 @@ class ReversibleRuleRouter(ReversibleRouter, RuleRouter):
         return None
 
 
-class Rule(object):
+class Rule:
     """A routing rule."""
 
     def __init__(
@@ -487,7 +487,7 @@ class Rule(object):
         )
 
 
-class Matcher(object):
+class Matcher:
     """Represents a matcher for request features."""
 
     def match(self, request: httputil.HTTPServerRequest) -> Optional[Dict[str, Any]]:
index 0a829062e7334d8d52fd9a31e648e8be72bff32d..0971ac084031cd630f0d8d02fa5ea146bbca14a5 100644 (file)
@@ -38,7 +38,7 @@ if typing.TYPE_CHECKING:
 _INITIAL_CONNECT_TIMEOUT = 0.3
 
 
-class _Connector(object):
+class _Connector:
     """A stateless implementation of the "Happy Eyeballs" algorithm.
 
     "Happy Eyeballs" is documented in RFC6555 as the recommended practice
@@ -199,7 +199,7 @@ class _Connector(object):
             stream.close()
 
 
-class TCPClient(object):
+class TCPClient:
     """A non-blocking TCP connection factory.
 
     .. versionchanged:: 5.0
index 02c0ca0ccab9186c7e900a3a80610ef851f55380..4b84af311a4b66300051373e9f9076489f0e6629 100644 (file)
@@ -40,7 +40,7 @@ if typing.TYPE_CHECKING:
     from typing import Callable, List  # noqa: F401
 
 
-class TCPServer(object):
+class TCPServer:
     r"""A non-blocking, single-threaded TCP server.
 
     To use `TCPServer`, define a subclass which overrides the `handle_stream`
index 2340cdbefd5e1621b38ecbbfc14c016480d4064f..e8be9064f304093473c9cc28fd75f4ab569fdb91 100644 (file)
@@ -249,7 +249,7 @@ def filter_whitespace(mode: str, text: str) -> str:
         raise Exception("invalid whitespace mode %s" % mode)
 
 
-class Template(object):
+class Template:
     """A compiled template.
 
     We compile into Python from the given template_string. You can generate
@@ -389,7 +389,7 @@ class Template(object):
         return ancestors
 
 
-class BaseLoader(object):
+class BaseLoader:
     """Base class for template loaders.
 
     You must use a template loader to use template constructs like
@@ -500,7 +500,7 @@ class DictLoader(BaseLoader):
         return Template(self.dict[name], name=name, loader=self)
 
 
-class _Node(object):
+class _Node:
     def each_child(self) -> Iterable["_Node"]:
         return ()
 
@@ -720,7 +720,7 @@ class ParseError(Exception):
         return "%s at %s:%d" % (self.message, self.filename, self.lineno)
 
 
-class _CodeWriter(object):
+class _CodeWriter:
     def __init__(
         self,
         file: TextIO,
@@ -740,7 +740,7 @@ class _CodeWriter(object):
         return self._indent
 
     def indent(self) -> "ContextManager":
-        class Indenter(object):
+        class Indenter:
             def __enter__(_) -> "_CodeWriter":
                 self._indent += 1
                 return self
@@ -755,7 +755,7 @@ class _CodeWriter(object):
         self.include_stack.append((self.current_template, line))
         self.current_template = template
 
-        class IncludeTemplate(object):
+        class IncludeTemplate:
             def __enter__(_) -> "_CodeWriter":
                 return self
 
@@ -778,7 +778,7 @@ class _CodeWriter(object):
         print("    " * indent + line + line_comment, file=self.file)
 
 
-class _TemplateReader(object):
+class _TemplateReader:
     def __init__(self, name: str, text: str, whitespace: str) -> None:
         self.name = name
         self.text = text
index 5c25adffd830696041dc62ded7313a591c09cc6c..d5f7e9692bd43bf6d2e1e7bc8fb8e5d754c87fdc 100644 (file)
@@ -105,7 +105,7 @@ def assert_no_cycle_garbage():
 class CircleRefsTest(unittest.TestCase):
     def test_known_leak(self):
         # Construct a known leak scenario to make sure the test harness works.
-        class C(object):
+        class C:
             def __init__(self, name):
                 self.name = name
                 self.a: typing.Optional[C] = None
@@ -199,7 +199,7 @@ class CircleRefsTest(unittest.TestCase):
 
         with concurrent.futures.ThreadPoolExecutor(1) as thread_pool:
 
-            class Factory(object):
+            class Factory:
                 executor = thread_pool
 
                 @tornado.concurrent.run_on_executor
index 009d6ed43f09a0d07545b0a778e2a23167136a92..ea20ed36a031efd7f2d380f3fb31e447f9099460 100644 (file)
@@ -94,7 +94,7 @@ class CapError(Exception):
     pass
 
 
-class BaseCapClient(object):
+class BaseCapClient:
     def __init__(self, port):
         self.port = port
 
@@ -124,7 +124,7 @@ class GeneratorCapClient(BaseCapClient):
         raise gen.Return(self.process_response(data))
 
 
-class ClientTestMixin(object):
+class ClientTestMixin:
     client_class = None  # type: typing.Callable
 
     def setUp(self):
@@ -174,7 +174,7 @@ class GeneratorClientTest(ClientTestMixin, AsyncTestCase):
 class RunOnExecutorTest(AsyncTestCase):
     @gen_test
     def test_no_calling(self):
-        class Object(object):
+        class Object:
             def __init__(self):
                 self.executor = futures.thread.ThreadPoolExecutor(1)
 
@@ -188,7 +188,7 @@ class RunOnExecutorTest(AsyncTestCase):
 
     @gen_test
     def test_call_with_no_args(self):
-        class Object(object):
+        class Object:
             def __init__(self):
                 self.executor = futures.thread.ThreadPoolExecutor(1)
 
@@ -202,7 +202,7 @@ class RunOnExecutorTest(AsyncTestCase):
 
     @gen_test
     def test_call_with_executor(self):
-        class Object(object):
+        class Object:
             def __init__(self):
                 self.__executor = futures.thread.ThreadPoolExecutor(1)
 
@@ -216,7 +216,7 @@ class RunOnExecutorTest(AsyncTestCase):
 
     @gen_test
     def test_async_await(self):
-        class Object(object):
+        class Object:
             def __init__(self):
                 self.executor = futures.thread.ThreadPoolExecutor(1)
 
index b495636561a9651e146ab2dbd0c88f3d1ad25bac..3190ef40f7c7f7dfd6635d17017fd78414107570 100644 (file)
@@ -581,7 +581,7 @@ class GenCoroutineTest(AsyncTestCase):
         # without waiting for garbage collection.
         @gen.coroutine
         def inner():
-            class Foo(object):
+            class Foo:
                 pass
 
             local_var = Foo()
index 762c23f6e03fdbba5e21477d84b7df85298b692d..07244634afd5ca6ebc3de0d4b6cad8f154eeb8f7 100644 (file)
@@ -115,7 +115,7 @@ class BaseSSLTest(AsyncHTTPSTestCase):
         return Application([("/", HelloWorldRequestHandler, dict(protocol="https"))])
 
 
-class SSLTestMixin(object):
+class SSLTestMixin:
     def get_ssl_options(self):
         return dict(
             ssl_version=self.get_ssl_version(),
index 07a7cf0c3068da18c30ab20cc53351c357fecbb1..212393928323d849194efdee4660819fa31850a0 100644 (file)
@@ -265,7 +265,7 @@ class TestIOLoop(AsyncTestCase):
         # Use a socket since they are supported by IOLoop on all platforms.
         # Unfortunately, sockets don't support the .closed attribute for
         # inspecting their close status, so we must use a wrapper.
-        class SocketWrapper(object):
+        class SocketWrapper:
             def __init__(self, sockobj):
                 self.sockobj = sockobj
                 self.closed = False
index 096dfa868a24ed894ae289127368e39c4001d996..a7d415fbfe95ebf6335fb54f4781cc9a7f942e2d 100644 (file)
@@ -57,7 +57,7 @@ class HelloHandler(RequestHandler):
         self.write("Hello")
 
 
-class TestIOStreamWebMixin(object):
+class TestIOStreamWebMixin:
     def _make_client_iostream(self):
         raise NotImplementedError()
 
@@ -177,7 +177,7 @@ class TestIOStreamWebMixin(object):
             stream.read_bytes(1)
 
 
-class TestReadWriteMixin(object):
+class TestReadWriteMixin:
     # Tests where one stream reads and the other writes.
     # These should work for BaseIOStream implementations.
 
index 33a8b7dbafb965df0ba080b2ab5acaad500b7399..0f0bb2a915fcef64da7708fd20a1c90319dd5559 100644 (file)
@@ -30,7 +30,7 @@ else:
     from tornado.platform.caresresolver import CaresResolver
 
 
-class _ResolverTestMixin(object):
+class _ResolverTestMixin:
     resolver = None  # type: typing.Any
 
     @gen_test
@@ -48,7 +48,7 @@ class _ResolverTestMixin(object):
 
 # It is impossible to quickly and consistently generate an error in name
 # resolution, so test this case separately, using mocks as needed.
-class _ResolverErrorTestMixin(object):
+class _ResolverErrorTestMixin:
     resolver = None  # type: typing.Any
 
     @gen_test
index 6f4021c683d9067c76d15a8803f9f4d9385edff4..3ad1a9d9e898ba241b4f59c4dc314e679b76fe94 100644 (file)
@@ -15,7 +15,7 @@ if typing.TYPE_CHECKING:
     from typing import List  # noqa: F401
 
 
-class Email(object):
+class Email:
     def __init__(self, value):
         if isinstance(value, str) and "@" in value:
             self._value = value
index 50fdcb1536a7e6ea3292991405547ac2b271ed43..7ee52455336bc8265b547e790d0d805970f9c13e 100644 (file)
@@ -142,7 +142,7 @@ class RespondInPrepareHandler(RequestHandler):
         self.finish("forbidden")
 
 
-class SimpleHTTPClientTestMixin(object):
+class SimpleHTTPClientTestMixin:
     def create_client(self, **kwargs):
         raise NotImplementedError()
 
index 7116d27777395c8a2b1ea0304105be221811057d..2973d248d887a43c12bfe9f56c9e014148076bd9 100644 (file)
@@ -197,7 +197,7 @@ class TestConnectorSplit(unittest.TestCase):
 
 
 class ConnectorTest(AsyncTestCase):
-    class FakeStream(object):
+    class FakeStream:
         def __init__(self):
             self.closed = False
 
index 351a2a8971d112171efaa569bdc1101d3c692cf8..c65e605410e681c3b058a9c0b261de9209829a3a 100644 (file)
@@ -2422,7 +2422,7 @@ class BaseFlowControlHandler(RequestHandler):
         self.write(dict(methods=self.methods))
 
 
-class BaseStreamingRequestFlowControlTest(object):
+class BaseStreamingRequestFlowControlTest:
     def get_httpserver_options(self):
         # Use a small chunk size so flow control is relevant even though
         # all the data arrives at once.
index 8a3ac71252a41119156ab37a1a78141c28f39496..e7228ee8268abb90a3040c9db50a83caf6fe3485 100644 (file)
@@ -661,7 +661,7 @@ class WebSocketNativeCoroutineTest(WebSocketBaseTestCase):
         self.assertEqual(res, "hello2")
 
 
-class CompressionTestMixin(object):
+class CompressionTestMixin:
     MESSAGE = "Hello world. Testing 123 123"
 
     def get_app(self):
@@ -766,7 +766,7 @@ class DefaultCompressionTest(CompressionTestMixin, WebSocketBaseTestCase):
         self.assertEqual(bytes_out, bytes_in + 12)
 
 
-class MaskFunctionMixin(object):
+class MaskFunctionMixin:
     # Subclasses should define self.mask(mask, data)
     def mask(self, mask: bytes, data: bytes) -> bytes:
         raise NotImplementedError()
index 1fc2c69a52635753647cd9cfcb92894c11ba1460..bf907b336bf98dc4c04e3e320a6a356e670ffb63 100644 (file)
@@ -65,7 +65,7 @@ class ObjectDict(Dict[str, Any]):
         self[name] = value
 
 
-class GzipDecompressor(object):
+class GzipDecompressor:
     """Streaming gzip decompressor.
 
     The interface is like that of `zlib.decompressobj` (without some of the
@@ -201,7 +201,7 @@ def re_unescape(s: str) -> str:
     return _re_unescape_pattern.sub(_re_unescape_replacement, s)
 
 
-class Configurable(object):
+class Configurable:
     """Base class for configurable interfaces.
 
     A configurable interface is an (abstract) class whose constructor
@@ -336,7 +336,7 @@ class Configurable(object):
         base.__impl_kwargs = saved[1]
 
 
-class ArgReplacer(object):
+class ArgReplacer:
     """Replaces one value in an ``args, kwargs`` pair.
 
     Inspects the function signature to find an argument by name
index 30cef30bd6d209615c24bf91a5d1de216ee8b751..648bdc38507b1c28117a072d3cd5f961a0f9f19a 100644 (file)
@@ -176,7 +176,7 @@ class _ArgDefaultMarker:
 _ARG_DEFAULT = _ArgDefaultMarker()
 
 
-class RequestHandler(object):
+class RequestHandler:
     """Base class for HTTP request handlers.
 
     Subclasses must define at least one of the methods defined in the
@@ -3187,7 +3187,7 @@ class FallbackHandler(RequestHandler):
         self.on_finish()
 
 
-class OutputTransform(object):
+class OutputTransform:
     """A transform modifies the result of an HTTP request (e.g., GZip encoding)
 
     Applications are not expected to create their own OutputTransforms
@@ -3339,7 +3339,7 @@ def authenticated(
     return wrapper
 
 
-class UIModule(object):
+class UIModule:
     """A re-usable, modular UI unit on a page.
 
     UI modules often execute additional queries, and they can include
@@ -3487,7 +3487,7 @@ class TemplateModule(UIModule):
         return "".join(self._get_resources("html_body"))
 
 
-class _UIModuleNamespace(object):
+class _UIModuleNamespace:
     """Lazy namespace which creates UIModule proxies bound to a handler."""
 
     def __init__(
index ad5db5590e297c1e96a5c34fa33fce1d9b78a659..7694c41b237655d5535f3b9eb8f29c488f5af061 100644 (file)
@@ -115,7 +115,7 @@ class _DecompressTooLargeError(Exception):
     pass
 
 
-class _WebSocketParams(object):
+class _WebSocketParams:
     def __init__(
         self,
         ping_interval: Optional[float] = None,
@@ -698,7 +698,7 @@ class WebSocketProtocol(abc.ABC):
         raise NotImplementedError()
 
 
-class _PerMessageDeflateCompressor(object):
+class _PerMessageDeflateCompressor:
     def __init__(
         self,
         persistent: bool,
@@ -746,7 +746,7 @@ class _PerMessageDeflateCompressor(object):
         return data[:-4]
 
 
-class _PerMessageDeflateDecompressor(object):
+class _PerMessageDeflateDecompressor:
     def __init__(
         self,
         persistent: bool,
index 32641be30ff7a814da06a2cf09c0af88976eb999..8a08d56e747514082f8477beecc18306c02b2fd2 100644 (file)
@@ -56,7 +56,7 @@ def to_wsgi_str(s: bytes) -> str:
     return s.decode("latin1")
 
 
-class WSGIContainer(object):
+class WSGIContainer:
     r"""Makes a WSGI-compatible application runnable on Tornado's HTTP server.
 
     .. warning::