What is 'wrapped' by a python method wrapper
我正在阅读关于Python3中OOP的博客文章。其中有:
As you can see, a
__get__ method is listed among the members of the function, and Python recognizes it as a method-wrapper. This method shall connect the open function to the door1 instance, so we can call it passing the instance alone.
我想更直观地理解这一点。在这种情况下,"包装"是什么?
在自定义类中,它是与
另请参见描述符协议;这是定义