name capitalization of built-in types, True, and False

C

cbtube03

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.)?

And names for instances of classes are usually written in lowercase,
like foo in ``foo = CamelCase()``. So why are True and False
(instances of bool) capitalized? Shouldn't they be "true" and "false"?
Same goes for None.
 
J

James Stroud

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.)?

And names for instances of classes are usually written in lowercase,
like foo in ``foo = CamelCase()``. So why are True and False
(instances of bool) capitalized? Shouldn't they be "true" and "false"?
Same goes for None.

My guess is that TRUE, FALSE, and NONE are fairly unbecoming and all
lowercase would not do justice to their status as language constants.
 
G

Gabriel Genellina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top