Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!news2.arglkargh.de!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.062 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'interpreter': 0.04; 'debugging': 0.05; '"c"': 0.07; 'api': 0.09; 'python': 0.09; 'garbage': 0.09; 'subject:()': 0.09; 'bug': 0.10; 'stored': 0.10; '.py': 0.16; 'code?': 0.16; 'oct': 0.16; 'report?': 0.16; 'subject:array': 0.16; 'surprising': 0.16; 'tuple;': 0.16; 'wrote:': 0.17; 'thanks,': 0.18; 'memory': 0.18; 'effort.': 0.22; 'exists.': 0.22; 'help.': 0.22; 'defined': 0.22; 'url:bugs': 0.24; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'looks': 0.26; 'am,': 0.27; 'separate': 0.27; 'start,': 0.27; 'interface': 0.27; 'post': 0.28; 'source': 0.29; 'code': 0.31; '(and': 0.32; 'implement': 0.32; 'url:python': 0.32; 'file': 0.32; 'legacy': 0.33; 'substantial': 0.33; 'to:addr :python-list': 0.33; 'there': 0.35; 'really': 0.36; 'url:org': 0.36; 'bad': 0.37; 'level': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'step': 0.39; 'think': 0.40; "you've": 0.61; 'first': 0.61; 'protection': 0.62; 'back': 0.62; '30,': 0.62; 'received:phx3.secureserver.net': 0.62; 'received:prod.phx3.secureserver.net': 0.62; 'mentioned': 0.63; 'great': 0.64; 'reached': 0.65; 'finally': 0.66; 'header:Reply- To:1': 0.68; 'consequences': 0.71; 'realized': 0.71; 'reply-to:no real name:2**0': 0.72; 'savings': 0.75; 'day...': 0.84; 'furman': 0.84; 'ian,': 0.84; 'improvement': 0.84; 'received:173.201.192.110': 0.84; 'received:p3plsmtpa06-09.prod.phx3.secureserver.net': 0.84; 'stop,': 0.84; 'ethan': 0.91; 'increases': 0.91; 'received:173.201': 0.91; 'received:173.201.192': 0.91 Date: Tue, 30 Oct 2012 07:21:02 -0700 From: Andrew Robinson User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111126 Thunderbird/8.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Negative array indicies and slice() References: <6998a955-7b34-4f4f-b8d6-62d1028f7561@googlegroups.com> <4c024364-84df-403b-8b9e-4a4c8f06121c@googlegroups.com> <508e6649$0$29967$c3e8da3$5496439d@news.astraweb.com> <508E1BC9.3000308@r3dsolutions.com> <508EC428.5080808@r3dsolutions.com> <508FFCD6.3010305@stoneleaf.us> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: andrew3@r3dsolutions.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351632022 news.xs4all.nl 6918 [2001:888:2000:d::a6]:37481 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32503 On 10/30/2012 11:02 AM, Ian Kelly wrote: > On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman wrote: >> File a bug report? > Looks like it's already been wontfixed back in 2006: > > http://bugs.python.org/issue1501180 Thanks, IAN, you've answered the first of my questions and have been a great help. (And yes, I was debugging interactive mode... I took a nap after writing that post, as I realized I had reached my 1 really bad post for the day... ) I at least I finally know why Python chooses to implement slice() as a separate object from tuple; even if I don't like the implications. I think there are three main consequences of the present implementation of slice(): 1) The interpreter code size is made larger with no substantial improvement in functionality, which increases debugging effort. 2) No protection against perverted and surprising (are you surprised?! I am) memory operation exists. 3) There is memory savings associated with not having garbage collection overhead. D'Apriano mentioned the named values, start, stop, step in a slice() which are an API and legacy issue; These three names must also be stored in the interpreter someplace. Since slice is defined at the "C" level as a struct, have you already found these names in the source code (hard-coded), or are they part of a .py file associated with the interface to the "C" code?