ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> numpy-discussion
numpy-discussion
Re: [Numpy-discussion] can't resize ndarray subclass
by Travis Oliphant other posts by this author
Feb 28 2006 12:07PM messages near this date
[Numpy-discussion] can't resize ndarray subclass | Re: [Numpy-discussion] can't resize ndarray subclass
Zachary Pincus wrote:

>  Thus far, it seems like the way to get instances of ndarray  
>  subclasses is to use the 'view(subclass)' method on a proper ndarray,  
>  either in the subclass __new__, or after constructing the array.
> 
>  However, subclass instances so created *do not own their own data*,  
>  as far as I can tell. They are just "views" on an other array's data.  
>  This means that these objects can't be resized, or have other  
>  operations performed on them which requires 'owning' the data buffer.

Yes, that is true.   To own your own data your subclass would have to 
create it's own memory using

ndarray.__new__(mysubclass, shape, dtype)

Or make a copy as you suggested later.

-Travis



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Thread:
Zachary Pincus
Travis Oliphant
Zachary Pincus
Travis Oliphant
Tim Hochberg
Travis Oliphant
Zachary Pincus
Travis Oliphant
Travis Oliphant

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved