3

Some of the elements in the collections module seem to be uppercase, some other not. Is there a specific rationale behind it?

pppery
  • 3,434
  • 13
  • 24
  • 37
meto
  • 2,479
  • 5
  • 28
  • 41

1 Answers1

3

According to this reddit comment

All classes written in python are upper camel case.

All types based on C code are lower. [like the primitives]

namedtuple is a function, thus follows the naming convention of functions. deque and defaultdict are types, (C); Counter and OrderedDict are classes, (Python).

Community
  • 1
  • 1
meto
  • 2,479
  • 5
  • 28
  • 41