Most of the time, a custom object that implements only a subset — even a fairly small subset — of, for example, the methods of a built-in dict are dictionary-like enough for purposes at hand.
大部分情况下,只实现了比如内置的dict类型的方法的一个子集——甚至是相当小的子集——的自定义对象,就足够“类- dictionary”而可以满足当前的要求。
Finally, this example demonstrates that the underlying data type for a dictionary in Python is the dict object.
最后,这个示例说明了Python中dictionary的底层数据类型是dict对象。
To find out more about how to use a dictionary in Python, you can use the built-in help interpreter to learn about the dict class, as shown in Listing 2.
要进一步了解如何使用Python中的dictionary,可以使用内置的帮助解释器来了解dict类,如清单2所示。
应用推荐