Python has some of the value-like objects capitalized: True
, False
, None
.
>>> type(True)
<type 'bool'>
>>> type(None)
<type 'NoneType'>
>>>
As the current PEP-8 style guide recommends writing instances and variable names in lowercase, what is the history behind writing these value-like objects capitalized?
As it is answered / commented that built-ins are capitalized, but what is the rationale and inspiration behind this? In most languages built-ins are all uppercase, so one would expect Python to follow this paradigm?
The goal of Python is consistency within itself, not consistency to other languages. True
and False
are capitalized because most, if not all, built in constants are capitalized. While I am not aware of exactly why it is done, it is probably because it is easier to differentiate them from variables when the first letter is capitalized, as if it is lowercase, it is easy to confuse it with a variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With