Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!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; 'subject:Python': 0.06; '21,': 0.07; 'assignment': 0.07; 'variables': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:into': 0.09; 'variables.': 0.09; 'python': 0.11; 'changes': 0.15; '>on': 0.16; 'dictionary,': 0.16; 'example)': 0.16; 'merely': 0.16; 'message-id:@4ax.com': 0.16; 'mutable': 0.16; 'program),': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:variable': 0.16; 'travis': 0.16; 'wrote:': 0.18; "python's": 0.19; 'feb': 0.22; 'url:home': 0.24; 'holds': 0.26; 'references': 0.26; 'values': 0.27; 'header:X-Complaints-To:1': 0.27; 'idea': 0.28; 'fixed': 0.29; 'am,': 0.29; 'object.': 0.31; 'fri,': 0.33; 'object,': 0.36; 'subject:?': 0.36; 'list': 0.37; 'tired': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'subject:Can': 0.60; 'course': 0.61; 'address': 0.63; 'world': 0.66; 'fact,': 0.69; '2014,': 0.84; 'batchelder': 0.84; 'metaphor.': 0.84; 'hate': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Can global variable be passed into Python function? Date: Fri, 21 Feb 2014 21:47:22 -0500 Organization: IISS Elusive Unicorn References: <27ac2248-0ca3-4ba6-9d25-eaad324bc5e9@googlegroups.com> <87sird7wuw.fsf@handshake.de> <8454E8CB-E6E3-452F-8E54-9A77BFF34EC2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: adsl-108-79-218-218.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393037249 news.xs4all.nl 2843 [2001:888:2000:d::a6]:60063 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66864 On Fri, 21 Feb 2014 09:59:17 -0800, Travis Griggs declaimed the following: >On Feb 21, 2014, at 4:13 AM, Ned Batchelder wrote: > >> Man, do I hate this idea that Python has no variables. It has variables (names associated with values, and the values can change over the course of the program), they just don't work the same as C or Fortran variables. In fact, they work exactly the same as Javascript or Ruby variables. > >Thank you! > >+11 > >I get tired of the “Python doesn’t have variables” line. > If one is coming from the world where "variable" means "name identifying a fixed location in memory" then Python does not have "variables". BASIC, C, FORTRAN, COBOL, Assembly... A "variable" is synonym for an address [a box that holds things]. Even Python's mutable types (list, dictionary, for example) do not follow the "fixed location" metaphor. Each cell in a list merely references some object, and assignment to that cell changes the reference, not the object. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/