eandersson / amqpstorm

Thread-safe Python RabbitMQ Client & Management library
MIT License
188 stars 36 forks source link

channel.basic.consume() arguments typed incorrectly #87

Closed TechmarkDavid closed 4 years ago

TechmarkDavid commented 4 years ago

Hi, the type hint for channel.basic.consume() says it must take a function. However, I have passed in a callable (an object with __call__ defined) for a very long time. Type checkers flag this as an error. I mostly use inline typing not docstring typing, but the way to fix it in that case would be to change the type of the argument callback from function to typing.Callable.

eandersson commented 4 years ago

Thanks for the report! Feel free to open a PR, but I can also take care of it.

eandersson commented 4 years ago

I committed the above fix. Let me know if it now works as intended!