urllib2.urlopen的真正签名是什么

2024-04-23 13:54:46 发布

您现在位置:Python中文网/ 问答频道 /正文

在文件里是这样的

urllib2.urlopen(url[, data[, timeout[, cafile[, capath[, cadefault[, context]]]]]) Open the URL url, which can be either a string or a Request object.

https://docs.python.org/2/library/urllib2.html

但在模块代码中:

def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):

是文档错误还是函数在某个地方插入了指令?你知道吗


Tags: 文件theurlwhichdatacontexttimeoutopen