Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109641

Possible PEP - two dimensional arrays?

From Harrison Chudleigh <harrison.chudleigh1@education.nsw.gov.au>
Newsgroups comp.lang.python
Subject Possible PEP - two dimensional arrays?
Date 2016-06-08 10:17 +1000
Message-ID <mailman.66.1465345153.2306.python-list@python.org> (permalink)
References <CACMigy1yXKuX0HCyAcE7MrWdC5DJhOMVtnxbcLVkU_Qw4MZsYg@mail.gmail.com>

Show all headers | View raw


I was programming a computer game and found that while 1D arrays can be
created using the module array, there is no module for two-dimensional
arrays, unlike languages like C. Currently, the closest thing Python has to
a 2D array is a dictionary containing lists.

I propose that a module , 2DArray, be added to the standard library. This
module will include:
Assignment and retrieval on items on a two-dimensional, finite rectangular
grid. Types are integer, float, character and string.
Resizing the grid - parameters are old size and new size. Any new elements
are initialized with a value of 0 for int, 0.0 for float and ' ' for string
and character arrays.
Removing elements. The parameter is the location. After removal, the value
returned is 0 for int, 0.0 for float and ' ' for string and character
arrays.
A function, pop(), which removes elements from the grid and then returns
them.

Is this idea PEPable?
*******************************************************************************
This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Possible PEP - two dimensional arrays? Harrison Chudleigh <harrison.chudleigh1@education.nsw.gov.au> - 2016-06-08 10:17 +1000
  Re: Possible PEP - two dimensional arrays? Paul Rubin <no.email@nospam.invalid> - 2016-06-07 17:28 -0700
  Re: Possible PEP - two dimensional arrays? Ned Batchelder <ned@nedbatchelder.com> - 2016-06-07 17:38 -0700
  Re: Possible PEP - two dimensional arrays? Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-06-08 00:45 +0000

csiph-web