[pypy-commit] pypy numpy-record-dtypes: yet another approach

fijal noreply at buildbot.pypy.org
Tue Feb 7 12:01:51 CET 2012


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

Log:	yet another approach

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
@@ -542,8 +542,11 @@
 def _setup():
     for name, tp in globals().items():
         if isinstance(tp, type):
-            class NonNative(NonNativePrimitive, tp):
+            class NonNative(tp):
                 pass
+            for item, v in NonNativePrimitive.__dict__.items():
+                if not item.startswith('__'):
+                    setattr(NonNative, item, v)
             NonNative.__name__ = 'NonNative' + name
             globals()[NonNative.__name__] = NonNative
 


More information about the pypy-commit mailing list