[pypy-commit] pypy numpy-record-dtypes: export longlong and ulonglong
fijal
noreply at buildbot.pypy.org
Mon Feb 6 18:50:49 CET 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-record-dtypes
Changeset: r52143:b91d1bdc5810
Date: 2012-02-06 19:50 +0200
http://bitbucket.org/pypy/pypy/changeset/b91d1bdc5810/
Log: export longlong and ulonglong
diff --git a/pypy/module/micronumpy/__init__.py b/pypy/module/micronumpy/__init__.py
--- a/pypy/module/micronumpy/__init__.py
+++ b/pypy/module/micronumpy/__init__.py
@@ -54,6 +54,8 @@
'uint32': 'interp_boxes.W_UInt32Box',
'int64': 'interp_boxes.W_Int64Box',
'uint64': 'interp_boxes.W_UInt64Box',
+ 'longlong': 'interp_boxes.W_LongLongBox',
+ 'ulonglong': 'interp_boxes.W_ULongLongBox',
'int_': 'interp_boxes.W_LongBox',
'inexact': 'interp_boxes.W_InexactBox',
'floating': 'interp_boxes.W_FloatingBox',
diff --git a/pypy/module/micronumpy/interp_boxes.py b/pypy/module/micronumpy/interp_boxes.py
--- a/pypy/module/micronumpy/interp_boxes.py
+++ b/pypy/module/micronumpy/interp_boxes.py
@@ -141,9 +141,15 @@
class W_Int64Box(W_SignedIntegerBox, PrimitiveBox):
descr__new__, get_dtype = new_dtype_getter("int64")
+class W_LongLongBox(W_SignedIntegerBox, PrimitiveBox):
+ descr__new__, get_dtype = new_dtype_getter('longlong')
+
class W_UInt64Box(W_UnsignedIntegerBox, PrimitiveBox):
descr__new__, get_dtype = new_dtype_getter("uint64")
+class W_ULongLongBox(W_SignedIntegerBox, PrimitiveBox):
+ descr__new__, get_dtype = new_dtype_getter('ulonglong')
+
class W_InexactBox(W_NumberBox):
_attrs_ = ()
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
@@ -214,7 +214,6 @@
name="int64",
char="q",
w_box_type=space.gettypefor(interp_boxes.W_Int64Box),
- alternate_constructors=[space.w_long],
)
self.w_uint64dtype = W_Dtype(
types.UInt64(),
@@ -242,12 +241,30 @@
alternate_constructors=[space.w_float],
aliases=["float"],
)
+ self.w_longlongdtype = W_Dtype(
+ types.Int64(),
+ num=9,
+ kind=SIGNEDLTR,
+ name='int64',
+ char='q',
+ w_box_type = space.gettypefor(interp_boxes.W_LongLongBox),
+ alternate_constructors=[space.w_long],
+ )
+ self.w_ulonglongdtype = W_Dtype(
+ types.UInt64(),
+ num=10,
+ kind=UNSIGNEDLTR,
+ name='uint64',
+ char='Q',
+ w_box_type = space.gettypefor(interp_boxes.W_ULongLongBox),
+ )
self.builtin_dtypes = [
self.w_booldtype, self.w_int8dtype, self.w_uint8dtype,
self.w_int16dtype, self.w_uint16dtype, self.w_int32dtype,
self.w_uint32dtype, self.w_longdtype, self.w_ulongdtype,
- self.w_int64dtype, self.w_uint64dtype, self.w_float32dtype,
+ self.w_longlongdtype, self.w_ulonglongdtype,
+ self.w_float32dtype,
self.w_float64dtype
]
self.dtypes_by_num_bytes = sorted(
More information about the pypy-commit
mailing list