[pypy-commit] pypy default: Preset correct attributes on scalars, so that a call to calc_strides isn't emitted

alex_gaynor noreply at buildbot.pypy.org
Fri Dec 2 22:31:34 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r50079:87235ee9b8ab
Date: 2011-12-02 16:31 -0500
http://bitbucket.org/pypy/pypy/changeset/87235ee9b8ab/

Log:	Preset correct attributes on scalars, so that a call to calc_strides
	isn't emitted

diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -798,6 +798,7 @@
     _attrs_ = ["dtype", "value", "shape"]
 
     def __init__(self, dtype, value):
+        self.shape = self.strides = []
         BaseArray.__init__(self, [], 'C')
         self.dtype = dtype
         self.value = value


More information about the pypy-commit mailing list