【发布时间】:2021-02-05 00:48:55
【问题描述】:
各种python“帮助”方法/函数描述旁边的...似乎没有在任何地方定义。在 python help 输出描述的上下文中,function(...) 是什么意思?
具体来说,python的pop函数的文档应该如何解释?
详情
鉴于pop 需要输入,help({}) 没有在函数输入描述 (...) 中显示这一点有点令人困惑。
将... 解释为“同上”是行不通的——例如,“items”不能接受任何输入。
要清楚,这是来自help 的函数输入定义。
pop(...)
help({}) 函数的完整输出,get...pop 如下。 ... 的含义是什么,为什么没有为 pop 函数定义输入?
| get(self, key, default=None, /)
| Return the value for key if key is in the dictionary, else default.
|
| items(...)
| D.items() -> a set-like object providing a view on D's items
|
| keys(...)
| D.keys() -> a set-like object providing a view on D's keys
|
| pop(...)
| D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
| If key is not found, d is returned if given, otherwise KeyError is raised
【问题讨论】:
标签: python function methods documentation