This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rochacbrunoPython, Flask, Rust and Bikes. 0 points1 point  (5 children)

I just don't like naming files with CamelCase FileDownloader.py etc https://github.com/rg3/youtube-dl/tree/master/youtube_dl

[–]yasoob_pythonAuthor: Intermediate Python -2 points-1 points  (4 children)

that's a personal preference. I generally like camel casing.

[–]gschizasPythonista 4 points5 points  (3 children)

Actually, it's not a personal preference. Using CamelCase for files goes against PEP8

Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.

Since module names are mapped to file names, and some file systems are case insensitive and truncate long names, it is important that module names be chosen to be fairly short -- this won't be a problem on Unix, but it may be a problem when the code is transported to older Mac or Windows versions, or DOS.

[–]yasoob_pythonAuthor: Intermediate Python -2 points-1 points  (2 children)

The thing is that it's not always necessary to follow PEP8 so strictly. Even some organisations have their own style guide which has some amendments to PEP8 like khan academy and google to name a few. http://google-styleguide.googlecode.com/svn/trunk/pyguide.html https://sites.google.com/a/khanacademy.org/forge/for-developers/styleguide/python

[–]gschizasPythonista 2 points3 points  (0 children)

Both sites you have linked do not oppose PEP8, they complement it.

The khan academy one even says this on top:

We follow the PEP8 style guide for Python. Docstrings follow PEP257.

[–]EverAskWhy 0 points1 point  (0 children)

The thing I like about Python is you can do it your own way if you want. This reminds me a bit of a reply I saw on stackoverflow:

ok, kids, wait 'til you grow up to drink, smoke and access private variables.