Path: csiph.com!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone04.am1.xlned.com!bcyclone04.am1.xlned.com!newsfeed.xs4all.nl!newsfeed8.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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.05; '0.02': 0.09; '"object': 0.16; 'attributes.': 0.16; 'globals.': 0.16; 'inclined': 0.16; 'parameter,': 0.16; 'settings)': 0.16; 'app': 0.16; 'minor': 0.22; 'pass': 0.22; 'code.': 0.23; '(like': 0.23; 'passing': 0.23; 'header:In-Reply-To:1': 0.24; 'parameters': 0.27; 'message-id:@mail.gmail.com': 0.27; 'values': 0.28; 'regular': 0.29; '(my': 0.29; 'work.': 0.30; 'code': 0.30; 'holds': 0.32; 'received:google.com': 0.35; 'sometimes': 0.35; 'but': 0.36; 'too': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'stuff': 0.38; 'hi,': 0.38; 'to:addr:python.org': 0.40; 'personally': 0.61; 'more': 0.63; 'url:app': 0.84 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=x5d1YnW8vzQd5ItRYxbeSjqJRiMW/r9+9WfVOQZdFpA=; b=QcujUv7KIXRycCFLpbZrGN0iv1ereEVi0fTJ+fGyXHcQO/+vTxITUiBGdlhp3veMIG 9vx+UfylCyKeudpxBa4T4islhykoIwvnW7GPWYnHdoMOytu8zhFniiG0HCNiwKBfoCTW ir4epylul9qj2tmxroz+i/+GFkO6OVq1j+PcdwYqK9fZiVserebrPv57NFH9klsZbUyG QSbdOEkh+1J3qw7KTAlf348utnVqaWmdcV7YHJ98h7ktGqQQDf3umkyygRFxgjaKCHS3 tiZNRJat+60oAfZS60zvFaIZyYxsdX9t0c9hUVc84e1pHfq3N1AJSWWS7yvkm/uX5nfq yhtw== MIME-Version: 1.0 X-Received: by 10.66.136.102 with SMTP id pz6mr61525425pab.52.1441239407850; Wed, 02 Sep 2015 17:16:47 -0700 (PDT) In-Reply-To: References: <253e3584-1d4d-4e6f-b42f-2cdbfa4ad785@googlegroups.com> Date: Wed, 2 Sep 2015 20:16: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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441239411 news.xs4all.nl 23728 [2001:888:2000:d::a6]:58404 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3521 X-Received-Body-CRC: 2627214932 Xref: csiph.com comp.lang.python:95909 Hi, my 0.02 I don't personally use globals. And don't like "object oriented" code (my code more inclined toward "functional" style). But sometimes I feel like passing various minor values (like settings) all around app via regular parameters is just too much work. So I use "pseudo-global" object which holds various stuff in its attributes. And I pass that object around my code. But that is just one parameter, not myriads of them. Vladimir http://itunes.apple.com/us/app/python-code-samples/id1025613117