[pypy-svn] r71431 - pypy/trunk/pypy/objspace/std
agaynor at codespeak.net
agaynor at codespeak.net
Tue Feb 23 16:44:59 CET 2010
Author: agaynor
Date: Tue Feb 23 16:44:58 2010
New Revision: 71431
Modified:
pypy/trunk/pypy/objspace/std/stringobject.py
Log:
Make str.upper and str.lower use their rlib implementations.
Modified: pypy/trunk/pypy/objspace/std/stringobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/stringobject.py (original)
+++ pypy/trunk/pypy/objspace/std/stringobject.py Tue Feb 23 16:44:58 2010
@@ -161,21 +161,11 @@
def str_upper__String(space, w_self):
self = w_self._value
- res = [' '] * len(self)
- for i in range(len(self)):
- ch = self[i]
- res[i] = _upper(ch)
-
- return space.wrap("".join(res))
+ return space.wrap(self.upper())
def str_lower__String(space, w_self):
self = w_self._value
- res = [' '] * len(self)
- for i in range(len(self)):
- ch = self[i]
- res[i] = _lower(ch)
-
- return space.wrap("".join(res))
+ return space.wrap(self.lower())
def str_swapcase__String(space, w_self):
self = w_self._value
More information about the Pypy-commit
mailing list