[英]python: syntactic sugar - is it official? where is it described in documentation?
I often see notes that eg []
is syntactic sugar for _getitem_
( Why/How does Pandas use square brackets with .loc and .iloc? ), but neither by web search, not here on SO, not in glossary in docs.python.org I could find list of all sugars for Python. 我经常看到,例如笔记[]
是语法糖_getitem_
( 为什么/如何大熊猫使用方括号的.loc和.iloc? ),但无论通过网络搜索,而不是在这里所以,不是在词汇docs.python。组织我能找到的所有的Python糖的名单。 Are sugars official or left to each implementation specifics? 糖是官方的还是留给每个实施细节的?
It's documented in the Python data model documentation . 它记录在Python数据模型文档中 。 It's not exactly synthetic sugar, and more of an implementation detail of how container types work. 它不完全是合成糖,更多是关于容器类型如何工作的实现细节。 Python has lots of these so-called "magic methods" Python有很多这些所谓的“魔术方法”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.