]> granicus.if.org Git - python/commitdiff
Added the constants ascii_letters, ascii_lowercase, and ascii_uppercase
authorFred Drake <fdrake@acm.org>
Fri, 20 Jul 2001 18:38:26 +0000 (18:38 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 20 Jul 2001 18:38:26 +0000 (18:38 +0000)
to the string module.  This was determined to be the right approach in
SF bug #226706.

Doc/lib/libstring.tex
Lib/string.py
Misc/NEWS

index 38a0dbd2cdd6728042f4192c60838e1ee7bb1ef7..7e74c18f95165ec1a11cbf0437f37e6f23c47255 100644 (file)
@@ -12,6 +12,22 @@ expressions.
 
 The constants defined in this module are:
 
+\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}
+  The lowercase letters \code{'abcdefghijklmnopqrstuvwxyz'}.  This
+  value is not locale-dependent and will not change.
+\end{datadesc}
+
+\begin{datadesc}{ascii_uppercase}
+  The uppercase letters \code{'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}.  This
+  value is not locale-dependent and will not change.
+\end{datadesc}
+
 \begin{datadesc}{digits}
   The string \code{'0123456789'}.
 \end{datadesc}
@@ -22,7 +38,9 @@ The constants defined in this module are:
 
 \begin{datadesc}{letters}
   The concatenation of the strings \constant{lowercase} and
-  \constant{uppercase} described below.
+  \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}
@@ -30,7 +48,9 @@ The constants defined in this module are:
   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.
+  \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}
@@ -53,7 +73,9 @@ The constants defined in this module are:
   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.
+  \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}
index 913d980bae6df9425f1c1cda80fd5de6dfbeb18f..d682fc7abcfed2bcbc5461583445cc2a201bb188 100644 (file)
@@ -24,6 +24,9 @@ whitespace = ' \t\n\r\v\f'
 lowercase = 'abcdefghijklmnopqrstuvwxyz'
 uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 letters = lowercase + uppercase
+ascii_lowercase = lowercase
+ascii_uppercase = uppercase
+ascii_letters = ascii_lowercase + ascii_uppercase
 digits = '0123456789'
 hexdigits = digits + 'abcdef' + 'ABCDEF'
 octdigits = '01234567'
index 55eddedbd71c09ff61aa2dffe3831962530b3aef..344949c2b0eaed5598ee422218dc374a2d58ce66 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -149,6 +149,11 @@ Core
 
 Library
 
+- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
+  were added to the string module.  These a locale-indenpendent
+  constants, unlike letters, lowercase, and uppercase.  These are now
+  use in appropriate locations in the standard library.
+
 - The flags used in dlopen calls can now be configured using
   sys.setdlopenflags and queried using sys.getdlopenflags.