[pypy-svn] rev 751 - pypy/trunk/src/pypy/objspace/std
arigo at codespeak.net
arigo at codespeak.net
Thu Jun 5 17:48:30 CEST 2003
Author: arigo
Date: Thu Jun 5 17:48:29 2003
New Revision: 751
Added:
pypy/trunk/src/pypy/objspace/std/slicetype.py
Modified:
pypy/trunk/src/pypy/objspace/std/objspace.py
pypy/trunk/src/pypy/objspace/std/sliceobject.py
Log:
added slicetype.py
Modified: pypy/trunk/src/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/objspace.py (original)
+++ pypy/trunk/src/pypy/objspace/std/objspace.py Thu Jun 5 17:48:29 2003
@@ -56,6 +56,7 @@
from dicttype import W_DictType
from stringtype import W_StringType
from typetype import W_TypeType
+ from slicetype import W_SliceType
return [value for key, value in result.__dict__.items()
if not key.startswith('_')] # don't look
Modified: pypy/trunk/src/pypy/objspace/std/sliceobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/sliceobject.py (original)
+++ pypy/trunk/src/pypy/objspace/std/sliceobject.py Thu Jun 5 17:48:29 2003
@@ -2,11 +2,14 @@
from pypy.interpreter.appfile import AppFile
from pypy.interpreter.extmodule import make_builtin_func
from pypy.objspace.std.instmethobject import W_InstMethObject
+from slicetype import W_SliceType
appfile = AppFile(__name__, ["objspace.std"])
class W_SliceObject(W_Object):
+ statictype = W_SliceType
+
def __init__(w_self, space, w_start, w_stop, w_step):
W_Object.__init__(w_self, space)
w_self.w_start = w_start
@@ -20,6 +23,9 @@
return w_self.space.newtuple(w_self.indices(w_length)[:-1])
+registerimplementation(W_SliceObject)
+
+
def getattr_slice_any(space, w_slice, w_attr):
if space.is_true(space.eq(w_attr, space.wrap('start'))):
if w_slice.w_start is None:
Added: pypy/trunk/src/pypy/objspace/std/slicetype.py
==============================================================================
--- (empty file)
+++ pypy/trunk/src/pypy/objspace/std/slicetype.py Thu Jun 5 17:48:29 2003
@@ -0,0 +1,7 @@
+from pypy.objspace.std.objspace import *
+from typeobject import W_TypeObject
+
+
+class W_SliceType(W_TypeObject):
+
+ typename = 'slice'
More information about the Pypy-commit
mailing list