Python 集合模块中大写的意义?

Significance of Capitalization in Python collections module?

collections module in Python 中 类 的大写做法有什么意义吗?特别是,令我感到困惑的是 OrderedDict 使用 CamelCase 而 defaultdict 全部小写。我的假设是他们都会使用 CamelCase,因为他们都是 类.

命名是历史的(对于 CPython)。最初,CamelCase 类(如 OrderedDict)是纯 python 实现的,其他 类(如 defaultdict)是 C-implemented。然而,现在这些名称只是遗留的(大部分),因为 C-implementation 经常被添加(例如 here for OrderedDict- you can see now python 实现只是一个后备)。