摘要:
最近看python相关书籍或者代码,发现很多比较疑惑的地方:1.self这个不解释了,python的自省功能,类的实例访问自身属性和方法,有点儿类似于其他语言中的this。被显示给出,但是无需为参数self赋值,python解释器会自动给self赋值。2.*args and * kwargs关于*args and * kwargs的使用看下面几个例子:>>> def print_everything(*args): for count,thing in enumerate(args):... print "%d. %s" %(count, thing).. 阅读全文
posted @ 2012-07-11 22:58
很多不懂呀。。
阅读(268)
评论(0)
推荐(0)

浙公网安备 33010602011771号