[pypy-commit] pypy default: add warnings

cfbolz noreply at buildbot.pypy.org
Fri Jul 1 16:23:29 CEST 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: 
Changeset: r45233:cfb5827cec9c
Date: 2011-07-01 16:30 +0200
http://bitbucket.org/pypy/pypy/changeset/cfb5827cec9c/

Log:	add warnings

diff --git a/pypy/rlib/jit.py b/pypy/rlib/jit.py
--- a/pypy/rlib/jit.py
+++ b/pypy/rlib/jit.py
@@ -21,8 +21,10 @@
     func._elidable_function_ = True
     return func
 
-# keep "purefunction" for not breaking external projects, deprecated
-purefunction = elidable
+def purefunction(*args, **args):
+    import warnings
+    warnings.warn("purefunction is deprecated, use elidable instead", DeprecationWarning)
+    return elidable(*args, **args)
 
 def hint(x, **kwds):
     """ Hint for the JIT
@@ -88,8 +90,11 @@
         return result
     return decorator
 
-# keep "purefunction_promote" for not breaking external projects, deprecated
-purefunction_promote = elidable_promote
+def purefunction_promote(*args, **args):
+    import warnings
+    warnings.warn("purefunction_promote is deprecated, use elidable_promote instead", DeprecationWarning)
+    return elidable_promote(*args, **args)
+
 
 def oopspec(spec):
     def decorator(func):


More information about the pypy-commit mailing list