[pypy-svn] rev 741 - pypy/trunk/src/pypy/objspace/std
tomek at codespeak.net
tomek at codespeak.net
Fri May 30 21:04:39 CEST 2003
Author: tomek
Date: Fri May 30 21:04:39 2003
New Revision: 741
Modified:
pypy/trunk/src/pypy/objspace/std/boolobject.py
pypy/trunk/src/pypy/objspace/std/stringobject.py
Log:
ok
Modified: pypy/trunk/src/pypy/objspace/std/boolobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/boolobject.py (original)
+++ pypy/trunk/src/pypy/objspace/std/boolobject.py Fri May 30 21:04:39 2003
@@ -17,7 +17,7 @@
return (isinstance(w_other, W_BoolObject) and
w_self.boolval == w_other.boolval)
- def __nonzero__(self):
+ def __nonzero__(w_self):
raise Exception, "you cannot do that, you must use space.is_true()"
Modified: pypy/trunk/src/pypy/objspace/std/stringobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/stringobject.py (original)
+++ pypy/trunk/src/pypy/objspace/std/stringobject.py Fri May 30 21:04:39 2003
@@ -46,6 +46,13 @@
return (o>=97 and o<=122) \
or (o>=65 and o<=90) \
or (o>=48 and o<=57)
+def _isupper(ch):
+ o = ord(ch)
+ return (o>=65 and o<=90)
+
+def _islower(ch):
+ o = ord(ch)
+ return (o>=97 and o<=122)
def _is_generic(w_self, fun):
@@ -81,6 +88,8 @@
def str_islower(space, w_self):
return _is_generic(w_self, _islower)
+def str_istitle(space, w_self):
+ pass
def str_splitByWhitespace(space, w_self, w_none):
res = []
@@ -126,7 +135,11 @@
W_StringType.str_isspace.register(str_isspace, W_StringObject)
W_StringType.str_isdigit.register(str_isdigit, W_StringObject)
-
+W_StringType.str_isalpha.register(str_isalpha, W_StringObject)
+W_StringType.str_isupper.register(str_isupper, W_StringObject)
+W_StringType.str_islower.register(str_islower, W_StringObject)
+W_StringType.str_istitle.register(str_istitle, W_StringObject)
+W_StringType.str_isalnum.register(str_isalnum, W_StringObject)
def str_join(space, w_self, w_list):
list = space.unpackiterable(w_list)
More information about the Pypy-commit
mailing list