Path: csiph.com!goblin2!goblin.stu.neva.ru!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'classes.': 0.07; 'indexes': 0.09; 'indicates': 0.09; 'marking': 0.09; 'explicitly': 0.15; 'globals.': 0.16; 'local.': 0.16; 'opposite': 0.16; 'variable': 0.18; 'language': 0.19; 'item.': 0.22; 'programming': 0.22; 'header:In-Reply-To:1': 0.24; 'example': 0.26; 'message-id:@mail.gmail.com': 0.27; 'fine': 0.28; 'objects': 0.29; 'code': 0.30; "i'd": 0.31; 'probably': 0.31; 'suddenly': 0.33; 'received:google.com': 0.35; 'could': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'data': 0.39; 'takes': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'some': 0.40; 'on...': 0.66; 'url:app': 0.84; 'overall,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=zt01t414QIvICDzqCBeik3w1XQj6y49YtkAFvNPm8zA=; b=H1jIQ8I0soy/R6Jk3OG6UZO6UpuDRYU6nTHAwv6L4ZHD0WT3l0MB+6DH58Db+r6X5C SJEh+xV6ZylnNYhQVSg66uG9sA5KRj2qK8J82dpfj4kikXXA9Unw8ig25k1mQzSsv6iN /316PRfEBI0ykh+UCjBzaweflCLrNMRK8JZoYlSOje+vT+vVjq/Xu+EKgLkmXq3ot8ek CU/zQRMitEcB54/zoYURiPigX/uKm8k9on8f/DoCWEP2lFnfWKV9GRVXPem6PXeD9h6K UofG+DlJvnXJg2nJmTl02BOXnNcOOlvrfJfhLuNsrw00JzJMFXmhoobbFCoohXCr7lyL XTjw== MIME-Version: 1.0 X-Received: by 10.68.239.69 with SMTP id vq5mr13843397pbc.111.1441411547322; Fri, 04 Sep 2015 17:05:47 -0700 (PDT) In-Reply-To: References: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.com> Date: Fri, 4 Sep 2015 20:05:47 -0400 Subject: Re: Python handles globals badly. From: Vladimir Ignatov To: python-list@python.org Content-Type: text/plain; charset=UTF-8 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441411556 news.xs4all.nl 23770 [2001:888:2000:d::a6]:47585 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96034 > To me, marking a variable as global in a large number of functions is > a code smell that indicates that you're probably overusing globals. > Lua is an example of a language that takes the opposite approach: in > Lua, every variable is global unless you explicitly mark it as local. > Lua is a fine language overall, but that is one of my pet peeves with I had some experience programming in Lua and I'd say - that language is bad example to follow. Indexes start with 1 (I am not kidding) Single data type ("table") which could suddenly flip from "list" to "map" because you deleted one item. Has objects but has no classes. and so on... Vladimir http://itunes.apple.com/us/app/python-code-samples/id1025613117