[NumPy-Tickets] [NumPy] #2046: Deleting ndarray.real on an instance segfaults
NumPy Trac
numpy-tickets@scipy....
Sun Feb 12 18:40:42 CST 2012
#2046: Deleting ndarray.real on an instance segfaults
-------------------------+--------------------------------------------------
Reporter: alex_gaynor | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: Other | Version: devel
Keywords: |
-------------------------+--------------------------------------------------
Old description:
> Tested on the latest numpy master from github:
>
> {{{
> (e268cfc7-ff3f-4d97-a02c-27481c8a8186)alex@alex-gaynor-
> laptop:~/.virtualenvs/e268cfc7-ff3f-4d97-a02c-27481c8a8186$ python
> Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
> [GCC 4.6.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import numpy
> >>> del numpy.arange(5).real
> Segmentation fault
>
> }}}
>
> Note that if a getter isn't used we get
>
> {{{
> In [3]: del ones(3)
> File "<ipython-input-3-b548f34f731a>", line 1
> SyntaxError: can't delete function call (<ipython-input-3-b548f34f731a>,
> line 1)
>
> In [4]: del ones(3).view(double)
> File "<ipython-input-4-6d0dbe42344e>", line 1
> SyntaxError: can't delete function call (<ipython-input-4-6d0dbe42344e>,
> line 1)
>
> }}}
>
> which is a strange message. But it looks like this might almost be
> considered a Python bug where python del can't recognize getters/setters.
New description:
Tested on the latest numpy master from github:
{{{
(e268cfc7-ff3f-4d97-a02c-27481c8a8186)alex@alex-gaynor-
laptop:~/.virtualenvs/e268cfc7-ff3f-4d97-a02c-27481c8a8186$ python
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> del numpy.arange(5).real
Segmentation fault
}}}
--
Comment(by charris):
Oops, sorry I overwrote the original.
Note that if a getter isn't used we get
{{{
In [3]: del ones(3)
File "<ipython-input-3-b548f34f731a>", line 1
SyntaxError: can't delete function call (<ipython-input-3-b548f34f731a>,
line 1)
In [4]: del ones(3).view(double)
File "<ipython-input-4-6d0dbe42344e>", line 1
SyntaxError: can't delete function call (<ipython-input-4-6d0dbe42344e>,
line 1)
}}}
which is a strange message. But it looks like this might almost be
considered a Python bug where python del can't recognize getters/setters.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/2046#comment:3>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list