[pypy-svn] r9797 - pypy/dist/pypy/translator

arigo at codespeak.net arigo at codespeak.net
Tue Mar 15 16:14:25 CET 2005


Author: arigo
Date: Tue Mar 15 16:14:25 2005
New Revision: 9797

Modified:
   pypy/dist/pypy/translator/genpyrex.py
Log:
'is_perfect_number__-4854089c' is not a valid identifier...  we have to 
use uid() instead of id().



Modified: pypy/dist/pypy/translator/genpyrex.py
==============================================================================
--- pypy/dist/pypy/translator/genpyrex.py	(original)
+++ pypy/dist/pypy/translator/genpyrex.py	Tue Mar 15 16:14:25 2005
@@ -9,6 +9,7 @@
 from pypy.translator.annrpython import RPythonAnnotator
 from pypy.annotation.model import SomePBC
 from pypy.annotation.classdef import isclassdef
+from pypy.tool.uid import uid
 import inspect
 
 class Op:
@@ -289,7 +290,7 @@
         name = cls.__name__
         if issubclass(cls,Exception):
             return name
-        return '%s__%x' % (name, id(cls))#self._hackname(cls)
+        return '%s__%x' % (name, uid(cls))#self._hackname(cls)
     
     def getfunctionname(self,func):
         # NB. the purpose of the cache is not performance, but to ensure that
@@ -300,7 +301,7 @@
             return self.namecache[func]
         except KeyError:
             assert inspect.isfunction(func) or inspect.ismethod(func)
-            name = '%s__%x' % (func.__name__, id(func))#self._hackname(func)
+            name = '%s__%x' % (func.__name__, uid(func))#self._hackname(func)
             self.namecache[func] = name
             return name
     



More information about the Pypy-commit mailing list