New submission from Chris Angelico: In an interactive session, typing 'import this' a second time doesn't produce output (as the module's already imported). Peeking into the module shows a string and what looks like a translation dictionary, but doing the obvious thing:
>>> this.s.translate(this.d) doesn't work, because str.translate() expects a dictionary that maps Unicode ordinals, not one-character strings. Attached is a patch which makes Lib/this.py use s.translate() instead of the wordier comprehension. Dare I ask, is there any possible code that this change could break? :) ---------- components: Library (Lib) files: this-translate.patch keywords: patch messages: 203008 nosy: Rosuav priority: normal severity: normal status: open title: Reimporting this and str.translate() type: enhancement versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file32645/this-translate.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19621> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com