Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53723

Re: Could someone please paraphrase this statement about variables and functions in Python?

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joel.goldstick@gmail.com>
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; 'parameters': 0.04; 'subject:Python': 0.06; 'referring': 0.07; 'variables': 0.07; 'arguments': 0.09; 'function,': 0.09; 'references,': 0.09; 'stack,': 0.09; 'thus,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'translation': 0.12; 'assignments': 0.16; 'excerpt': 0.16; 'introduces': 0.16; 'object).': 0.16; 'programmer,': 0.16; 'scope,': 0.16; 'subject: \n ': 0.16; 'subject:Could': 0.16; 'table;': 0.16; 'wrote:': 0.18; 'variable': 0.18; '(where': 0.19; 'thu,': 0.19; 'written': 0.21; 'appears': 0.22; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'logical': 0.24; 'please?': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'nearly': 0.26; 'references': 0.26; 'tables': 0.26; 'tutorials': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; '[1]': 0.29; 'statement': 0.30; 'subject:please': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; '(unless': 0.31; 'names.': 0.31; 'sep': 0.31; 'table,': 0.31; 'this.': 0.32; 'probably': 0.32; 'thanks!': 0.32; 'another': 0.32; 'url:python': 0.33; 'everyone': 0.33; 'actual': 0.34; 'table': 0.34; '"the': 0.34; 'could': 0.34; 'problem': 0.35; 'knowledge': 0.35; 'created': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'really': 0.36; 'url:listinfo': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'half': 0.37; 'too': 0.37; 'pm,': 0.38; 'extremely': 0.39; 'called': 0.40; 'url:mail': 0.40; 'even': 0.60; 'tell': 0.60; 'introduced': 0.61; 'new': 0.61; 'url:3': 0.61; 'first': 0.61; 'information': 0.63; 'more': 0.64; 'finally': 0.65; 'spot': 0.65; 'to:addr:gmail.com': 0.65; 'within': 0.65; 'subject:this': 0.83; 'joel': 0.91; 'whereas': 0.91; '2013': 0.98
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 :cc:content-type:content-transfer-encoding; bh=8W1UcBeBOAC01yVPLG02vru5+YGxa2BgfASd0tbAIm0=; b=xoviLJv+uc/gUKWAqhFWmx9IFTxvuGHeIoATQFVmxkGQORMxeyiXMJrrLRwbP/FyLg 2PW2xocLe9hHHL5QvvAaV3jtkA8RKnLXzNvaEFZ3puR8Agm6DwXNrHHv0vIw2ZxPmBj+ 4mOifMbj/kbIDr7awiFXlYp5+Jo8q5dX6MU6kebtM65yBVLDN8Yj8sFKviiF2p5Hfdze UszT2rqPIs4uOaR78YUA2tyhQWcGdQhL6/SUbt7DjTXXgKEoMXEvUymfTLdH8zGDsVbC SgxyxxTkPlGRc2PdUpvWDP7/aOLz7Kx3z+Ih6AyAmafUjItHbfxLZKHzpGnnTgn9KPSn eQRw==
MIME-Version 1.0
X-Received by 10.58.155.68 with SMTP id vu4mr8779950veb.21.1378400717780; Thu, 05 Sep 2013 10:05:17 -0700 (PDT)
In-Reply-To <a02c6f75-bbae-4026-aa60-babe011baac4@googlegroups.com>
References <a02c6f75-bbae-4026-aa60-babe011baac4@googlegroups.com>
Date Thu, 5 Sep 2013 13:05:17 -0400
Subject Re: Could someone please paraphrase this statement about variables and functions in Python?
From Joel Goldstick <joel.goldstick@gmail.com>
To jsrig88@gmail.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.99.1378400726.5461.python-list@python.org> (permalink)
Lines 42
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1378400726 news.xs4all.nl 15888 [2001:888:2000:d::a6]:59587
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:53723

Show key headers only | View raw


On Thu, Sep 5, 2013 at 12:40 PM,  <jsrig88@gmail.com> wrote:
> Could someone please paraphrase this statement about variables and functions in Python?
>
> I am going through the tutorials on docs.python.org, and I came across this excerpt from http://docs.python.org/3/tutorial/controlflow.html:
>
> "The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables cannot be directly assigned a value within a function (unless named in a global statement), although they may be referenced.
>
> "The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference, not the value of the object). [1] When a function calls another function, a new local symbol table is created for that call."
>
> Even as a professional programmer, I'm not really able to follow this.  It appears to be self-contradictory, amgiguous, incomplete, and possessive of logical missteps.  The problem with looking for this information elsewhere is that it's not going to be all in one spot like this half the time, and it's not going to be readily searchable on Google without more knowledge of what it's referring to.  However this looks like something that's too important to overlook.
>
> I can tell it's referring to things like scope, pass-by-value, references, probably the call stack, etc., but it is written extremely poorly.  Translation please?  Thanks!
> --
> https://mail.python.org/mailman/listinfo/python-list

Nearly everyone gets confused by this initially.  You should google
python namespaces

-- 
Joel Goldstick
http://joelgoldstick.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Could someone please paraphrase this statement about variables and functions in Python? jsrig88@gmail.com - 2013-09-05 09:40 -0700
  Re: Could someone please paraphrase this statement about variables and functions in Python? Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-05 13:05 -0400
    Re: Could someone please paraphrase this statement about variables and functions in Python? newspost2012@gmx.de - 2013-09-05 10:12 -0700

csiph-web