Author: Maciej Fijalkowski <[email protected]>
Branch: numpy-reintroduce-zjit-tests
Changeset: r58096:d544c05cb373
Date: 2012-10-13 11:40 +0200
http://bitbucket.org/pypy/pypy/changeset/d544c05cb373/

Log:    (arigo, fijal) support static methods for mixins

diff --git a/pypy/annotation/description.py b/pypy/annotation/description.py
--- a/pypy/annotation/description.py
+++ b/pypy/annotation/description.py
@@ -3,7 +3,7 @@
 from pypy.interpreter.pycode import cpython_code_signature
 from pypy.interpreter.argument import rawshape
 from pypy.interpreter.argument import ArgErr
-from pypy.tool.sourcetools import valid_identifier
+from pypy.tool.sourcetools import valid_identifier, func_with_new_name
 from pypy.tool.pairtype import extendabletype
 
 class CallFamily(object):
@@ -486,6 +486,10 @@
             # is of type FunctionType.  But bookkeeper.immutablevalue()
             # will do the right thing in s_get_value().
 
+        if isinstance(value, staticmethod) and mixin:
+            value = staticmethod(func_with_new_name(value.__func__,
+                                                    value.__func__.__name__))
+
         if type(value) in MemberDescriptorTypes:
             # skip __slots__, showing up in the class as 'member' objects
             return
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to