add workaround for Python 3's lack of unbound methods
Unbound methods are not longer a thing in Python 3 [1]. Instead, functions use the descriptor protocol [2] to properly bind the `self` argument if they are being called as a method. Cython functions do not have a `__get__` attribute and so don't satisfy the descriptor protocol. They therefore can't be used as methods. As a workaround we create a wrapper class with the proper __get__ method. The advantage of this over creating a Python wrapper is that the function signature is preserved. [1]: https://docs.python.org/3.0/whatsnew/3.0.html [2]: https://docs.python.org/3/howto/descriptor.html
Please register or sign in to comment