why not arrays?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rahul

    #1

    why not arrays?

    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

  • Thomas Bartkus

    #2
    Re: why not arrays?

    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" <codedivine@gma il.com> wrote in message
    news:1103205078 .423240.297790@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    > 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
    >[/color]


    Comment

    • Gerhard Haering

      #3
      Re: why not arrays?

      On Thu, Dec 16, 2004 at 05:51:18AM -0800, Rahul wrote:[color=blue]
      > 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?[/color]

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

      -- Gerhard

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

      iD8DBQFBwZjEdIO 4ozGCH14RApZ6AK CPVPvwGz0k6pidg RzBUoayJv4tiwCg huoC
      M30JqyqzGgW3BHL r5lVW5c0=
      =elGg
      -----END PGP SIGNATURE-----

      Comment

      • Scott David Daniels

        #4
        Re: why not arrays?

        Rahul wrote:[color=blue]
        > 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
        >[/color]
        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
        Scott.Daniels@A cm.Org

        Comment

        • Nick Coghlan

          #5
          Re: why not arrays?

          Rahul wrote:[color=blue]
          > 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
          >[/color]

          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 | ncoghlan@email. com | Brisbane, Australia
          ---------------------------------------------------------------

          Comment

          • Terry Reedy

            #6
            Re: why not arrays?


            "Scott David Daniels" <Scott.Daniels@ Acm.Org> wrote in message
            news:41c1a169$1 @nntp0.pdx.net. ..[color=blue]
            > We know of three implementations of arrays now: the "array" module,[/color]

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

            Numpy is the original multidimensiona l 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



            Comment

            • Terry Reedy

              #7
              Re: why not arrays?


              "Nick Coghlan" <ncoghlan@iinet .net.au> wrote in message
              news:41C1A246.3 070401@iinet.ne t.au...[color=blue]
              > 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)[/color]

              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



              Comment

              Working...