why not arrays?

R

Rahul

Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?
rahul
 
T

Thomas Bartkus

Because the "list" object covers all the functionality contained in the
traditional "array" structure. If it pleases you , you can ignore the
additional conveniences the list object offers and just treat it like an
ordinary array.

Unless, of course, what you are seeking are the joys associated with memory
allocation/deallocation :)
Thomas Bartkus
 
G

Gerhard Haering

Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?

Arrays are included in a module in the standard module called 'array'.

-- Gerhard

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBwZjEdIO4ozGCH14RApZ6AKCPVPvwGz0k6pidgRzBUoayJv4tiwCghuoC
M30JqyqzGgW3BHLr5lVW5c0=
=elGg
-----END PGP SIGNATURE-----
 
N

Nick Coghlan

Rahul said:
Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?
rahul

As Gerhard mentioned, the standard library module 'array' can be used for
data-type specific one-dimensional arrays.

For more complex (i.e. multi-dimensional) arrays - the general answer is "get
numpy". I'm not aware of the actual reasons why numpy is not included in the
standard library, but some possible reasons would be:

- size (increase the base Python download too much)
- portability (less portable than the core interpreter)
- stability (the numpy folks aren't yet prepared to commit to the backwards
compatibility issues associated with being part of the standard library)
- logistics (merging numpy into Python is likely to be a pain)

Cheers,
Nick.
 
S

Scott David Daniels

Rahul said:
Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?
rahul
We know of three implementations of arrays now: the "array" module,
the "numpy" implementation, and the "numarray" implementation. Clearly
there are some trade offs here with no clear winner. Until there is a
clear favorite, it would be a bad idea to choose a winner.

--Scott David Daniels
(e-mail address removed)
 
T

Terry Reedy

Scott David Daniels said:
We know of three implementations of arrays now: the "array" module,

This module for mutable linear homogeneous arrays is already included in
Python since long ago. It does not compete with the next two.
the "numpy" implementation, and the "numarray" implementation.

Numpy is the original multidimensional array numerical computation package
from about a decade ago. As far as I know, it is no longer being
supported/upgraded. However, it is still used be other packages that
people use.

Numarray is a newer package that I believe is intended to replace numpy and
which has only recently reached perhaps the same level of stability.

(Updates welcome)

Terry J. Reedy
 
T

Terry Reedy

Nick Coghlan said:
For more complex (i.e. multi-dimensional) arrays - the general answer is
"get numpy". I'm not aware of the actual reasons why numpy is not
included in the standard library, but some possible reasons would be:

- size (increase the base Python download too much)
- portability (less portable than the core interpreter)
- stability (the numpy folks aren't yet prepared to commit to the
backwards compatibility issues associated with being part of the standard
library)
- logistics (merging numpy into Python is likely to be a pain)

The base issue for all third-party package is *ownership* and attendent
issues of who controls style, contents, and timing of changes.
Transferring code or a version thereof from original authors to the PSF has
pluses and minuses for both parties.

Terry J. Reedy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,214
Messages
2,571,112
Members
47,704
Latest member
DavidSuita

Latest Threads

Top