[pypy-svn] r34680 - in pypy/dist/pypy/module: __builtin__ __builtin__/test pypymagic pypymagic/test

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Nov 16 17:07:31 CET 2006


Author: cfbolz
Date: Thu Nov 16 17:07:30 2006
New Revision: 34680

Added:
   pypy/dist/pypy/module/pypymagic/test/test_special.py
      - copied, changed from r34533, pypy/dist/pypy/module/__builtin__/test/test_special.py
Removed:
   pypy/dist/pypy/module/__builtin__/test/test_special.py
Modified:
   pypy/dist/pypy/module/__builtin__/__init__.py
   pypy/dist/pypy/module/__builtin__/special.py
   pypy/dist/pypy/module/pypymagic/__init__.py
   pypy/dist/pypy/module/pypymagic/interp_magic.py
Log:
move two somewhat obscure builtins to pypymagic. remove the double entry for
hash.


Modified: pypy/dist/pypy/module/__builtin__/__init__.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/__init__.py	(original)
+++ pypy/dist/pypy/module/__builtin__/__init__.py	Thu Nov 16 17:07:30 2006
@@ -80,8 +80,6 @@
         '_instance'     : 'space.w_instance',
         # default __metaclass__
         '__metaclass__' : '(space.w_type)',
-        '_isfake'       : 'special._isfake',
-        '_pdb'          : 'special._pdb',
 
         # interp-level function definitions
         'abs'           : 'operation.abs',
@@ -103,7 +101,6 @@
         'setattr'       : 'operation.setattr',
         'delattr'       : 'operation.delattr',
         'iter'          : 'operation.iter',
-        'hash'          : 'operation.hash',
         'id'            : 'operation.id',
         '_seqiter'      : 'operation._seqiter',
         'intern'        : 'operation.intern',

Modified: pypy/dist/pypy/module/__builtin__/special.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/special.py	(original)
+++ pypy/dist/pypy/module/__builtin__/special.py	Thu Nov 16 17:07:30 2006
@@ -2,11 +2,6 @@
 from pypy.interpreter.error import OperationError
 from pypy.rlib import rarithmetic
 
-def _isfake(space, w_obj): 
-    return space.wrap(bool(w_obj.typedef.fakedcpytype))
-    #return space.wrap(bool(getattr(w_obj.typedef, 'fakedcpytype', None)))
-
-
 def _formatd(space, alt, prec, kind, x):
     formatd_max_length = rarithmetic.formatd_max_length
     if ((kind == 'g' and formatd_max_length <= 10+prec) or
@@ -23,14 +18,4 @@
     return space.wrap(rarithmetic.formatd(fmt, x))
 _formatd.unwrap_spec = [gateway.ObjSpace, int, int, str, float]
 
-def _pdb(space):
-    """Run an interp-level pdb.
-    This is not available in translated versions of PyPy."""
-    from pypy.rlib.objectmodel import we_are_translated
-    if we_are_translated():
-        raise OperationError(space.w_NotImplementedError,
-                             space.wrap("Cannot use interp-level pdb in translated pypy"))
-    else:
-        import pdb
-        pdb.set_trace()
 

Modified: pypy/dist/pypy/module/pypymagic/__init__.py
==============================================================================
--- pypy/dist/pypy/module/pypymagic/__init__.py	(original)
+++ pypy/dist/pypy/module/pypymagic/__init__.py	Thu Nov 16 17:07:30 2006
@@ -8,4 +8,6 @@
 
     interpleveldefs = {
         'pypy_repr'             : 'interp_magic.pypy_repr',
+        'isfake'                : 'interp_magic.isfake',
+        'interp_pdb'            : 'interp_magic.interp_pdb',
     }

Modified: pypy/dist/pypy/module/pypymagic/interp_magic.py
==============================================================================
--- pypy/dist/pypy/module/pypymagic/interp_magic.py	(original)
+++ pypy/dist/pypy/module/pypymagic/interp_magic.py	Thu Nov 16 17:07:30 2006
@@ -1,3 +1,21 @@
+from pypy.interpreter.error import OperationError
+from pypy.rlib.objectmodel import we_are_translated
 
 def pypy_repr(space, w_object):
     return space.wrap('%r' % (w_object,))
+
+def isfake(space, w_obj):
+    if we_are_translated():
+        return space.w_False
+    return space.wrap(bool(w_obj.typedef.fakedcpytype))
+    #return space.wrap(bool(getattr(w_obj.typedef, 'fakedcpytype', None)))
+
+def interp_pdb(space):
+    """Run an interp-level pdb.
+    This is not available in translated versions of PyPy."""
+    if we_are_translated():
+        raise OperationError(space.w_NotImplementedError,
+                             space.wrap("Cannot use interp-level pdb in translated pypy"))
+    else:
+        import pdb
+        pdb.set_trace()



More information about the Pypy-commit mailing list