Skip to content

Commit

Permalink
Define more __slots__
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-ryzhov committed Nov 20, 2023
1 parent 181b333 commit c4d59b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aio_pika/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ async def __aexit__(


class AbstractQueue:
__slots__ = ()

channel: "AbstractChannel"
name: str
durable: bool
Expand Down Expand Up @@ -779,6 +781,8 @@ async def update_secret(


class AbstractRobustQueue(AbstractQueue):
__slots__ = ()

@abstractmethod
def restore(self) -> Awaitable[None]:
raise NotImplementedError
Expand Down
14 changes: 14 additions & 0 deletions aio_pika/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ async def consumer(
class Queue(AbstractQueue):
""" AMQP queue abstraction """

__slots__ = (
"__weakref__",
"__get_lock",
"close_callbacks",
"channel",
"name",
"durable",
"exclusive",
"auto_delete",
"arguments",
"passive",
"declaration_result",
)

def __init__(
self,
channel: AbstractChannel,
Expand Down

0 comments on commit c4d59b1

Please sign in to comment.