[Numpy-discussion] Bug in resize method?

Gael Varoquaux gael.varoquaux at normalesup.org
Wed Aug 29 14:37:57 EDT 2007


On Wed, Aug 29, 2007 at 11:31:12AM -0700, Timothy Hochberg wrote:
>    FWIW, I don't use either the resize function or the resize method, but if
>    I was going to get rid of one, personally I'd axe the function. Resizing
>    is a confusing operation and the function doesn't have the possibility of
>    better efficiency to justify it's existence.

My understand of OOP is that I expect a method to modify an object in
place, and a function to return a new object (or a view).

Now this is not true with Python, as some objects are imutable and this
is not possible, but at least there seems to be some logic that a method
returns a new object only if the object is imutable.

With numpy I often fail to see the logic, but I'd love to see one.

Gaël



More information about the NumPy-Discussion mailing list