^.^ - http://goo.gl/GDIO
Labels
acm
c++
euler
firefox
matlab
opencv
opengl
Programming
python
pythonlib
ubuntu
12 Sept 2014
如何检测一个参数是Generator类型?
Email This
BlogThis!
Share to X
Share to Facebook
Share to Pinterest
收藏到CSDN网摘
遇到一个问题,需要检测输入参数类型,如果是list,tuple,dict,set等内置类型,可以很容易使用isinstance(arg,list)这样的函数来测试,但是如果输入参数是generator呢?例如foo(abs(i) for i in range(-10, 10)),这时如何检测?
Read more »
Newer Posts
Older Posts
Home
Subscribe to:
Posts ( Atom )