Author: Matti Picus <[email protected]>
Branch:
Changeset: r60963:28bd3105555c
Date: 2013-02-08 11:22 +0200
http://bitbucket.org/pypy/pypy/changeset/28bd3105555c/
Log: move astype to BaseConcreteArray
diff --git a/pypy/module/micronumpy/arrayimpl/concrete.py
b/pypy/module/micronumpy/arrayimpl/concrete.py
--- a/pypy/module/micronumpy/arrayimpl/concrete.py
+++ b/pypy/module/micronumpy/arrayimpl/concrete.py
@@ -275,6 +275,11 @@
def get_buffer(self, space):
return ArrayBuffer(self)
+ def astype(self, space, dtype):
+ new_arr = W_NDimArray.from_shape(self.get_shape(), dtype)
+ loop.copy_from_to(self, new_arr.implementation, dtype)
+ return new_arr
+
class ConcreteArrayNotOwning(BaseConcreteArray):
def __init__(self, shape, dtype, order, strides, backstrides, storage):
@@ -309,11 +314,6 @@
def argsort(self, space, w_axis):
return argsort_array(self, space, w_axis)
- def astype(self, space, dtype):
- new_arr = W_NDimArray.from_shape(self.get_shape(), dtype)
- loop.copy_from_to(self, new_arr.implementation, dtype)
- return new_arr
-
def base(self):
return None
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit