PEP for module naming conventions

Discussion in 'Python' started by Tim Johnson, Mar 11, 2011.

  1. Tim Johnson

    Tim Johnson Guest

    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
    --
    Tim
    tim at johnsons-web.com or akwebsoft.com
    http://www.akwebsoft.com
    Tim Johnson, Mar 11, 2011
    #1
    1. Advertising

  2. Tim Johnson

    Tim Johnson Guest

    * Ben Finney <> [110313 17:15]:
    > Tim Johnson <> writes:
    >
    > > 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.

    >
    > 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

    > > 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.

    >
    > PEP 0 is the index of all PEPs
    > <URL:http://www.python.org/dev/peps/pep-0000/>.
    >
    > --
    > \ “Pinky, are you pondering what I'm pondering?†“I think so, |
    > `\ Brain, but if we have nothing to fear but fear itself, why does |
    > _o__) Elanore Roosevelt wear that spooky mask?†—_Pinky and The Brain_ |
    > Ben Finney
    > --
    > http://mail.python.org/mailman/listinfo/python-list


    --
    Tim
    tim at johnsons-web.com or akwebsoft.com
    http://www.akwebsoft.com
    Tim Johnson, Mar 14, 2011
    #2
    1. Advertising

  3. Tim Johnson

    Mel Guest

    Tim Johnson wrote:

    > 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.
    Mel, Mar 17, 2011
    #3
  4. 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?


    On Thu, Mar 17, 2011 at 12:17 PM, eryksun () <> wrote:
    > On Friday, March 11, 2011 4:52:57 PM UTC-5, Tim Johnson wrote:
    >> 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.

    >
    > Do you mean package names? Within a package you can use relative imports to avoid conflicts. You could put all of your packages in a metapackage namespace with a unique name -- a company/group name or personal/family name, an uncommon English word, or something from another language.
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
    Jonathan Gossage, Mar 17, 2011
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =B=
    Replies:
    4
    Views:
    9,264
  2. Floppy Jellopy

    Namespaces and Naming conventions

    Floppy Jellopy, Jul 20, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    510
    Kevin Spencer
    Jul 21, 2005
  3. Josh  Wolf
    Replies:
    2
    Views:
    3,244
    Martin Robins
    Mar 31, 2006
  4. grackle

    module naming conventions

    grackle, Jan 14, 2008, in forum: Python
    Replies:
    9
    Views:
    436
    Jorgen Grahn
    Jan 17, 2008
  5. Edwin Fine
    Replies:
    2
    Views:
    105
Loading...

Share This Page