PEP for module naming conventions

T

Tim Johnson

I need to be better informed on naming conventions for modules. For
instance, I need to create a new module and I want to make sure that
the module name will not conflict with any future or current python
system module names.

There may be a PEP for this, if so, a URL to such a PEP would
suffice for my inquiry. Also, if there is an index of PEPs, a link
to such would also be appreciated.

thanks
 
T

Tim Johnson

* Ben Finney said:
You'll never be able to make sure of that, and you would be needlessly
eliminating a whole lot of potentially useful names for your modules.

Have you read and understood PEP 328, which introduces the distinction
between relative and absolute imports? It's designed to avoid the
problem your describing <URL:http://www.python.org/dev/peps/pep-0328/>.
Have read, don't fully understand, but it sounds like the dust
hasn't settled yet. It will sink in.
thanks
tim
 
M

Mel

Tim said:
I need to be better informed on naming conventions for modules. For
instance, I need to create a new module and I want to make sure that
the module name will not conflict with any future or current python
system module names.

COBOL in its golden years had a practice that reserved words were almost
never hyphenated -- the few that were could be counted on the fingers of
perhaps four hands and were mostly required paragraph names that were always
used and hard to forget.

It might turn out well to specify that system module names will never
contain more than, say, one underscore. That way, nice descriptive
application module names like 'analyzer_tool_utils' and such would always be
safe to use.

Mel.
 
J

Jonathan Gossage

I have found this approach problematic if you have packages separately
developed and maintained in different directory trees, resulting in
more than one PYTHONPATH entry with the same root metapackage name.
What happens is that only the first entry in the PYTHONPATH containing
the metapackage name is looked in for package/module resolution. Do
you have any suggestions for handling this kind of packaging?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top