Path: csiph.com!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.056 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.01; 'subject:Python': 0.05; 'received:134': 0.05; 'indexing': 0.07; 'indexes': 0.09; 'slices': 0.09; 'python': 0.10; 'received:ac.be': 0.16; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'sense': 0.26; 'boundaries': 0.29; 'cells': 0.29; 'received:be': 0.30; 'especially': 0.32; 'operate': 0.32; 'michael': 0.33; 'case,': 0.34; 'gets': 0.35; 'trouble': 0.35; 'but': 0.36; 'instead': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'operating': 0.37; 'to:addr:python.org': 0.40; 'bring': 0.62; 'between': 0.65; 'reverse': 0.66; 'special': 0.73; 'pardon': 0.84; 'schreef': 0.84; 'screwed.': 0.84; 'step.': 0.91 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoMGAI4M8FWGuA9G/2dsb2JhbABdhDyDSMF6AoF8AQEBAQEBhS8BAQQjVRELGgIFFgsCAgkDAgECAUUTCAKIKrV8kBOEKQEBCAIggSKFUYR7hRMXglKBQwEElVaMeohskgwmhAKJOAEBAQ Date: Wed, 09 Sep 2015 12:42:33 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Python handles globals badly. References: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.com> <55EE9EEC.1060907@rece.vub.ac.be> <55ef0514$0$1655$c3e8da3$5496439d@news.astraweb.com> <55EF7556.2090409@gmail.com> In-Reply-To: <55EF7556.2090409@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441795362 news.xs4all.nl 23779 [2001:888:2000:d::a6]:37432 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96182 Op 09-09-15 om 01:55 schreef Michael Torrie: > In any case, 0-based indexing in Python makes a lot of sense when you > bring in the slicing syntax. Especially if you think of slicing as > operating on the boundaries between cells as it were. Then you have never used slices with a negative step. If slicing would operate on the boundaries between cells then the reverse of lst[2:7] would be lst[7:2:-1] instead it is lst[6:1:-1] This gets you in trouble when you want to reverse through lst[0:8] which would be lst[7:-1:-1] but now the special meaning of negative indexes kicks in and you are screwed. -- Antoon Pardon