aio-pika
aio-pika copied to clipboard
Misleading type annotation in Exchange.publish()
The type annotation for the return value for the Exchange.publush()
method is: Ack | Nack | Reject | None
.
Looking at the implementation, it seems to me that if the publisher confirm is not "ack" the method raises an exception, not returning Nack, Reject, or None. Also, it seem to never return Ack either. If I am not mistaken, the annotation is very confusing, because it suggests that the return value must be checked.