aio-pika icon indicating copy to clipboard operation
aio-pika copied to clipboard

Misleading type annotation in Exchange.publish()

Open epandurski opened this issue 6 months ago • 0 comments

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.

epandurski avatar Jul 28 '24 13:07 epandurski