- 博客(4)
- 资源 (2)
- 收藏
- 关注
原创 python namespace and variable scope
python 有三个名字空间:1. 函数以及这个函数的外层函数2. 函数所在的模块3. built-inpython的搜索顺序从1-2-3函数和类的属性都是属于1所在的名字空间变量的作用域跟名字空间的地位相等,1里的变量只能在1里面被使用2里面的变量如果在1里面没有用global声明,那么该变量只是可读,如果进行写,那么只是创建一个新的变量而已def scope(): print t
2008-07-15 23:18:00 1760
原创 test notation from testNG
1. before和after系列 beforeSute,afterSuite,beforeCase, afterCase,以及他们的alwaysRun,一般情况下before的alwaysRun为true,但是after却可以用这个参数来配置在case运行失败的情况下的动作2. 将case组织为group,定制某个group是否运行,例如将case分为check-in和func
2008-07-13 23:37:00 593
原创 python object creation
python里everything is object,object creation主要涉及到一下几个函数1. __init__(self,*args,*kgs)2.__new__(cls,*args,**kgs)3.__call__(self,*args,**kgs)首先介绍这三个函数,接着介绍创建class本身这个对象,以及metaclass时这几个函数的具体调用顺序
2008-07-10 15:34:00 676
原创 [ZT]Understanding Python's "with" statement
Understanding Pythons "with" statementFredrik Lundh | October 2006 | Originally posted to online.effbot.orgJudging from comp.lang.python and other forums, Python 2.5’s new with statement
2008-07-01 23:07:00 539
Aggregated Search
2018-10-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人