Kaydet (Commit) 0e88c9f6 authored tarafından Greg Ward's avatar Greg Ward

Tweak generation of unicode_whitespace_trans -- clearer, more

efficient.  Suggested by MAL.
üst 32b4a1ba
......@@ -52,8 +52,9 @@ class TextWrapper:
' ' * len(string.whitespace))
unicode_whitespace_trans = {}
for c in string.whitespace:
unicode_whitespace_trans[ord(unicode(c))] = ord(u' ')
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
# text up into word-wrappable chunks. E.g.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment