[Python-Dev] Changes to PEP 327: Decimal data type

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Mar 17 21:35:01 EST 2004


Guido:

> It's hard not to wimp out, given that we can't change the existing
> library.

I'm not suggesting anything in the standard library should
be changed, but I can't see why we can't at least make some
recommendations about new additions to the library. The
fact that it's a bit of a mess doesn't seem like a reason
to keep on making it more messy.

> But for methodnaming there's much less a near-consensus in the
> standard library.

I just did an experiment which involved running the Python
script appended below over the Library Reference index.
The results were:

Total names: 1908
lower_names: 1684
Percent lower: 88.2599580713

An 88% majority seems like a fairly clear vote to me. :-)

---------------------------------------------------------------------
# Count function name styles from the Python Library Reference Index.
import re, sys
pat = re.compile(r"[A-Za-z_][A-Za-z0-9_]*\(\)")
all = {}
lc = {}
for line in sys.stdin:
  for word in pat.findall(line):
    all[word] = 1
    if word == word.lower():
      lc[word] = 1
print "Total names:", len(all)
print "lower_names:", len(lc)
print "Percent lower:", 100.0 * len(lc) / len(all)
---------------------------------------------------------------------

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list