473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

python style guide inconsistencies

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
Apr 22 '07 #1
8 1407
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
Apr 22 '07 #2

""Martin v. Löwis"" <ma****@v.loewis.dewrote in message
news:46**************@v.loewis.de...
| 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

Apr 22 '07 #3
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!

Apr 22 '07 #4
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
Apr 23 '07 #5
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.
Apr 23 '07 #6
On Apr 22, 8:27 pm, Darren Dale <d...@cornell.eduwrote:
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.

Apr 23 '07 #7
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/PythonWe...tingNewTickets

--
Michael Hoffman
Apr 23 '07 #8

"Darren Dale" <dd**@cornell.eduwrote in message
news:f0**********@ruby.cit.cornell.edu...
| 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


Apr 23 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Christian Seberino | last post by:
Linux kernel style guide, Guido's C style guide and (I believe) old K&R style recommends 8 SPACES for indent. I finally got convinced of wisdom of 8 space indentation. Guido also likes 8 space...
22
by: beliavsky | last post by:
Is there a more recent set of Python style guidelines than PEP 8, "Style Guide for Python Code", by van Rossum and Warsaw, at http://www.python.org/peps/pep-0008.html , which is dated July 5, 2001?
77
by: Hunn E. Balsiche | last post by:
in term of its OO features, syntax consistencies, ease of use, and their development progress. I have not use python but heard about it quite often; and ruby, is it mature enough to be use for...
75
by: Xah Lee | last post by:
http://python.org/doc/2.4.1/lib/module-re.html http://python.org/doc/2.4.1/lib/node114.html --------- QUOTE The module defines several functions, constants, and an exception. Some of the...
4
by: vegetax | last post by:
in python it is common to see naming inconsistencies ,methods,modules,packages,classes with names in every posible style: thisisalongmethod ThisIsALongMethod thisIsALongMethod...
12
by: Xah Lee | last post by:
i noticed that Python uses various logos: http://python.org/pics/pythonHi.gif http://python.org/pics/PyBanner038.gif http://python.org/pics/PyBanner037.gif...
4
by: Fredrik Lundh | last post by:
(reposted from doc-sig, which seems to be mostly dead these days). over at the pytut wiki, "carndt" asked: Are there any guidelines about conventions concerning punctuation, text styles and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.