[pypy-commit] pypy default: Swithed to declraing the type of this function in a more idiomatic way.

alex_gaynor noreply at buildbot.pypy.org
Tue May 21 19:20:53 CEST 2013


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r64392:3788a2c016e0
Date: 2013-05-21 10:20 -0700
http://bitbucket.org/pypy/pypy/changeset/3788a2c016e0/

Log:	Swithed to declraing the type of this function in a more idiomatic
	way.

diff --git a/pypy/module/sys/vm.py b/pypy/module/sys/vm.py
--- a/pypy/module/sys/vm.py
+++ b/pypy/module/sys/vm.py
@@ -9,8 +9,8 @@
 
 # ____________________________________________________________
 
- at unwrap_spec(w_depth = WrappedDefault(0))
-def _getframe(space, w_depth):
+ at unwrap_spec(depth=int)
+def _getframe(space, depth=0):
     """Return a frame object from the call stack.  If optional integer depth is
 given, return the frame object that many calls below the top of the stack.
 If that is deeper than the call stack, ValueError is raised.  The default
@@ -18,7 +18,6 @@
 
 This function should be used for internal and specialized
 purposes only."""
-    depth = space.int_w(w_depth)
     if depth < 0:
         raise OperationError(space.w_ValueError,
                              space.wrap("frame index must not be negative"))


More information about the pypy-commit mailing list