diff --git a/aio_pika/abc.py b/aio_pika/abc.py index 025ba16b..dbd2b679 100644 --- a/aio_pika/abc.py +++ b/aio_pika/abc.py @@ -330,12 +330,14 @@ async def get( fail: Literal[True] = ..., timeout: TimeoutType = ..., ) -> AbstractIncomingMessage: ... + @overload async def get( self, *, no_ack: bool = False, fail: Literal[False] = ..., timeout: TimeoutType = ..., ) -> Optional[AbstractIncomingMessage]: ... + @abstractmethod async def get( self, *, no_ack: bool = False, diff --git a/aio_pika/queue.py b/aio_pika/queue.py index 123f175a..7bb5ac74 100644 --- a/aio_pika/queue.py +++ b/aio_pika/queue.py @@ -269,12 +269,14 @@ async def get( fail: Literal[True] = ..., timeout: TimeoutType = ..., ) -> IncomingMessage: ... + @overload async def get( self, *, no_ack: bool = False, fail: Literal[False] = ..., timeout: TimeoutType = ..., ) -> Optional[IncomingMessage]: ... +[] async def get( self, *, no_ack: bool = False, fail: bool = True, timeout: TimeoutType = 5,