[pypy-commit] pypy numpy-dtype-alt: Order by num
alex_gaynor
noreply at buildbot.pypy.org
Mon Aug 8 00:31:18 CEST 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-dtype-alt
Changeset: r46354:e3e32939abf6
Date: 2011-08-07 15:12 -0700
http://bitbucket.org/pypy/pypy/changeset/e3e32939abf6/
Log: Order by num
diff --git a/pypy/module/micronumpy/interp_dtype.py b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -67,6 +67,16 @@
VOID_TP = make_array_ptr(lltype.Void)
+class W_BoolDtype(LowLevelDtype, W_Dtype):
+ num = 0
+ name = "bool"
+ aliases = ["?"]
+ applevel_types = ["bool"]
+ TP = make_array_ptr(lltype.Bool)
+
+ def unwrap(self, space, w_item):
+ return space.is_true(w_item)
+
class W_Int8Dtype(LowLevelDtype, W_Dtype):
num = 1
kind = SIGNEDLTR
@@ -79,11 +89,6 @@
aliases = ["i"]
TP = make_array_ptr(rffi.INT)
-class W_Int64Dtype(LowLevelDtype, W_Dtype):
- num = 9
- applevel_types = ["long"]
- TP = make_array_ptr(rffi.LONGLONG)
-
class W_LongDtype(LowLevelDtype, W_Dtype):
num = 7
kind = SIGNEDLTR
@@ -91,15 +96,10 @@
applevel_types = ["int"]
TP = make_array_ptr(rffi.LONG)
-class W_BoolDtype(LowLevelDtype, W_Dtype):
- num = 0
- name = "bool"
- aliases = ["?"]
- applevel_types = ["bool"]
- TP = make_array_ptr(lltype.Bool)
-
- def unwrap(self, space, w_item):
- return space.is_true(w_item)
+class W_Int64Dtype(LowLevelDtype, W_Dtype):
+ num = 9
+ applevel_types = ["long"]
+ TP = make_array_ptr(rffi.LONGLONG)
class W_Float64Dtype(LowLevelDtype, W_Dtype):
num = 12
@@ -111,7 +111,7 @@
ALL_DTYPES = [
- W_Int8Dtype, W_Int32Dtype, W_Int64Dtype, W_LongDtype, W_BoolDtype, W_Float64Dtype
+ W_BoolDtype, W_Int8Dtype, W_Int32Dtype, W_LongDtype, W_Int64Dtype, W_Float64Dtype
]
dtypes_by_alias = unrolling_iterable([
More information about the pypy-commit
mailing list