]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Use slots in the aiomysql proxy classes
authorFederico Caselli <cfederico87@gmail.com>
Sat, 6 Feb 2021 16:54:42 +0000 (17:54 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 6 Feb 2021 16:54:42 +0000 (17:54 +0100)
Add slots in the proxy cursor and connection classes in the aiomysql dialect

Change-Id: If72fccf0cc16557a7e3a0c9450733c8337bec15a

lib/sqlalchemy/dialects/mysql/aiomysql.py

index f0665133f63615647aaf9110716fdeee5e965047..6c968a1e7ce6dbc7e25ff7f574125662f0541de9 100644 (file)
@@ -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