Author: Brian Kearns <[email protected]>
Branch:
Changeset: r71006:f32e46e00e4f
Date: 2014-04-26 11:04 -0400
http://bitbucket.org/pypy/pypy/changeset/f32e46e00e4f/
Log: mark XRangeStepOneIterator.stop as an immutable field
diff --git a/pypy/module/__builtin__/functional.py
b/pypy/module/__builtin__/functional.py
--- a/pypy/module/__builtin__/functional.py
+++ b/pypy/module/__builtin__/functional.py
@@ -436,6 +436,7 @@
)
W_XRange.typedef.acceptable_as_base_class = False
+
class W_XRangeIterator(W_Root):
def __init__(self, space, current, remaining, step):
self.space = space
@@ -483,7 +484,10 @@
)
W_XRangeIterator.typedef.acceptable_as_base_class = False
+
class W_XRangeStepOneIterator(W_XRangeIterator):
+ _immutable_fields_ = ['stop']
+
def __init__(self, space, start, stop):
self.space = space
self.current = start
diff --git a/pypy/module/pypyjit/test_pypy_c/test_weakref.py
b/pypy/module/pypyjit/test_pypy_c/test_weakref.py
--- a/pypy/module/pypyjit/test_pypy_c/test_weakref.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_weakref.py
@@ -20,8 +20,7 @@
loop, = log.loops_by_filename(self.filepath)
assert loop.match("""
i58 = getfield_gc(p18, descr=<FieldS
pypy.module.__builtin__.functional.W_XRangeIterator.inst_current .>)
- i59 = getfield_gc(p18, descr=<FieldS
pypy.module.__builtin__.functional.W_XRangeStepOneIterator.inst_stop \d+>)
- i60 = int_lt(i58, i59)
+ i60 = int_lt(i58, i31)
guard_true(i60, descr=...)
i61 = int_add(i58, 1)
p62 = getfield_gc(ConstPtr(ptr37), descr=<FieldP
pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_strategy \d+>)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit