Capitalization of filenames storing Python classes
Question: **C++**

I use a rigorous rule of capitalizing class names.

Over many years I tried to use the somewhat inconsistent rule of using
lowercase names for the files—when writing in C++.

For example, `class Stopwatch` would be in the files `stopwatch.hpp` and
`stopwatch.cpp`.

I am not sure at this point how or why I found that this is awkward, but I'm
reasonably sure that it turned out to be. I use exactly the same case for the
files. One benefit is that it helps avoid [annoying
issues](http://stackoverflow.com/q/38309106/704972) in version control on OS
X.

**Python**

[PEP 8](https://www.python.org/dev/peps/pep-0008/) recommends lowercase names
for modules and packages. It makes no recommendations regarding filenames
holding classes.

Is there such a recommendation or some best practices?


Answer: In python each file is a module so to follow PEP8 your code should be as
follows

    
    
    from stopwatch import Stopwatch
    

Therefore the file should be stopwatch.py

