Flicker1985's Blog

Everything should be made as simple as possible, but not simpler.
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

2011年2月1日

[python] Bound method or Function

摘要: 我们先看一段代码#!/usr/bin/env python# encoding: utf-8class Foo(object): pass def func(): pass if __name__ == "__main__": Foo.method = func f = Foo() print Foo.method print f.method print func代码非常简单,结果如下:<unbound method Foo.func><bound method Foo.func of <__main__.Foo object at 0x10047 阅读全文

posted @ 2011-02-01 22:56 Fei He 阅读(6805) 评论(1) 推荐(1) 编辑
点击右上角即可分享
微信分享提示