Why is True / False capitalized in Python?

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

+45
python camelcasing
Feb 06 '09 at 18:13
source share
5 answers

From Pep 285 :

Should the constants be called True, and False (similar to None) or true and false (as in C ++, Java, and C99)?

=> Truth and falsehood.

Most reviewers agree that consistency in Python is more important than consistency with other languages.

Is this, as Andrew points out, perhaps because of everything (the majority)? built-in constants are capitalized .

+55
Feb 06 '09 at 18:20
source share

All python inline constants are either CamelCase uppercase or [upper]:

+12
Feb 06 '09 at 18:21
source share

Here's a possible explanation :

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

Since most of them were originally factory types and functions, not
classes - and naming conventions are not a strong reason to make backward incompatible changes. Different For example: a new built-in set type based on (although not quite equal to) the Set class from a set of modules

+3
Feb 06 '09 at 18:20
source share

I would say that they are called True and False , because they are single.

-3
Nov 01 '09 at 4:38
source share

True and False capitalized in Haskell, in another language that uses indentation as syntax.

-6
Apr 05 '09 at 4:11
source share



All Articles