This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Rosuav
Recipients Rosuav
Date 2013-11-16.04:46:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384577203.93.0.74432815372.issue19621@psf.upfronthosting.co.za>
In-reply-to
Content
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? :)
History
Date User Action Args
2013-11-16 04:46:43Rosuavsetrecipients: + Rosuav
2013-11-16 04:46:43Rosuavsetmessageid: <1384577203.93.0.74432815372.issue19621@psf.upfronthosting.co.za>
2013-11-16 04:46:43Rosuavlinkissue19621 messages
2013-11-16 04:46:43Rosuavcreate