[NumPy-Tickets] [NumPy] #1933: format strings: native size used instead of standard size

NumPy Trac numpy-tickets@scipy....
Sat Aug 13 13:30:29 CDT 2011


#1933: format strings: native size used instead of standard size
----------------------+-----------------------------------------------------
  Reporter:  skrah    |       Owner:  somebody   
      Type:  defect   |      Status:  closed     
  Priority:  normal   |   Milestone:  Unscheduled
 Component:  Other    |     Version:  1.6.0      
Resolution:  invalid  |    Keywords:             
----------------------+-----------------------------------------------------
Changes (by charris):

  * status:  new => closed
  * resolution:  => invalid


Old description:

> I think this array should fit into a buffer of size 4,
> even on a 64-bit platform:
>
> {{{
> >>> import struct
> >>> struct.calcsize('=l')
> 4
> >>> ndarray(buffer=bytearray(4), shape=[1], dtype="=l")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: buffer is too small for requested array
>

> >>> ndarray(buffer=bytearray(8), shape=[1], dtype="=l")
> array([0])
> }}}

New description:

 I think this array should fit into a buffer of size 4,
 even on a 64-bit platform:

 {{{
 >>> import struct
 >>> struct.calcsize('=l')
 4
 >>> ndarray(buffer=bytearray(4), shape=[1], dtype="=l")
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: buffer is too small for requested array


 >>> ndarray(buffer=bytearray(8), shape=[1], dtype="=l")
 array([0])
 }}}

--

Comment:

 It should probably be the 'compiler' native :)

 Anyway, closing as requested.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1933#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list