Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Lib/textwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ class TextWrapper:
Append to the last line of truncated text.
"""

unicode_whitespace_trans = {}
uspace = ord(' ')
for x in _whitespace:
unicode_whitespace_trans[ord(x)] = uspace
unicode_whitespace_trans = dict.fromkeys(map(ord, _whitespace), ord(' '))

# This funky little regex is just the trick for splitting
# text up into word-wrappable chunks. E.g.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Don't leak ``x`` & ``uspace`` intermediate vars in
:class:`textwrap.TextWrapper`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A news entry for such internal changes seems to have low value for end users!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's useful in the unlikely case someone is relying on these attributes.