[pypy-commit] pypy generator-in-rpython: Mark the test classes as _immutable_=True, to showcase what a real

arigo noreply at buildbot.pypy.org
Fri Dec 23 14:33:15 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: generator-in-rpython
Changeset: r50830:c73c899880d8
Date: 2011-12-23 12:26 +0100
http://bitbucket.org/pypy/pypy/changeset/c73c899880d8/

Log:	Mark the test classes as _immutable_=True, to showcase what a real
	implementation would look like.

diff --git a/pypy/rpython/test/test_generator.py b/pypy/rpython/test/test_generator.py
--- a/pypy/rpython/test/test_generator.py
+++ b/pypy/rpython/test/test_generator.py
@@ -21,9 +21,11 @@
         # merging two different generators is not supported
         # right now, but we can use workarounds like here
         class MyGen:
+            _immutable_ = True
             def next(self):
                 raise NotImplementedError
         class MyG1(MyGen):
+            _immutable_ = True
             def __init__(self, a):
                 self._gen = self.g1(a)
             def next(self):
@@ -33,6 +35,7 @@
                 yield a + 1
                 yield a + 2
         class MyG2(MyGen):
+            _immutable_ = True
             def __init__(self):
                 self._gen = self.g2()
             def next(self):


More information about the pypy-commit mailing list