[pypy-commit] pypy py3k: I *think* that we have to kill this implementation of the multimethod: in py3k we only accept strings as arguments for replace

antocuni noreply at buildbot.pypy.org
Mon Mar 19 18:02:56 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r53804:8568c4bf99d7
Date: 2012-03-19 16:59 +0100
http://bitbucket.org/pypy/pypy/changeset/8568c4bf99d7/

Log:	I *think* that we have to kill this implementation of the
	multimethod: in py3k we only accept strings as arguments for replace

diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -711,18 +711,6 @@
     return _unicode_replace(space, w_self, w_old._value, w_new._value,
                             w_maxsplit)
 
-def unicode_replace__Unicode_ANY_ANY_ANY(space, w_self, w_old, w_new,
-                                         w_maxsplit):
-    if not space.isinstance_w(w_old, space.w_unicode):
-        old = unicode(space.bufferstr_w(w_old))
-    else:
-        old = space.unicode_w(w_old)
-    if not space.isinstance_w(w_new, space.w_unicode):
-        new = unicode(space.bufferstr_w(w_new))
-    else:
-        new = space.unicode_w(w_new)
-    return _unicode_replace(space, w_self, old, new, w_maxsplit)
-
 def _unicode_replace(space, w_self, old, new, w_maxsplit):
     if len(old):
         parts = _split_with(w_self._value, old, space.int_w(w_maxsplit))


More information about the pypy-commit mailing list