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
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.
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
Changes by Martin v. Löwis:
--
keywords: +patch
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1071
__
___
Python-bugs-list mailing list
Unsubscribe:
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:
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
__
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: