Path: csiph.com!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'true,': 0.04; 'subject:Python': 0.05; 'compiler': 0.05; 'method.': 0.05; 'array.': 0.07; 'indices': 0.07; 'received:internal': 0.09; 'runtime': 0.09; 'weird': 0.15; '(via': 0.16; 'arrays,': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'nonzero': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'valid.': 0.16; 'wrote:': 0.16; 'integer': 0.18; 'creates': 0.18; 'variable': 0.18; 'meant': 0.22; 'arrays': 0.22; 'assign': 0.22; 'sep': 0.22; '(you': 0.23; 'header:In-Reply-To:1': 0.24; 'feature': 0.24; "doesn't": 0.26; 'skip:m 30': 0.27; 'obscure': 0.29; 'array': 0.29; 'fixed': 0.31; "can't": 0.32; 'class': 0.33; 'tue,': 0.34; 'done': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'method': 0.37; 'late': 0.38; 'received:66': 0.38; 'enough': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'from:no real name:2**0': 0.60; 'header:Message-Id:1': 0.61; 'different': 0.63; 'believe': 0.66; 'subject': 0.70 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=fZYMkQhroEE4upyEXd8gmiOgNn4=; b=tsHOC0 yvDeUerInp2bFtqP0wYjWnSDExj8G4oftBDSj2nbnbIZOu198k9HKFclkQQsjVuq vYNWQng4JhnCKIJRg7f8x/P6ul5WedviNCwywLlgL6kWU/P8N9okgn80vPlfEi3t zNYkuNl/MVWNoF/SYoTwLYp/vagBYOaRahhQo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=fZYMkQhroEE4upy EXd8gmiOgNn4=; b=S8BdHsq/KrfpmyiIutjIJwmUwKNQTpxODixb/7xIXe7qgWQ 7gk476b8uc4gsM1zPRlGpG99GnlidYtW9iFj0TxMeATyptDS/LO6apTJ3acqYYFI hW5EF8FUVO9FDJvBBGDJj8yLsNMiPxzlIDfZ6ssq07gsCTbHpy+Yac5EsjX8= X-Sasl-Enc: 1Z4pUeDzR3oHHSGtYJQ+TErhat1d2pboBx8wtmrB09D8 1441728814 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-c76b43ce Subject: Re: Python handles globals badly. Date: Tue, 08 Sep 2015 12:13:34 -0400 In-Reply-To: References: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.com> <55EE9EEC.1060907@rece.vub.ac.be> 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441728822 news.xs4all.nl 23852 [2001:888:2000:d::a6]:37020 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 5089 X-Received-Body-CRC: 3657925569 Xref: csiph.com comp.lang.python:96136 On Tue, Sep 8, 2015, at 10:31, Ian Kelly wrote: > I believe this wart is fixed in VB .NET. This is apparently true, but the weird thing is it was done late enough in the design cycle that the .NET runtime still has features meant to support it. You can create such an array with the Array.CreateInstance method. For multidimensional arrays, you can even assign them to a variable of the proper type (You can't do that for single-dimension arrays since a single-dimension array with a nonzero lower bound is a different type than a normal array). And the LBound and UBound methods in the Microsoft.VisualBasic.Information class still support it. The feature is so obscure that even the compiler doesn't do well with it - if you create (via MSIL) a strongly-typed method that returns such an array, the compiler will think it returns a normal array. Of course, on the subject of warts, Dim x(5) as Integer or Dim x as Integer() = new Integer(5){} still creates an array with size 6 (upper bound is 5). You're free to use indices 0..4 or 1..5 if you want, but 0..5 are valid.