Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed6.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.036 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'commonly': 0.09; 'slices': 0.09; 'subject:()': 0.09; ':-)': 0.13; 'producing': 0.15; 'iteration.': 0.16; 'oct': 0.16; 'subject:array': 0.16; 'subsequences': 0.16; 'surprising': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'meant': 0.21; "i've": 0.23; 'header:In-Reply-To:1': 0.25; 'andrew': 0.27; 'message-id:@mail.gmail.com': 0.27; 'though.': 0.29; 'wrap': 0.29; 'handled': 0.29; "i'm": 0.29; 'asking': 0.32; 'to:addr:python-list': 0.33; 'another': 0.33; 'agree': 0.34; 'received:google.com': 0.34; 'especially': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'should': 0.36; 'too': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'positive': 0.38; 'several': 0.39; 'to:addr:python.org': 0.39; 'easily': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'relatively': 0.62; 'more': 0.63; 'behavior': 0.64; 'useful.': 0.65; 'stop,': 0.84; 'to:name:python': 0.84; 'convinced': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=lnZsFuH29GNGz87t2erqPmuI4CKKpRCNn+ADm1hTX3w=; b=JUCu06HY1WZC/4TS7K+pl1e+kjj8C0snILPw7t3K2qV/uz2iyku6jzc7tLIdKFiTxg TRnalk3TeTzlQfSGs4sLaDyYPmlK0AD89TX9Jk5i8QCByi/b33aEzsbSsZaNBT/7GRXI UmMUXLNvAQEj512xJUs+ZffRNxxLN0S2P3QACp6BmTJ0nXf/nzZ7utXOT+fwK8odh/Rf yuIiWUajOzu03SyZYRT4bkOE3tKnwbB2ph2fYoALzO0Zd1GP1Lt3qVp4NtzC2EdKGzPv WQjWl8lzdbHgCwG9QKjSNNzhNfZKle1YOWyugg8McRDSpCdYuoXUN1T1pWFi55N0c6Fh qHkw== MIME-Version: 1.0 In-Reply-To: <508F1741.1070609@r3dsolutions.com> References: <6998a955-7b34-4f4f-b8d6-62d1028f7561@googlegroups.com> <4c024364-84df-403b-8b9e-4a4c8f06121c@googlegroups.com> <508e6649$0$29967$c3e8da3$5496439d@news.astraweb.com> <508E9EBA.2070307@r3dsolutions.com> <508F1741.1070609@r3dsolutions.com> From: Ian Kelly Date: Tue, 30 Oct 2012 02:15:23 -0600 Subject: Re: Negative array indicies and slice() To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351584955 news.xs4all.nl 6898 [2001:888:2000:d::a6]:34497 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32475 On Mon, Oct 29, 2012 at 5:54 PM, Andrew Robinson wrote: >> I don't know of a reason why one might need to use a negative start >> with a positive stop, though. > > I've already given several examples; and another poster did too I meant that I don't know of a reason to do that given the existing semantics, which is what you were asking for. :-) I understand and agree that there are potential applications for allowing slices to wrap around from negative to positive. What I'm not convinced of is that these applications need or should be handled by the slicing operation -- which is more commonly understood as producing subsequences -- especially since they already can be handled relatively easily by iteration. I think that more users would find the behavior surprising than useful.