【发布时间】:2016-07-27 19:06:39
【问题描述】:
def iglob(pathname, *, recursive=False):
"""Return an iterator which yields the paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.
If recursive is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
"""
it = _iglob(pathname, recursive)
if recursive and _isrecursive(pathname):
s = next(it) # skip empty string
assert not s
return it
当我浏览python3.5.1中glob的代码时,这里定义的函数,为什么函数参数列表中有一个*。如果我将三个参数传递给引发 TypeError 的函数,那么 * 的作用是什么?先谢谢了。
【问题讨论】:
标签: python