[pypy-svn] rev 925 - pypy/trunk/src/pypy/objspace/std
mwh at codespeak.net
mwh at codespeak.net
Sun Jun 22 13:01:18 CEST 2003
Author: mwh
Date: Sun Jun 22 13:01:17 2003
New Revision: 925
Added:
pypy/trunk/src/pypy/objspace/std/nullobject.py
pypy/trunk/src/pypy/objspace/std/nulltype.py
Log:
oops: add nullobject.py
Added: pypy/trunk/src/pypy/objspace/std/nullobject.py
==============================================================================
--- (empty file)
+++ pypy/trunk/src/pypy/objspace/std/nullobject.py Sun Jun 22 13:01:17 2003
@@ -0,0 +1,24 @@
+"""
+ Null Object implementation
+
+ ok and tested
+"""
+
+from pypy.objspace.std.objspace import *
+from nulltype import W_NullType
+
+class W_NullObject(W_Object):
+ statictype = W_NullType
+registerimplementation(W_NullObject)
+
+def unwrap__Null(space, w_null):
+ return Null
+
+def is_true__Null(space, w_null):
+ return False
+
+def repr__Null(space, w_null):
+ return space.wrap('Null')
+
+register_all(vars())
+
Added: pypy/trunk/src/pypy/objspace/std/nulltype.py
==============================================================================
--- (empty file)
+++ pypy/trunk/src/pypy/objspace/std/nulltype.py Sun Jun 22 13:01:17 2003
@@ -0,0 +1,7 @@
+from pypy.objspace.std.objspace import *
+from typeobject import W_TypeObject
+
+
+class W_NullType(W_TypeObject):
+
+ typename = 'NullType'
More information about the Pypy-commit
mailing list