[Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.158, 1.159 libunicodedata.tex, 1.5, 1.6

perky at users.sourceforge.net perky at users.sourceforge.net
Wed Aug 4 09:38:36 CEST 2004


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1744/Doc/lib

Modified Files:
	libstdtypes.tex libunicodedata.tex 
Log Message:
SF #989185: Drop unicode.iswide() and unicode.width() and add
unicodedata.east_asian_width().  You can still implement your own
simple width() function using it like this:
    def width(u):
        w = 0
        for c in unicodedata.normalize('NFC', u):
            cwidth = unicodedata.east_asian_width(c)
            if cwidth in ('W', 'F'): w += 2
            else: w += 1
        return w


Index: libstdtypes.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v
retrieving revision 1.158
retrieving revision 1.159
diff -C2 -d -r1.158 -r1.159
*** libstdtypes.tex	22 Jul 2004 19:33:53 -0000	1.158
--- libstdtypes.tex	4 Aug 2004 07:38:33 -0000	1.159
***************
*** 665,674 ****
  \end{methoddesc}
  
- \begin{methoddesc}[string]{iswide}{}
- Return true if all characters in the string are wide or full width and
- there is at least one wide or full width character, false otherwise.
- This method is supported by unicode type only.
- \end{methoddesc}
- 
  \begin{methoddesc}[string]{join}{seq}
  Return a string which is the concatenation of the strings in the
--- 665,668 ----
***************
*** 811,819 ****
  \end{methoddesc}
  
- \begin{methoddesc}[string]{width}{}
- Return length of fixed-width representation of the string. This method
- is supported by unicode type only.
- \end{methoddesc}
- 
  \begin{methoddesc}[string]{zfill}{width}
  Return the numeric string left filled with zeros in a string
--- 805,808 ----

Index: libunicodedata.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libunicodedata.tex,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** libunicodedata.tex	25 Nov 2002 09:13:35 -0000	1.5
--- libunicodedata.tex	4 Aug 2004 07:38:33 -0000	1.6
***************
*** 72,75 ****
--- 72,80 ----
  \end{funcdesc}
  
+ \begin{funcdesc}{east_asian_width}{unichr}
+   Returns the east asian width of assigned to the Unicode character
+   \var{unichr} as string.
+ \end{funcdesc}
+ 
  \begin{funcdesc}{mirrored}{unichr}
    Returns the mirrored property of assigned to the Unicode character
***************
*** 124,126 ****
  
  \versionadded{2.3}
! \end{datadesc}
\ No newline at end of file
--- 129,131 ----
  
  \versionadded{2.3}
! \end{datadesc}



More information about the Python-checkins mailing list