[pypy-commit] pypy numpy-record-dtypes: yet another approach (?)
fijal
noreply at buildbot.pypy.org
Tue Feb 7 13:13:58 CET 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-record-dtypes
Changeset: r52170:3ecf7e516fca
Date: 2012-02-07 13:47 +0200
http://bitbucket.org/pypy/pypy/changeset/3ecf7e516fca/
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
@@ -543,11 +543,13 @@
for name, tp in globals().items():
if isinstance(tp, type) and issubclass(tp, BaseType):
- class NonNative(NonNativePrimitive, tp):
+ class NonNative(BaseType):
pass
- #for item, v in NonNativePrimitive.__dict__.items():
- # if not item.startswith('__'):
- # setattr(NonNative, item, func_with_new_name(v, item))
+ NonNative.__bases__ = ((BaseType, NonNativePrimitive) +
+ tp.__bases__[1:])
+ for item, v in tp.__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