python style guide inconsistencies

D

Darren Dale

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
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Darren said:
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
 
T

Terry Reedy

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

Bjoern Schliessmann

Darren said:
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!
 
?

=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=

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
 
D

Darren Dale

Bjoern said:
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.
 
P

Paddy

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

Terry Reedy

| 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
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top