[Python-Dev] Changes to PEP 327: Decimal data type (original) (raw)
Guido van Rossum guido at python.org
Wed Mar 17 22:15:28 EST 2004
- Previous message: [Python-Dev] Changes to PEP 327: Decimal data type
- Next message: [Python-Dev] Changes to PEP 327: Decimal data type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I just did an experiment which involved running the Python script appended below over the Library Reference index. The results were:
Total names: 1908 lowernames: 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 "lowernames:", len(lc) print "Percent lower:", 100.0 * len(lc) / len(all) ---------------------------------------------------------------------
Now try that again but only look for names following 'def'.
You've counted all language keywords, builtins, modules, etc.
We should be looking for method and function definitions only.
OTOH, since Tim has Spoken, maybe we should just adopt alllowercase() as the preferred convention. :)
--Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] Changes to PEP 327: Decimal data type
- Next message: [Python-Dev] Changes to PEP 327: Decimal data type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]