[Numpy-svn] r3737 - trunk/numpy/core
numpy-svn at scipy.org
numpy-svn at scipy.org
Wed May 9 12:27:09 EDT 2007
Author: oliphant
Date: 2007-05-09 11:27:06 -0500 (Wed, 09 May 2007)
New Revision: 3737
Modified:
trunk/numpy/core/records.py
Log:
Change recarray attribute getting to return a view using the class instead of pure recarray when fields are present.
Modified: trunk/numpy/core/records.py
===================================================================
--- trunk/numpy/core/records.py 2007-05-04 21:17:20 UTC (rev 3736)
+++ trunk/numpy/core/records.py 2007-05-09 16:27:06 UTC (rev 3737)
@@ -136,7 +136,7 @@
# if it's a string return 'SU' return a chararray
# otherwise return a normal array
if obj.dtype.fields:
- return obj.view(recarray)
+ return obj.view(obj.__class__)
if obj.dtype.char in 'SU':
return obj.view(chararray)
return obj
More information about the Numpy-svn
mailing list