[pypy-commit] pypy space-newtext: This class only ever contains an empty list

arigo pypy.commits at gmail.com
Tue Feb 14 12:09:16 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: space-newtext
Changeset: r90120:1e5e474fe89b
Date: 2017-02-14 17:54 +0100
http://bitbucket.org/pypy/pypy/changeset/1e5e474fe89b/

Log:	This class only ever contains an empty list

diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py
--- a/pypy/interpreter/astcompiler/ast.py
+++ b/pypy/interpreter/astcompiler/ast.py
@@ -48,10 +48,10 @@
     "Hack around the fact we can't store tuples on a TypeDef."
 
     def __init__(self, fields):
-        self.fields = fields
+        assert fields == []
 
     def spacebind(self, space):
-        return space.newtuple([space.newtext(field) for field in self.fields])
+        return space.newtuple([])
 
 
 class W_AST(W_Root):
diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py b/pypy/interpreter/astcompiler/tools/asdl_py.py
--- a/pypy/interpreter/astcompiler/tools/asdl_py.py
+++ b/pypy/interpreter/astcompiler/tools/asdl_py.py
@@ -443,10 +443,10 @@
     "Hack around the fact we can't store tuples on a TypeDef."
 
     def __init__(self, fields):
-        self.fields = fields
+        assert fields == []
 
     def spacebind(self, space):
-        return space.newtuple([space.newtext(field) for field in self.fields])
+        return space.newtuple([])
 
 
 class W_AST(W_Root):


More information about the pypy-commit mailing list