[pypy-svn] rev 847 - pypy/trunk/src/pypy/objspace/std

tismer at codespeak.net tismer at codespeak.net
Sat Jun 21 15:23:14 CEST 2003


Author: tismer
Date: Sat Jun 21 15:23:14 2003
New Revision: 847

Modified:
   pypy/trunk/src/pypy/objspace/std/boolobject.py
   pypy/trunk/src/pypy/objspace/std/booltype.py
Log:
reviewed, added test and tested, seems complete.

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	Sat Jun 21 15:23:14 2003
@@ -1,3 +1,11 @@
+"""
+Reviewed 03-06-21
+There are no new methods here, since everything is inherited
+from int, except:
+
+__repr__  tested, OK
+"""
+
 from pypy.objspace.std.objspace import *
 from booltype import W_BoolType
 import intobject
@@ -6,9 +14,9 @@
 class W_BoolObject(W_Object):
     statictype = W_BoolType
 
-    def __init__(w_self, space, boolval):# please pass in a real bool, not an int
+    def __init__(w_self, space, boolval):
         W_Object.__init__(w_self, space)
-        w_self.boolval = boolval
+        w_self.boolval = not not boolval
 
     def __nonzero__(w_self):
         raise Exception, "you cannot do that, you must use space.is_true()"

Modified: pypy/trunk/src/pypy/objspace/std/booltype.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/booltype.py	(original)
+++ pypy/trunk/src/pypy/objspace/std/booltype.py	Sat Jun 21 15:23:14 2003
@@ -1,3 +1,7 @@
+"""
+Reviewed 03-06-21
+"""
+
 from pypy.objspace.std.objspace import *
 from typeobject import W_TypeObject
 from inttype import W_IntType


More information about the Pypy-commit mailing list