[Python-checkins] python/dist/src/Lib textwrap.py,1.20,1.21

gward@users.sourceforge.net gward@users.sourceforge.net
Wed, 11 Dec 2002 05:54:23 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv12102

Modified Files:
	textwrap.py 
Log Message:
Tweak generation of unicode_whitespace_trans -- clearer, more
efficient.  Suggested by MAL.


Index: textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** textwrap.py	9 Dec 2002 16:26:05 -0000	1.20
--- textwrap.py	11 Dec 2002 13:54:20 -0000	1.21
***************
*** 53,58 ****
  
      unicode_whitespace_trans = {}
!     for c in string.whitespace:
!         unicode_whitespace_trans[ord(unicode(c))] = ord(u' ')
  
      # This funky little regex is just the trick for splitting
--- 53,59 ----
  
      unicode_whitespace_trans = {}
!     uspace = ord(u' ')
!     for x in map(ord, string.whitespace):
!         unicode_whitespace_trans[x] = uspace
  
      # This funky little regex is just the trick for splitting