[issue1071] unicode.translate() doesn't error out on invalid translation table

2007-09-03 Thread Georg Brandl
Georg Brandl added the comment: Yes, that makes sense. New patch attached, copying the dict and using PyDict_Next. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1071 __Index: Doc/library/stdtypes.rst

[issue1071] unicode.translate() doesn't error out on invalid translation table

2007-09-02 Thread Georg Brandl
Georg Brandl added the comment: Marc-Andre Lemburg schrieb: Marc-Andre Lemburg added the comment: Nice idea, but why don't you use a dictionary iterator (PyDict_Next()) for the fixup ? I thought that is unsafe to use when the dictionary is mutated while iterating.

[issue1071] unicode.translate() doesn't error out on invalid translation table

2007-09-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ah, I hadn't noticed that you're actually manipulating the input dictionary. You should create a copy and fix that instead of changing the dict that the user passed in to the function. You can then use PyDict_Next() for fast iteration over the original

[issue1071] unicode.translate() doesn't error out on invalid translation table

2007-09-02 Thread Martin v. Löwis
Changes by Martin v. Löwis: -- keywords: +patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1071 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1071] unicode.translate() doesn't error out on invalid translation table

2007-09-01 Thread Georg Brandl
Georg Brandl added the comment: Here's a patch that should make unicode.translate() more robust, and also allows unicode characters to be passed in the mapping. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1071 __Index:

[issue1071] unicode.translate() doesn't error out on invalid translation table

2007-09-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Nice idea, but why don't you use a dictionary iterator (PyDict_Next()) for the fixup ? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1071 __

[issue1071] unicode.translate() doesn't error out on invalid translation table

2007-08-31 Thread Georg Brandl
New submission from Georg Brandl: While it's documented that unicode.translate()s table maps ordinals to strings/ordinals/None, if you give a unicode key in the table it will just be ignored. This is quite surprising. -- assignee: lemburg components: Unicode messages: 55530 nosy: