Path: csiph.com!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runtime': 0.09; 'subtract': 0.09; 'things.': 0.15; 'index.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subtraction': 0.16; 'basically': 0.18; 'element': 0.18; 'processor': 0.18; 'url:home': 0.18; 'language': 0.19; '2015': 0.20; 'sep': 0.22; 'implemented': 0.24; 'header:X-Complaints-To:1': 0.26; 'sequence': 0.27; 'books': 0.30; 'especially': 0.32; 'michael': 0.33; 'indexed': 0.33; 'shift': 0.33; 'tue,': 0.34; 'add': 0.34; 'skip:i 20': 0.36; 'faster': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; "didn't": 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'more': 0.63; 'teach': 0.70; 'power': 0.72; 'tended': 0.84; 'dennis': 0.91; 'url:reference': 0.91; 'received:108': 0.93; 'advertise': 0.96 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Python handles globals badly. Date: Wed, 09 Sep 2015 09:33:49 -0400 Organization: IISS Elusive Unicorn 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 108.68.178.61 X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441805662 news.xs4all.nl 23732 [2001:888:2000:d::a6]:50708 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96190 On Tue, 08 Sep 2015 17:55:02 -0600, Michael Torrie declaimed the following: >I used a 1-based indexed language (BASIC) for many years, and I was >always having to subtract 1 from things. So 0-based is simply more >convenient for me. > Many BASICs actually did allocate a zeroth element (dim x(6) allocating 7 elements) -- likely because it made the runtime faster (start_of_array + index*element_length, where the *element_length was basically a power of 2 shift operation... Rather than adding a "-1" operation in the middle -- especially if the processor implemented subtraction as a negate and add sequence )... They just didn't advertise it, and the intro books tended to teach on the basis of a 1-based index. http://dictionary.reference.com/browse/dim+statement -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/