织梦CMS - 轻松建站从此开始!

沙龙国际-沙龙国际娱乐-沙龙国际网上娱乐

当前位置: 主页 > 沙龙国际客户端 >

Python 3.x 实例方法的__func__属性

时间:2017-07-11 03:38来源:未知 作者:admin 点击:
看 Python 3.x 的文档,涉及到实例方法特殊属性的内容,有这么一段话描述 instance method 的 __func__ 属性: When an instance method object is created by retrieving a user-defined function object from a class via

看 Python 3.x 的文档,涉及到实例方法特殊属性的内容,有这么一段话描述 instance method__func__ 属性:

When an instance method object is created by retrieving a user-defined function object from a class via one of its instances, its self attribute is the instance, and the method object is said to be bound. The new method’s func attribute is the original function object.
When a user-defined method object is created by retrieving another method object from a class or instance, the behaviour is the same as for a function object, except that the func attribute of the new instance is not the original method object but its func attribute.

甚是不解,主要是不明白前后两段中对instance method object的创建方式的描述到底有何不同? 还请大神赐教

织梦二维码生成器
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
推荐内容