Why True/False is capitalized in Python?

后端 未结 4 1795
伪装坚强ぢ
伪装坚强ぢ 2020-12-24 10:05

All members are camel case, right? Why True/False but not true/false, which is more relaxed?

4条回答
  •  Happy的楠姐
    2020-12-24 10:58

    Here's a possible explaination:

    I see that naming conventions are such that classes usually get named CamelCase. So why are the built-in types named all lowercase (like list, dict, set, bool, etc.)?

    Because most of them originally were types and factory functions, not
    classes - and a naming convention is not a strong reason to make backwards incompatible changes. A different example: the new builtin type set is based on (altough not exactly equal to) the Set class from the sets module

提交回复
热议问题