From: Federico Caselli Date: Sat, 6 Feb 2021 16:54:42 +0000 (+0100) Subject: Use slots in the aiomysql proxy classes X-Git-Tag: rel_1_4_0b3~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bd80d506a8cdc3ce94da7e9cfcb8498d564a192;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Use slots in the aiomysql proxy classes Add slots in the proxy cursor and connection classes in the aiomysql dialect Change-Id: If72fccf0cc16557a7e3a0c9450733c8337bec15a --- diff --git a/lib/sqlalchemy/dialects/mysql/aiomysql.py b/lib/sqlalchemy/dialects/mysql/aiomysql.py index f0665133f6..6c968a1e7c 100644 --- a/lib/sqlalchemy/dialects/mysql/aiomysql.py +++ b/lib/sqlalchemy/dialects/mysql/aiomysql.py @@ -41,6 +41,13 @@ from ...util.concurrency import await_only class AsyncAdapt_aiomysql_cursor: server_side = False + __slots__ = ( + "_adapt_connection", + "_connection", + "await_", + "_cursor", + "_rows", + ) def __init__(self, adapt_connection): self._adapt_connection = adapt_connection @@ -123,7 +130,7 @@ class AsyncAdapt_aiomysql_cursor: class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): - + __slots__ = () server_side = True def __init__(self, adapt_connection): @@ -154,6 +161,7 @@ class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): class AsyncAdapt_aiomysql_connection: await_ = staticmethod(await_only) + __slots__ = ("dbapi", "_connection") def __init__(self, dbapi, connection): self.dbapi = dbapi