Should Python class filenames also be camelCased?

The following answer is largely sourced from this answer.

If you’re going to follow PEP 8, you should stick to all-lowercase names, with optional underscores.

To quote PEP 8’s naming conventions for packages & modules:

Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability.

And for classes:

Class names should normally use the CapWords convention.

See this answer for the difference between a module, class and package:

A Python module is simply a Python source file, which can expose classes, functions and global variables.

Leave a Comment