Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'variables': 0.07; 'attributes': 0.09; 'bindings': 0.09; 'immutable': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'variable,': 0.09; 'variables.': 0.09; 'python': 0.11; 'mostly': 0.14; 'bindings.': 0.16; 'constants.': 0.16; 'fine.': 0.16; 'finney': 0.16; 'reasonable.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:non': 0.16; 'variable.': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'meant': 0.20; 'seems': 0.21; 'header:User-Agent:1': 0.23; 'case.': 0.24; 'right.': 0.26; 'defined': 0.27; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'generally': 0.29; 'thus': 0.29; 'adams': 0.31; 'douglas': 0.31; 'writes:': 0.31; 'class': 0.32; 'themselves': 0.32; 'another': 0.32; 'problem': 0.35; 'agree': 0.35; 'classes': 0.35; 'objects': 0.35; 'but': 0.35; 'doubt': 0.36; 'leads': 0.36; 'subject:skip:d 10': 0.36; 'subject:?': 0.36; 'so,': 0.37; 'too': 0.37; 'being': 0.38; 'ben': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'changed': 0.39; 'received:org': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'dave': 0.60; 'areas': 0.61; "you're": 0.61; 'more': 0.64; 'skip:\xe2 10': 0.65; '8bit%:40': 0.68; 'nobody': 0.68; '8bit%:21': 0.69; 'other.': 0.75; 'forth': 0.81; 'confusion.': 0.84; 'pardon': 0.84; '\xe2\x80\x9cwe': 0.84; 'angel': 0.91; 'avoided.': 0.91; 'demand': 0.91; 'hand,': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Importing variables non-deterministic? Date: Tue, 20 Aug 2013 11:14:49 +1000 References: <520f9054$0$30000$c3e8da3$5496439d@news.astraweb.com> <5211C5BD.5040209@rece.vub.ac.be> <5211D464.5090303@rece.vub.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: rasputin.madmonks.org X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:ok18IVOx+peu/e7sdMExMiiu/9U= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376961306 news.xs4all.nl 15964 [2001:888:2000:d::a6]:58047 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52710 Antoon Pardon writes: > Op 19-08-13 09:45, Dave Angel schreef: > > Antoon Pardon wrote: > >> I think you are overstating your case. Classes and functions are > >> variables too and in general nobody seems to have a problem with > >> them being global. > > > > It's global *variables* that are to be avoided. constants like > > clsases and functions are fine. On the other hand, class attributes > > can be variable, and thus are to be avoided when reasonable. > > Python has no constants. Classes and functions can be changed just like > any other variable. I agree that classes and function are generally > meant to be constant, but often enought so are global int variables. I take this as yet another data point that speaking about “variables” leads mostly to confusion. What Python has are bindings. Those bindings can change (what Antoon calls “changed just like any other variable”). Many objects are immutable (what Dave calls “constants like classes and functions”), even if the bindings can vary and even if they contain attributes which are themselves bindings that can change. So, you're both right. The terminology is leading you both astray and having you talk past each other. Now go forth and speak of variables no more :-) -- \ “We demand rigidly defined areas of doubt and uncertainty!” | `\ —Vroomfondel, _The Hitch-Hiker's Guide To The Galaxy_, Douglas | _o__) Adams | Ben Finney