[Python-3000-checkins] r57009 - in python/branches/py3k: Doc/lib/libstring.tex Lib/string.py Lib/test/test_csv.py Lib/test/test_pkgimport.py Lib/test/test_string.py Misc/NEWS Tools/modulator/modulator.py Tools/scripts/texi2html.py
martin.v.loewis
python-3000-checkins at python.org
Tue Aug 14 11:23:11 CEST 2007
Author: martin.v.loewis
Date: Tue Aug 14 11:23:10 2007
New Revision: 57009
Modified:
python/branches/py3k/Doc/lib/libstring.tex
python/branches/py3k/Lib/string.py
python/branches/py3k/Lib/test/test_csv.py
python/branches/py3k/Lib/test/test_pkgimport.py
python/branches/py3k/Lib/test/test_string.py
python/branches/py3k/Misc/NEWS
python/branches/py3k/Tools/modulator/modulator.py
python/branches/py3k/Tools/scripts/texi2html.py
Log:
Remove string.{letters,lowercase,uppercase}.
Modified: python/branches/py3k/Doc/lib/libstring.tex
==============================================================================
--- python/branches/py3k/Doc/lib/libstring.tex (original)
+++ python/branches/py3k/Doc/lib/libstring.tex Tue Aug 14 11:23:10 2007
@@ -13,18 +13,18 @@
The constants defined in this module are:
-\begin{datadesc}{ascii_letters}
+\begin{datadesc}{ascii\_letters}
The concatenation of the \constant{ascii_lowercase} and
\constant{ascii_uppercase} constants described below. This value is
not locale-dependent.
\end{datadesc}
-\begin{datadesc}{ascii_lowercase}
+\begin{datadesc}{ascii\_lowercase}
The lowercase letters \code{'abcdefghijklmnopqrstuvwxyz'}. This
value is not locale-dependent and will not change.
\end{datadesc}
-\begin{datadesc}{ascii_uppercase}
+\begin{datadesc}{ascii\_uppercase}
The uppercase letters \code{'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}. This
value is not locale-dependent and will not change.
\end{datadesc}
@@ -37,23 +37,6 @@
The string \code{'0123456789abcdefABCDEF'}.
\end{datadesc}
-\begin{datadesc}{letters}
- The concatenation of the strings \constant{lowercase} and
- \constant{uppercase} described below. The specific value is
- locale-dependent, and will be updated when
- \function{locale.setlocale()} is called.
-\end{datadesc}
-
-\begin{datadesc}{lowercase}
- A string containing all the characters that are considered lowercase
- letters. On most systems this is the string
- \code{'abcdefghijklmnopqrstuvwxyz'}. Do not change its definition ---
- the effect on the routines \function{upper()} and
- \function{swapcase()} is undefined. The specific value is
- locale-dependent, and will be updated when
- \function{locale.setlocale()} is called.
-\end{datadesc}
-
\begin{datadesc}{octdigits}
The string \code{'01234567'}.
\end{datadesc}
@@ -69,16 +52,6 @@
\constant{punctuation}, and \constant{whitespace}.
\end{datadesc}
-\begin{datadesc}{uppercase}
- A string containing all the characters that are considered uppercase
- letters. On most systems this is the string
- \code{'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}. Do not change its definition ---
- the effect on the routines \function{lower()} and
- \function{swapcase()} is undefined. The specific value is
- locale-dependent, and will be updated when
- \function{locale.setlocale()} is called.
-\end{datadesc}
-
\begin{datadesc}{whitespace}
A string containing all characters that are considered whitespace.
On most systems this includes the characters space, tab, linefeed,
Modified: python/branches/py3k/Lib/string.py
==============================================================================
--- python/branches/py3k/Lib/string.py (original)
+++ python/branches/py3k/Lib/string.py Tue Aug 14 11:23:10 2007
@@ -16,17 +16,14 @@
# Some strings for ctype-style character classification
whitespace = ' \t\n\r\v\f'
-lowercase = 'abcdefghijklmnopqrstuvwxyz'
-uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-letters = lowercase + uppercase
-ascii_lowercase = lowercase
-ascii_uppercase = uppercase
+ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
+ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_letters = ascii_lowercase + ascii_uppercase
digits = '0123456789'
hexdigits = digits + 'abcdef' + 'ABCDEF'
octdigits = '01234567'
punctuation = """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
-printable = digits + letters + punctuation + whitespace
+printable = digits + ascii_letters + punctuation + whitespace
# Case conversion helpers
# Use str to convert Unicode literal in case of -U
Modified: python/branches/py3k/Lib/test/test_csv.py
==============================================================================
--- python/branches/py3k/Lib/test/test_csv.py (original)
+++ python/branches/py3k/Lib/test/test_csv.py Tue Aug 14 11:23:10 2007
@@ -645,7 +645,7 @@
def test_char_write(self):
import array, string
- a = array.array('u', string.letters)
+ a = array.array('u', string.ascii_letters)
with TemporaryFile("w+b") as fileobj:
writer = csv.writer(fileobj, dialect="excel")
Modified: python/branches/py3k/Lib/test/test_pkgimport.py
==============================================================================
--- python/branches/py3k/Lib/test/test_pkgimport.py (original)
+++ python/branches/py3k/Lib/test/test_pkgimport.py Tue Aug 14 11:23:10 2007
@@ -7,7 +7,7 @@
def __init__(self, *args, **kw):
self.package_name = 'PACKAGE_'
while self.package_name in sys.modules:
- self.package_name += random.choose(string.letters)
+ self.package_name += random.choose(string.ascii_letters)
self.module_name = self.package_name + '.foo'
unittest.TestCase.__init__(self, *args, **kw)
@@ -58,7 +58,7 @@
# ...make up a variable name that isn't bound in __builtins__
var = 'a'
while var in dir(__builtins__):
- var += random.choose(string.letters)
+ var += random.choose(string.ascii_letters)
# ...make a module that just contains that
self.rewrite_file(var)
Modified: python/branches/py3k/Lib/test/test_string.py
==============================================================================
--- python/branches/py3k/Lib/test/test_string.py (original)
+++ python/branches/py3k/Lib/test/test_string.py Tue Aug 14 11:23:10 2007
@@ -6,9 +6,9 @@
def test_attrs(self):
string.whitespace
- string.lowercase
- string.uppercase
- string.letters
+ string.ascii_lowercase
+ string.ascii_uppercase
+ string.ascii_letters
string.digits
string.hexdigits
string.octdigits
Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS (original)
+++ python/branches/py3k/Misc/NEWS Tue Aug 14 11:23:10 2007
@@ -202,7 +202,8 @@
- Remove obsolete functions:
* commands.getstatus(), os.popen*,
-- Remove functions in the string module that are also string methods.
+- Remove functions in the string module that are also string methods;
+ Remove string.{letters, lowercase, uppercase}.
- Remove support for long obsolete platforms: plat-aix3, plat-irix5.
Modified: python/branches/py3k/Tools/modulator/modulator.py
==============================================================================
--- python/branches/py3k/Tools/modulator/modulator.py (original)
+++ python/branches/py3k/Tools/modulator/modulator.py Tue Aug 14 11:23:10 2007
@@ -30,8 +30,8 @@
oops = 'oops'
-IDENTSTARTCHARS = string.letters + '_'
-IDENTCHARS = string.letters + string.digits + '_'
+IDENTSTARTCHARS = string.ascii_letters + '_'
+IDENTCHARS = string.ascii_letters + string.digits + '_'
# Check that string is a legal C identifier
def checkid(str):
Modified: python/branches/py3k/Tools/scripts/texi2html.py
==============================================================================
--- python/branches/py3k/Tools/scripts/texi2html.py (original)
+++ python/branches/py3k/Tools/scripts/texi2html.py Tue Aug 14 11:23:10 2007
@@ -2000,7 +2000,7 @@
def increment(s):
if not s:
return '1'
- for sequence in string.digits, string.lowercase, string.uppercase:
+ for sequence in string.digits, string.ascii_lowercase, string.ascii_uppercase:
lastc = s[-1]
if lastc in sequence:
i = sequence.index(lastc) + 1
More information about the Python-3000-checkins
mailing list