[pypy-commit] pypy numpy-record-dtypes: more hacking

fijal noreply at buildbot.pypy.org
Tue Feb 7 12:04:41 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-record-dtypes
Changeset: r52164:74884273c3e5
Date: 2012-02-07 13:04 +0200
http://bitbucket.org/pypy/pypy/changeset/74884273c3e5/

Log:	more hacking

diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -213,8 +213,6 @@
         return min(v1, v2)
 
 class NonNativePrimitive(object):
-    _mixin_ = True
-    
     def _read(self, storage, width, i, offset):
         return byteswap(Primitive._read(self, storage, width, i, offset))
 
@@ -540,13 +538,15 @@
 del tp
 
 def _setup():
+    from pypy.tool.sourcetools import func_with_new_name
+    
     for name, tp in globals().items():
         if isinstance(tp, type):
             class NonNative(tp):
                 pass
             for item, v in NonNativePrimitive.__dict__.items():
                 if not item.startswith('__'):
-                    setattr(NonNative, item, v)
+                    setattr(NonNative, item, func_with_new_name(v, item))
             NonNative.__name__ = 'NonNative' + name
             globals()[NonNative.__name__] = NonNative
 


More information about the pypy-commit mailing list