python: naming a module that has a two-word name

If you have to, always use underscores _.

Using a dot . would not even work, otherwise

from scons.config import whatever

would break.

But PEP 8 clearly describes it:

Package and Module Names

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.

UPDATE:

To directly target your question: I think sconsconfig is fine. It is not too long and quite readable.

But honestly, I don't think anyone will blame you if you use underscores and your code will run with either decision. There is always a certain level where you should not care that much anymore.


First, the module name is the same as the name of the single .py file. In Python-speak, a collection of several .py files is a package.

PEP-8 discourages breaking up package names with underscores. A quick peak at my site-packages directory shows that multiword names are commonly just run together (e.g., setuptools, sqlalchemy)

Module names (that is, file names) may be broken up by underscores (and I usually do this, because I hate namesthatruntogethersoyoucanhardlyreadthem).

Stick with lower-case only (per PEP-8). This avoids problems when going from case-sensitive to case-insensitive filesystems and vice versa.