Skip to content

Commit

Permalink
Add __slots__ to Connection classes
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix committed Jan 11, 2022
1 parent 97d212b commit 447e585
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions edgedb/asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@


class AsyncIOConnection(base_client.BaseConnection):
__slots__ = ("_loop", "_holder")

def __init__(self, loop, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
9 changes: 9 additions & 0 deletions edgedb/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ class BaseConnection:
_log_listeners: typing.Set[
typing.Callable[[BaseConnection_T, errors.EdgeDBMessage], None]
]
__slots__ = (
"__weakref__",
"_protocol",
"_addr",
"_addrs",
"_config",
"_params",
"_log_listeners",
)

def __init__(
self,
Expand Down
1 change: 1 addition & 0 deletions edgedb/blocking_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@


class BlockingIOConnection(base_client.BaseConnection):
__slots__ = ()

def connect(self, *, single_attempt=False):
start = time.monotonic()
Expand Down

0 comments on commit 447e585

Please sign in to comment.