By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

why not arrays?

P: n/a
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

Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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

"Rahul" <co********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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

Jul 18 '05 #2

P: n/a
On Thu, Dec 16, 2004 at 05:51:18AM -0800, Rahul wrote:
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)

iD8DBQFBwZjEdIO4ozGCH14RApZ6AKCPVPvwGz0k6pidgRzBUo ayJv4tiwCghuoC
M30JqyqzGgW3BHLr5lVW5c0=
=elGg
-----END PGP SIGNATURE-----

Jul 18 '05 #3

P: n/a
Rahul wrote:
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
Sc***********@Acm.Org
Jul 18 '05 #4

P: n/a
Rahul wrote:
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.

--
Nick Coghlan | nc******@email.com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
Jul 18 '05 #5

P: n/a

"Scott David Daniels" <Sc***********@Acm.Org> wrote in message
news:41********@nntp0.pdx.net...
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

Jul 18 '05 #6

P: n/a

"Nick Coghlan" <nc******@iinet.net.au> wrote in message
news:41**************@iinet.net.au...
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

Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.