473,780 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1423
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.loewi s.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.e duwrote:
I was just searching for some guidance on how to name packages and modules,
and discovered some inconsistencies on thewww.python.o rg.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.e duwrote in message
news:f0******** **@ruby.cit.cor nell.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
4027
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 indentation FOR C CODE. Why style guide (PEP-8) for Python says 4 space indents??? Is breaking rule to use 8 space indents everywhere
22
2220
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
4065
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 developing serious application, e.g web application as it has not many features in it yet. I've given up on Perl for its ugly syntax and it is not the easiest language to learn. How about PHP? Thanks
75
4670
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 functions are simplified versions of the full featured methods for compiled regular expressions. Most non-trivial applications always use the compiled form UNQUOTE
4
1397
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 this_is_a_long_method and even This_Is_A_Long_Method All over the place,even within one module!
12
2607
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 http://python.org/pics/PythonPoweredSmall.gif http://wiki.python.org/pics/PyBanner057.gif is this some decision that python should use various different logos?
4
1346
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 language style (e.g. how to address the reader)? any suggestions from this list ?
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9931
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.