赞了回答2016-02-06
上面的简单例子中,a和b是属性么?不是,它们是全局变量(相对当前例子而言)。func是方法么,不是,它是函数。attribute(属性)是class(类)中的成员变量,而method(方法)则是class(类)中的function(函数)。也可以理解,属性就类变量,方法就是类函数。那我...
赞了文章2016-02-05
被某些中文教程坑过,我的建议是有问题看官方文档,即使没有很详细的例子,至少不坑 装饰器 毫无疑问在python中用得非常多 {代码...} 在f上加deco装饰器相当于f = deco(f), 和functools.partial有些类似 如果被装饰的函数f带参数且有返回值 {代码...} 如果装饰器带有...
赞了回答2015-12-25
If capturing parentheses are used in pattern, then the text of all groups in the pattern are also returned as part of the resulting list.
赞了回答2015-12-25
If capturing parentheses are used in pattern, then the text of all groups in the pattern are also returned as part of the resulting list.
赞了回答2015-12-23
{代码...}
赞了回答2015-12-23
{代码...}
提出了问题2015-12-23
提出了问题2015-12-22
赞了问题2015-12-18
赞了问题2015-12-18
提出了问题2015-12-16
提出了问题2015-12-14