Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'sufficient': 0.05; 'subject:Python': 0.06; 'discard': 0.07; 'variables': 0.07; 'counting': 0.09; 'pretend': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runtime': 0.09; 'subject:into': 0.09; 'yeah,': 0.09; 'python': 0.11; '"mark': 0.16; 'behaviour.': 0.16; 'exist.': 0.16; 'finney': 0.16; 'ideally,': 0.16; 'imo.': 0.16; 'models,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:?)': 0.16; 'subject:avoiding': 0.16; 'subject:variable': 0.16; 'wider': 0.16; 'win,': 0.16; 'folks': 0.16; 'discussion': 0.18; 'community,': 0.19; 'normally': 0.19; "python's": 0.19; 'programming': 0.22; '(in': 0.22; 'community.': 0.22; 'header:User-Agent:1': 0.23; 'certainly': 0.24; 'refers': 0.24; 'rid': 0.24; "shouldn't": 0.24; 'references': 0.26; 'right.': 0.26; 'header:X-Complaints-To:1': 0.27; "doesn't": 0.30; 'getting': 0.31; 'away.': 0.31; 'writes:': 0.31; 'community': 0.33; 'trouble': 0.34; 'but': 0.35; 'doubt': 0.36; 'like,': 0.36; 'received:com.au': 0.36; 'subject:?': 0.36; 'so,': 0.37; 'ben': 0.38; 'to:addr:python-list': 0.38; 'expect': 0.39; 'explain': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'subject:Can': 0.60; 'hope': 0.61; 'free': 0.61; "you're": 0.61; 'term': 0.63; 'refer': 0.63; 'decided': 0.64; 'finally': 0.65; 'skip:\xe2 10': 0.65; 'details,': 0.68; '8bit%:40': 0.68; 'detail.': 0.68; 'newcomer': 0.84; 'received:125': 0.84; 'subject:skip:4 10': 0.84; 'care,': 0.91; '\xe2\x80\x9cthe': 0.91; 'race': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: References, and avoiding use of =?utf-8?B?4oCcdmFyaWFibGXigJ0=?= (was: Can global variable be passed into Python function?) Date: Fri, 28 Feb 2014 13:46:11 +1100 References: <27ac2248-0ca3-4ba6-9d25-eaad324bc5e9@googlegroups.com> <5f4f5a5f-327a-4616-8235-17ee9e74c488@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: vmx15867.hosting24.com.au 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:5sLIUMMDlfepnBiKHX3nBSwikIM= 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393555588 news.xs4all.nl 2836 [2001:888:2000:d::a6]:59180 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67188 "Mark H. Harris" writes: > So, yeah, thinking about variables is just not going away. Right. I would like, ideally, for the Python documentation to avoid mentioning that term entirely; and I would hope for that to promote a better understanding of Python's data model. The wider programming community, though, will no doubt continue to use that term to refer to various (incompatible) data models, and I certainly don't expect the Python community to pretend it doesn't exist. I encourage getting rid of it from Python documentation, but not getting rid of it from discussion in the community. > I finally decided (in my own head) that I would completely give up on > the 'variable' concept (intellectually) and help folks try to > understand references and reference counting. Reference counting isn't a concept one needs to present to newcomers, IMO. It is sufficient to explain that the Python runtime is free to discard an object when nothing refers to it any more. There's no need to explain to a newcomer the garbage-collection implementation details, precisely *because* it's an implementation detail. Some Python implementations use reference counting, some don't, and each implementation is free to do what it likes so long as the data model guarantees are preserved. The user normally shouldn't care, because they shouldn't have to depend on any specific garbage-collection behaviour. So: it's good to present the concept of “references”, and use “name binding” instead of “variable”; but there's no need to present “reference counting”, which is a Python-implementation-detail technical concept that IMO doesn't need to be in the newcomer's head. -- \ “The trouble with the rat race is that even if you win, you're | `\ still a rat.” —Jane Wagner, via Lily Tomlin | _o__) | Ben Finney