I’m trying to put together a really simple module with one .py source file in it, and have already run into a roadblock. I was going to call it scons-config but import scons-config doesn’t work in Python. I found this SO question and looked at PEP8 style guide but am kind of bewildered, it doesn’t talk about two-word-name conventions.
What’s the right way to deal with this?
- module name: SconsConfig? scons_config? sconsconfig? scons.config?
- name of the single .py file in it: scons-config.py? scons_config.py?
edit: I did see “the use of underscores is discouraged” and that left me at a dead end: should I use “sconsconfig” or “scons_config” (I guess the other ones are out)?
If you have to, always use underscores
_.Using a dot
.would not even work, otherwisewould break.
But PEP 8 clearly describes it:
UPDATE:
To directly target your question: I think
sconsconfigis 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.