Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Antoon Pardon Newsgroups: comp.lang.python Subject: Re: static variables Date: Wed, 02 Dec 2015 09:34:32 +0100 Lines: 19 Message-ID: References: <565cf163$0$1612$c3e8da3$5496439d@news.astraweb.com> <565e4329$0$1612$c3e8da3$5496439d@news.astraweb.com> <565e4861$0$1587$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de deBLNjVZgz+ICNrK3azSzgc1kqYgIgDuClZjyMlZJ7tw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'static': 0.03; 'essentially': 0.04; 'received:134': 0.05; 'attributes': 0.07; 'agree,': 0.09; 'mess': 0.09; 'messing': 0.09; 'variables,': 0.09; 'attribute,': 0.16; 'better:': 0.16; 'received:ac.be': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'suggested,': 0.16; 'mechanism': 0.18; 'variable': 0.18; 'features,': 0.22; 'somewhere': 0.24; 'header:In-Reply-To:1': 0.24; 'discussion': 0.24; 'feature': 0.24; 'header:User-Agent:1': 0.26; 'actual': 0.28; 'invoke': 0.29; 'now?': 0.29; 'received:be': 0.30; 'certain': 0.31; 'class': 0.33; 'steven': 0.33; 'instance': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'why': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'here.': 0.62; 'else.': 0.66; 'here': 0.66; 'protect': 0.76; "d'aprano:": 0.84; 'schreef': 0.84; 'worthy': 0.84 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukFAJ6rXlaGuA9G/2dsb2JhbABehFYBwFaGDgKCGwEBAQEBAYVAAQEEI1URCxoCBRYLAgIJAwIBAgFFEwgCiCutX4x+hAUBAQgCIYEBhVOEfYREY4JOgUQFllyNO4FbhzaPZ4NyY4QFhReBSQEBAQ User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.8.0 In-Reply-To: <565e4861$0$1587$c3e8da3$5496439d@news.astraweb.com> 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: , Xref: csiph.com comp.lang.python:99850 Op 02-12-15 om 02:24 schreef Steven D'Aprano: > Heh, I agree, and as I suggested, it might be good to have an actual > mechanism for static locals. But using a class is no better: your "static > storage" is exposed as an instance attribute, and even if you flag it > private, *somebody* is going to mess with it. Why don't you invoke the consenting adults now? People have come here arguing for all kind of extra features, which would somehow defend against messing with certain variable or attributes the author wants protected. The general respons has always been, that we are consenting adults here. Static variables, are just a feature to protect what is essentially a global variable against messing from somewhere else. So why is this feature worthy of discussion and others are not? -- Antoon.