[pypy-svn] r69496 - pypy/trunk/pypy/objspace/std
arigo at codespeak.net
arigo at codespeak.net
Sat Nov 21 18:53:50 CET 2009
Author: arigo
Date: Sat Nov 21 18:53:49 2009
New Revision: 69496
Modified:
pypy/trunk/pypy/objspace/std/complexobject.py
pypy/trunk/pypy/objspace/std/floatobject.py
pypy/trunk/pypy/objspace/std/longobject.py
pypy/trunk/pypy/objspace/std/noneobject.py
pypy/trunk/pypy/objspace/std/ropeobject.py
pypy/trunk/pypy/objspace/std/ropeunicodeobject.py
pypy/trunk/pypy/objspace/std/sliceobject.py
pypy/trunk/pypy/objspace/std/stringobject.py
pypy/trunk/pypy/objspace/std/tupleobject.py
pypy/trunk/pypy/objspace/std/unicodeobject.py
Log:
A generous sprinkle of "_immutable_=True" in the std object space.
Modified: pypy/trunk/pypy/objspace/std/complexobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/complexobject.py (original)
+++ pypy/trunk/pypy/objspace/std/complexobject.py Sat Nov 21 18:53:49 2009
@@ -8,8 +8,8 @@
class W_ComplexObject(W_Object):
"""This is a reimplementation of the CPython "PyComplexObject"
"""
-
from pypy.objspace.std.complextype import complex_typedef as typedef
+ _immutable_ = True
def __init__(w_self, realval=0.0, imgval=0.0):
w_self.realval = float(realval)
Modified: pypy/trunk/pypy/objspace/std/floatobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/floatobject.py (original)
+++ pypy/trunk/pypy/objspace/std/floatobject.py Sat Nov 21 18:53:49 2009
@@ -13,7 +13,8 @@
it is assumed that the constructor takes a real Python float as
an argument"""
from pypy.objspace.std.floattype import float_typedef as typedef
-
+ _immutable_ = True
+
def __init__(w_self, floatval):
w_self.floatval = floatval
Modified: pypy/trunk/pypy/objspace/std/longobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/longobject.py (original)
+++ pypy/trunk/pypy/objspace/std/longobject.py Sat Nov 21 18:53:49 2009
@@ -7,7 +7,8 @@
class W_LongObject(W_Object):
"""This is a wrapper of rbigint."""
from pypy.objspace.std.longtype import long_typedef as typedef
-
+ _immutable_ = True
+
def __init__(w_self, l):
w_self.num = l # instance of rbigint
Modified: pypy/trunk/pypy/objspace/std/noneobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/noneobject.py (original)
+++ pypy/trunk/pypy/objspace/std/noneobject.py Sat Nov 21 18:53:49 2009
@@ -8,6 +8,7 @@
class W_NoneObject(W_Object):
from pypy.objspace.std.nonetype import none_typedef as typedef
+ _immutable_ = True
def unwrap(w_self, space):
return None
Modified: pypy/trunk/pypy/objspace/std/ropeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/ropeobject.py (original)
+++ pypy/trunk/pypy/objspace/std/ropeobject.py Sat Nov 21 18:53:49 2009
@@ -16,6 +16,7 @@
class W_RopeObject(W_Object):
from pypy.objspace.std.stringtype import str_typedef as typedef
+ _immutable_ = True
def __init__(w_self, node):
if not we_are_translated():
Modified: pypy/trunk/pypy/objspace/std/ropeunicodeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/ropeunicodeobject.py (original)
+++ pypy/trunk/pypy/objspace/std/ropeunicodeobject.py Sat Nov 21 18:53:49 2009
@@ -73,6 +73,7 @@
class W_RopeUnicodeObject(W_Object):
from pypy.objspace.std.unicodetype import unicode_typedef as typedef
+ _immutable_ = True
def __init__(w_self, node):
w_self._node = node
Modified: pypy/trunk/pypy/objspace/std/sliceobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/sliceobject.py (original)
+++ pypy/trunk/pypy/objspace/std/sliceobject.py Sat Nov 21 18:53:49 2009
@@ -12,7 +12,8 @@
class W_SliceObject(W_Object):
from pypy.objspace.std.slicetype import slice_typedef as typedef
-
+ _immutable_ = True
+
def __init__(w_self, w_start, w_stop, w_step):
assert w_start is not None
assert w_stop is not None
Modified: pypy/trunk/pypy/objspace/std/stringobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/stringobject.py (original)
+++ pypy/trunk/pypy/objspace/std/stringobject.py Sat Nov 21 18:53:49 2009
@@ -20,8 +20,8 @@
class W_StringObject(W_Object):
from pypy.objspace.std.stringtype import str_typedef as typedef
-
_immutable_ = True
+
def __init__(w_self, str):
w_self._value = str
Modified: pypy/trunk/pypy/objspace/std/tupleobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/tupleobject.py (original)
+++ pypy/trunk/pypy/objspace/std/tupleobject.py Sat Nov 21 18:53:49 2009
@@ -7,6 +7,7 @@
class W_TupleObject(W_Object):
from pypy.objspace.std.tupletype import tuple_typedef as typedef
+ _immutable_ = True
def __init__(w_self, wrappeditems):
make_sure_not_resized(wrappeditems)
Modified: pypy/trunk/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/unicodeobject.py (original)
+++ pypy/trunk/pypy/objspace/std/unicodeobject.py Sat Nov 21 18:53:49 2009
@@ -16,6 +16,7 @@
class W_UnicodeObject(W_Object):
from pypy.objspace.std.unicodetype import unicode_typedef as typedef
+ _immutable_ = True
def __init__(w_self, unistr):
assert isinstance(unistr, unicode)
More information about the Pypy-commit
mailing list