python 省略号 三个点...的含义,省略号的含义有哪些,Python Ten


Python Tensorflow 省略号 三个点 ... 含义(等于号后面省略号,冒号后面省略号)

最近在学习tensorflow object detection API的源码,研究以下faster RCNN的实现。阅读到含有省略号的代码。不是很理解什么意思。C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\typeshed\stdlib\3\collections (__init__.pyi)技术图片
# namedtuple is special-cased in the type checker; the initializer is ignored.if sys.version_info >= (3, 7):    def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *,                   rename: bool = ..., module: Optional[str] = ..., defaults: Optional[Iterable[Any]] = ...) -> Type[tuple]: ...elif sys.version_info >= (3, 6):    def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *,                   verbose: bool = ..., rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ...else:    def namedtuple(typename: str, field_names: Union[str, Iterable[str]],                   verbose: bool = ..., rename: bool = ...) -> Type[tuple]: ...
技术图片

我本人没有系统学过python,网上找了一圈,最后在Quora找到了。https://www.quora.com/What-do-the-dots-mean-in-Python技术图片在知乎也发现有个说明。小小程序员:10个不为人知的 Python 冷知识总结一下:1.省略号在python里也是个对象。2.=...(赋值号后面省略号),给该变量赋值一个default值。具体python的机制我不清楚。应该是在类里面定义好的。3.: ...(冒号后面省略号),表示函数的定义内容不写了。转发自https://www.cnblogs.com/dinghou/p/10926545.html

python 省略号 三个点...的含义

评论关闭