python style guide inconsistencies

Discussion in 'Python' started by Darren Dale, Apr 22, 2007.

  1. Darren Dale

    Darren Dale Guest

    I was just searching for some guidance on how to name packages and modules,
    and discovered some inconsistencies on the www.python.org.
    http://www.python.org/doc/essays/styleguide.html says "Module names can be
    either MixedCase or lowercase." That page also refers to PEP 8 at
    http://www.python.org/dev/peps/pep-0008/, which says "Modules should have
    short, all-lowercase names. ... Python packages should also have short,
    all-lowercase names ...".

    Which is most up to date? Is this the right place to point out that one of
    those pages needs to be updated?

    Thanks,
    Darren
     
    Darren Dale, Apr 22, 2007
    #1
    1. Advertising

  2. Darren Dale schrieb:
    > I was just searching for some guidance on how to name packages and modules,
    > and discovered some inconsistencies on the www.python.org.
    > http://www.python.org/doc/essays/styleguide.html says "Module names can be
    > either MixedCase or lowercase." That page also refers to PEP 8 at
    > http://www.python.org/dev/peps/pep-0008/, which says "Modules should have
    > short, all-lowercase names. ... Python packages should also have short,
    > all-lowercase names ...".
    >
    > Which is most up to date? Is this the right place to point out that one of
    > those pages needs to be updated?


    No - this is better discussed on python-dev.

    In any case, there isn't technically a contradiction. Module names
    MUST be either MixedCase or lowercase; they SHOULD be lowercase.

    So unfortunately, for tradition, some module names are mixed case
    (such as ConfigParser or StringIO). I can personally accept that as
    a necessary evil, although I would prefer if all modules were
    lower case.

    Martin
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Apr 22, 2007
    #2
    1. Advertising

  3. Darren Dale

    Terry Reedy Guest

    ""Martin v. Löwis"" <> wrote in message
    news:...
    | Darren Dale schrieb:
    | > I was just searching for some guidance on how to name packages and
    modules,
    | > and discovered some inconsistencies on the www.python.org.
    | > http://www.python.org/doc/essays/styleguide.html says "Module names can
    be
    | > either MixedCase or lowercase." That page also refers to PEP 8 at
    | > http://www.python.org/dev/peps/pep-0008/, which says "Modules should
    have
    | > short, all-lowercase names. ... Python packages should also have short,
    | > all-lowercase names ...".
    | >
    | > Which is most up to date? Is this the right place to point out that one
    of
    | > those pages needs to be updated?
    |
    | No - this is better discussed on python-dev.
    |
    | In any case, there isn't technically a contradiction. Module names
    | MUST be either MixedCase or lowercase; they SHOULD be lowercase.
    |
    | So unfortunately, for tradition, some module names are mixed case
    | (such as ConfigParser or StringIO). I can personally accept that as
    | a necessary evil, although I would prefer if all modules were
    | lower case.

    I have the impression that tradition will change in 3.0 and your preference
    realized.
    Wrong? or have you not been following?

    To OP. Follow the should rather than the may.

    tjr
     
    Terry Reedy, Apr 22, 2007
    #3
  4. Darren Dale wrote:

    > I was just searching for some guidance on how to name packages and
    > modules, and discovered some inconsistencies on the
    > www.python.org. http://www.python.org/doc/essays/styleguide.html
    > says "Module names can be either MixedCase or lowercase." That
    > page also refers to PEP 8 at
    > http://www.python.org/dev/peps/pep-0008/, which says "Modules
    > should have short, all-lowercase names. ... Python packages should
    > also have short, all-lowercase names ...".
    >
    > Which is most up to date?


    The priority is, IMHO, clear. The old style guide essay says, at the
    beginning:

    | This style guide has been converted to several PEPs (Python
    | Enhancement Proposals): PEP 8 for the main text, PEP 257 for
    | docstring conventions. See the PEP index.

    So PEP 8 is the most recent.

    Regards,


    Björn

    --
    BOFH excuse #216:

    What office are you in? Oh, that one. Did you know that your
    building was built over the universities first nuclear research
    site? And wow, aren't you the lucky one, your office is right over
    where the core is buried!
     
    Bjoern Schliessmann, Apr 22, 2007
    #4

  5. > I have the impression that tradition will change in 3.0 and your preference
    > realized.
    > Wrong? or have you not been following?


    I have not been following, so this might be the case.

    Regards,
    Martin
     
    =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=, Apr 23, 2007
    #5
  6. Darren Dale

    Darren Dale Guest

    Bjoern Schliessmann wrote:

    > Darren Dale wrote:
    >
    >> I was just searching for some guidance on how to name packages and
    >> modules, and discovered some inconsistencies on the
    >> www.python.org. http://www.python.org/doc/essays/styleguide.html
    >> says "Module names can be either MixedCase or lowercase." That
    >> page also refers to PEP 8 at
    >> http://www.python.org/dev/peps/pep-0008/, which says "Modules
    >> should have short, all-lowercase names. ... Python packages should
    >> also have short, all-lowercase names ...".
    >>
    >> Which is most up to date?

    >
    > The priority is, IMHO, clear. The old style guide essay says, at the
    > beginning:
    >
    > | This style guide has been converted to several PEPs (Python
    > | Enhancement Proposals): PEP 8 for the main text, PEP 257 for
    > | docstring conventions. See the PEP index.
    >
    > So PEP 8 is the most recent.


    Then perhaps http://www.python.org/doc/essays/styleguide.html should either
    be updated to either agree with or simply link to PEPs 8 and 257. What is
    the point of keeping old, out-of-date essays up on python.org? That
    beginning comment does not indicate that the essay is any different from
    the PEPs.
     
    Darren Dale, Apr 23, 2007
    #6
  7. Darren Dale

    Paddy Guest

    On Apr 22, 8:27 pm, Darren Dale <> wrote:
    > I was just searching for some guidance on how to name packages and modules,
    > and discovered some inconsistencies on thewww.python.org.http://www.python.org/doc/essays/styleguide.htmlsays "Module names can be
    > either MixedCase or lowercase." That page also refers to PEP 8 athttp://www.python.org/dev/peps/pep-0008/, which says "Modules should have
    > short, all-lowercase names. ... Python packages should also have short,
    > all-lowercase names ...".
    >
    > Which is most up to date? Is this the right place to point out that one of
    > those pages needs to be updated?
    >
    > Thanks,
    > Darren



    In addition to the other replies on your direct question, it is also
    not a good idea to have modules whose names only differ by case.

    - Paddy.
     
    Paddy, Apr 23, 2007
    #7
  8. Darren Dale wrote:
    > Bjoern Schliessmann wrote:
    >
    >> Darren Dale wrote:
    >>
    >>> I was just searching for some guidance on how to name packages and
    >>> modules, and discovered some inconsistencies on the
    >>> www.python.org. http://www.python.org/doc/essays/styleguide.html
    >>> says "Module names can be either MixedCase or lowercase." That
    >>> page also refers to PEP 8 at
    >>> http://www.python.org/dev/peps/pep-0008/, which says "Modules
    >>> should have short, all-lowercase names. ... Python packages should
    >>> also have short, all-lowercase names ...".
    >>>
    >>> Which is most up to date?

    >> The priority is, IMHO, clear. The old style guide essay says, at the
    >> beginning:
    >>
    >> | This style guide has been converted to several PEPs (Python
    >> | Enhancement Proposals): PEP 8 for the main text, PEP 257 for
    >> | docstring conventions. See the PEP index.
    >>
    >> So PEP 8 is the most recent.

    >
    > Then perhaps http://www.python.org/doc/essays/styleguide.html should either
    > be updated to either agree with or simply link to PEPs 8 and 257. What is
    > the point of keeping old, out-of-date essays up on python.org? That
    > beginning comment does not indicate that the essay is any different from
    > the PEPs.


    http://wiki.python.org/moin/PythonWebsiteCreatingNewTickets

    --
    Michael Hoffman
     
    Michael Hoffman, Apr 23, 2007
    #8
  9. Darren Dale

    Terry Reedy Guest

    "Darren Dale" <> wrote in message
    news:f0ih8j$9o4$...
    | Then perhaps http://www.python.org/doc/essays/styleguide.html should
    either
    | be updated to either agree with or simply link to PEPs 8 and 257. What is
    | the point of keeping old, out-of-date essays up on python.org?

    Now that Guido has agreed with you (on pydev), wait a couple of days, if
    there is no response from one of webmasters, go to this page, click update
    suggestion link at bottom, and cut and paste his posting. No need for
    further discussion here. Thanks for following this thru. Persistence is
    how docs get improved.

    tjr
     
    Terry Reedy, Apr 23, 2007
    #9
    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. Christian Seberino
    Replies:
    21
    Views:
    1,680
    Stephen Horne
    Oct 27, 2003
  2. Ian Bicking
    Replies:
    2
    Views:
    1,030
    Steve Lamb
    Oct 23, 2003
  3. Ian Bicking
    Replies:
    2
    Views:
    730
    Michael Hudson
    Oct 24, 2003
  4. Maxim Khesin

    python style guide?

    Maxim Khesin, Dec 4, 2003, in forum: Python
    Replies:
    0
    Views:
    346
    Maxim Khesin
    Dec 4, 2003
  5. Anand S Bisen
    Replies:
    2
    Views:
    2,232
    Steve Holden
    Mar 4, 2005
Loading...

Share This Page