Why is MaybeChannelBound callable?
Posted
by
William Payne
on Programmers
See other posts from Programmers
or by William Payne
Published on 2012-05-29T22:39:56Z
Indexed on
2012/06/26
3:24 UTC
Read the original article
Hit count: 264
python
The Queue class in the python kombu library inherits from MaybeChannelBound, which in turn implements the call method (making it callable). The call() method itself is a thin wrapper around the bind() method.
It is not clear why this was done, as calling the bind() method seems (to my simple mind, at least) to be clearer and more descriptive of the intent of the function.
Why would somebody use the call() method in a situation like this?
© Programmers or respective owner