[pypy-svn] r17441 - pypy/dist/pypy/module/thread

arigo at codespeak.net arigo at codespeak.net
Sat Sep 10 14:41:43 CEST 2005


Author: arigo
Date: Sat Sep 10 14:41:42 2005
New Revision: 17441

Modified:
   pypy/dist/pypy/module/thread/threadlocals.py
Log:
We should be able to use int-keyed dicts freely now.


Modified: pypy/dist/pypy/module/thread/threadlocals.py
==============================================================================
--- pypy/dist/pypy/module/thread/threadlocals.py	(original)
+++ pypy/dist/pypy/module/thread/threadlocals.py	Sat Sep 10 14:41:42 2005
@@ -11,16 +11,15 @@
     os_thread.bootstrap()."""
 
     def __init__(self):
-        # XXX use string-keyed dicts only for now
-        self._valuedict = {}   # {str(thread_ident): ExecutionContext()}
+        self._valuedict = {}   # {thread_ident: ExecutionContext()}
 
     def getvalue(self):
         ident = thread.get_ident()
-        return self._valuedict.get(str(ident), None)
+        return self._valuedict.get(ident, None)
 
     def setvalue(self, value):
         ident = thread.get_ident()
-        self._valuedict[str(ident)] = value
+        self._valuedict[ident] = value
 
     def enter_thread(self, space):
         "Notification that the current thread is just starting."
@@ -37,7 +36,7 @@
         finally:
             ident = thread.get_ident()
             try:
-                del self._valuedict[str(ident)]
+                del self._valuedict[ident]
             except KeyError:
                 pass
 



More information about the Pypy-commit mailing list