Jasmeet
Jasmeet

Reputation: 1531

object is a class in python, but its first char is not capitalized

I am learning Python these days (from Code Accademy). As I was working with the classes, they mentioned as a naming convention class name's first letter is capitalized.

but when I see the class declaration, they always use superclass "object". i.e. first character is not capital. Although its just a naming converntion, does it has any special meaning too?

is there anything am missing?

Upvotes: 3

Views: 106

Answers (1)

Tamas Hegedus
Tamas Hegedus

Reputation: 29926

PEP8 suggests to use CapWords (or PascalCase) convention for class names, but it is mentioned that builtins follow a different convention:

Note that there is a separate convention for builtin names: most builtin names are single words (or two words run together), with the CapWords convention used only for exception names and builtin constants.

I should mention that PEP8 uses different names for naming styles than most of us (MSDN, Wikipedia):

common naming     pep8 naming
-------------     -----------
PascalCase        CapitalizedWords, CapWords, CamelCase
camelCase         mixedCase

Upvotes: 1

Related Questions