[pypy-svn] r7240 - pypy/trunk/src/pypy/translator

mwh at codespeak.net mwh at codespeak.net
Mon Nov 15 15:45:15 CET 2004


Author: mwh
Date: Mon Nov 15 15:45:15 2004
New Revision: 7240

Modified:
   pypy/trunk/src/pypy/translator/genc.py
Log:
better treatment (i.e. rejection :) of special names.

some kind of __init__ support, not tested yet


Modified: pypy/trunk/src/pypy/translator/genc.py
==============================================================================
--- pypy/trunk/src/pypy/translator/genc.py	(original)
+++ pypy/trunk/src/pypy/translator/genc.py	Mon Nov 15 15:45:15 2004
@@ -125,8 +125,11 @@
         content.sort()
         lines = []
         for key, value in content:
-            if key.startswith('__'):
-                continue
+            if key.startswith('__') and key != '__init__':
+                if key in ['__module__', '__doc__', '__dict__',
+                           '__weakref__']:
+                    continue
+                raise Exception, "unexpected name %r in class %s"%(key, cls)
             lines.append('INITCHK(SETUP_CLASS_ATTR(%s, "%s", %s))' % (
                 name, key, self.nameof(value)))
         self.globaldecl.append('static PyObject* %s;' % name)



More information about the Pypy-commit mailing list