平时翻阅源码的时候可能会遇到过这样的函数定义。点。点。点(Ellipsis对象,py2中没有这个...语法)
def main(module: Union[None, str, ModuleType] = ...,
defaultTest: Union[str, Iterable[str], None] = ...,
argv: Optional[List[str]] = ...,
testRunner: Union[Type[TestRunner], TestRunner, None] = ...,
testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ...,
failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ...,
buffer: Optional[bool] = ...,
warnings: Optional[str] = ...) -> TestProgram: ...
先看看是啥玩意
type(...)
<class 'ellipsis'>
原来是ellipsis,去查了下官方文档,发现这是个built-in constants,下面是文档的描述
Ellipsis
The same as the ellipsis literal “...
”. Special value used mostly in conjunction with extended slicing syntax for user-defined container data types.