[Numpy-tickets] [NumPy] #955: [debian #505999] memory leak in exponentiation

NumPy numpy-tickets@scipy....
Sun Feb 8 03:42:46 CST 2009


#955: [debian #505999] memory leak in exponentiation
-------------------------+--------------------------------------------------
 Reporter:  stefan       |        Owner:  somebody
     Type:  defect       |       Status:  new     
 Priority:  normal       |    Milestone:  1.1.2   
Component:  numpy.core   |      Version:  none    
 Severity:  normal       |   Resolution:          
 Keywords:  memory leak  |  
-------------------------+--------------------------------------------------
Comment (by stefan):

 I am not intricately familiar with the protocol Python uses to determine
 which power function to call, but my suspicion is this:

 We have control in the following situations:

 {{{
 anything ** array
 anything ** array_scalar (not derived from Python int)
 array_scalar (not derived from Python int) ** anything
 array ** anything
 }}}

 but not in the case of

 {{{
 float ** int or int derivative
 }}}

 So unless we can either change the way the platform integer array scalar
 derives from Python int, Python is always going to hi-jack this operation.

 A workaround would be to put yourself in an

 {{{
 array_scalar ** anything
 }}}

 situation, i.e.

 {{{
 np.float64(0.0)**np.int32(-3.5)
 }}}

 I'll post this question to the list to see whether anybody has a more
 satisfying answer.

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/955#comment:6>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list