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


Groups > comp.lang.python > #109641

Possible PEP - two dimensional arrays?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Harrison Chudleigh <harrison.chudleigh1@education.nsw.gov.au>
Newsgroups comp.lang.python
Subject Possible PEP - two dimensional arrays?
Date Wed, 8 Jun 2016 10:17:24 +1000
Lines 22
Message-ID <mailman.66.1465345153.2306.python-list@python.org> (permalink)
References <CACMigy1yXKuX0HCyAcE7MrWdC5DJhOMVtnxbcLVkU_Qw4MZsYg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
X-Trace news.uni-berlin.de 2aaTdjEuw7ZZb2e6OTfG4wc9k6P5ERwgmb0JShPuVu2w==
Return-Path <harrison.chudleigh1@education.nsw.gov.au>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'elements.': 0.05; 'float': 0.05; 'removes': 0.05; 'assignment': 0.07; 'subject:PEP': 0.07; 'subject:two': 0.07; 'closest': 0.09; 'finite': 0.09; 'grid': 0.09; 'integer,': 0.09; 'python': 0.10; 'arrays,': 0.16; 'arrays.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'removal,': 0.16; 'resizing': 0.16; 'string': 0.17; 'retrieval': 0.18; 'arrays': 0.22; 'function,': 0.22; 'int,': 0.22; 'parameter': 0.22; 'programming': 0.22; 'elements': 0.23; 'unlike': 0.23; 'module': 0.25; 'parameters': 0.27; 'message-id:@mail.gmail.com': 0.27; 'idea': 0.28; 'currently,': 0.29; 'dictionary': 0.29; 'initialized': 0.29; 'array': 0.29; 'character': 0.29; 'addressee': 0.32; 'returned': 0.32; 'received:com.au': 0.33; 'languages': 0.34; 'received:google.com': 0.35; 'library.': 0.35; 'lists.': 0.35; 'propose': 0.35; 'there': 0.36; 'created': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'received:10': 0.37; 'received:209': 0.38; 'delete': 0.38; 'to:addr:python.org': 0.40; 'received:58': 0.61; 'information': 0.63; 'skip:* 70': 0.70; 'float,': 0.84; 'subject:Possible': 0.84
X-FW-MsgID <06/08/16-10:17:26-5042208@obesa1.dec.local>
IronPort-PHdr 9a23:m8APThfwcFfd8b+X0T5j4EQslGMj4u6mDksu8pMizoh2WeGdxc68Yx7h7PlgxGXEQZ/co6odzbGG4ua/Aydav96oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDjvcKJKF8WzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IAu3GePEgXKBYCzJjN2Eu+OXzpAXDSg3J4WETAUsMlR8dIwHf9hDhWZG5mSvnuu5w2SaadZn2RKouWC+l6eFgSALkjCoGOD5g2Gzbl8d5kKNcplSnvAM5zInKJoiIYqktNpjBdM8XEDISFv1aUDZMV9ux
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result A2DsBgAiY1dX/8fZVdFcHQGDIIFZqhoBkGWBeRKHPgc5EwEBAQEBAQEBZCeCMIIuEXUHNwIkEgEFAT0aiA2cB4FHAT+BMT4xizuRUhCPcII1glkFmEkCjiePII4gEh6BDx8BNIFCRRyBXSqKQQEBAQ
X-IPAS-Result A2DsBgAiY1dX/8fZVdFcHQGDIIFZqhoBkGWBeRKHPgc5EwEBAQEBAQEBZCeCMIIuEXUHNwIkEgEFAT0aiA2cB4FHAT+BMT4xizuRUhCPcII1glkFmEkCjiePII4gEh6BDx8BNIFCRRyBXSqKQQEBAQ
X-IronPort-AV E=Sophos;i="5.26,436,1459778400"; d="scan'208,217";a="5042208"
X-DET-UID obesa1.dec.local-4-5042208
X-Original-Envelope-From harrison.chudleigh1@education.nsw.gov.au
X-Original-Envelope-To python-list@python.org
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=DNO/bXtzTWKzC0WwPg78QCDm5Ke/RuweISasfXQJcJY=; b=SWEiwtFd0iuLjEFQd2sbGgglZvcnp2yqqRouSQafbr0tEnoxO+O8opFpXUX7EWBBse k1R3pixMjv/Tz+bBqVPLGj9dLVOvYkf7ER3aCrHDdXMsN8uphHX89+8D/SL8G+Rgs1PS qJze4KBBnTV+ywS3wDgo/zjgPTpaoHLuTa9yED+Q2o6h24gE5HDHEl6E5WoXpIkV56J2 wX6FczVYstduxd7nDaaHZVhbPg1qQzmgxz922vYoSf4GCrNpiTMlC6VRg+9quwqgRY5K A4KRllpATrrs8N2NttbUImobeUAyhnD4gtBpzH91IvBu9N3ETPpDtjFmL5ZH/7DqzNrf MbZg==
X-Gm-Message-State ALyK8tINadx1xcoY0ir4grTsXF1Pl1nKEX3/8eVC+LFq5Ex5GqXHupat2OKzLE+ijL3ID4JoHcrMjsFn5ksGM4X3uO0ljrXlw4EQHRDMiGjc5iUJSIol0FKt4E+PVZkTp22/LeEAbvwFQxAP/ci74fsy0eZJFAmpRfxfScbuXSXFYd+V
X-Received by 10.194.120.135 with SMTP id lc7mr1592209wjb.34.1465345044218; Tue, 07 Jun 2016 17:17:24 -0700 (PDT)
X-Received by 10.194.120.135 with SMTP id lc7mr1592199wjb.34.1465345044074; Tue, 07 Jun 2016 17:17:24 -0700 (PDT)
X-Mailman-Approved-At Tue, 07 Jun 2016 20:19:13 -0400
X-Content-Filtered-By Mailman/MimeDel 2.1.22
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CACMigy1yXKuX0HCyAcE7MrWdC5DJhOMVtnxbcLVkU_Qw4MZsYg@mail.gmail.com>
Xref csiph.com comp.lang.python:109641

Show key headers only | 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