Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.freenet.ag!news2.euro.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'subject:Python': 0.05; 'class,': 0.07; 'only,': 0.07; 'variables.': 0.07; 'subject:help': 0.07; 'python': 0.09; 'identifier': 0.09; 'logic': 0.09; 'modifier': 0.09; 'skip:# 60': 0.09; 'subject:2.7': 0.09; 'to:addr:comp.lang.python': 0.09; 'variables,': 0.09; 'cc:addr:python-list': 0.10; 'stored': 0.10; 'subject:Help': 0.10; '(like': 0.15; 'folks': 0.15; 'value.': 0.15; 'happily': 0.16; 'identifier.': 0.16; 'instance)': 0.16; 'represents.': 0.16; 'subject:] [': 0.16; 'terms:': 0.16; 'value;': 0.16; 'variables:': 0.16; 'variables;': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'instance,': 0.17; 'variables': 0.17; '(or': 0.18; 'subject:] ': 0.19; 'module': 0.19; 'variable': 0.20; 'meant': 0.21; 'context.': 0.22; 'interpret': 0.22; 'symbolic': 0.22; 'cc:2**0': 0.23; 'thus': 0.24; 'cc:no real name:2**0': 0.24; 'allows': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'run': 0.28; 'mind,': 0.29; 'definition': 0.29; 'source': 0.29; 'class': 0.29; 'classes': 0.30; 'code': 0.31; 'december': 0.32; 'accessible': 0.33; 'instances': 0.33; 'programming,': 0.33; 'anyone': 0.33; 'languages': 0.33; 'received:google.com': 0.34; 'clear': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'modules': 0.36; 'method': 0.36; 'should': 0.36; 'subject: (': 0.36; 'resolve': 0.37; 'does': 0.37; 'level': 0.37; 'usual': 0.37; 'received:209': 0.37; 'some': 0.38; 'description': 0.39; 'apply': 0.39; 'called': 0.39; 'real': 0.61; 'time,': 0.62; 'information': 0.63; 'information,': 0.63; 'believe': 0.69; 'execution.': 0.84; 'wheel': 0.84; 'adopt': 0.91; 'dennis': 0.91 Newsgroups: comp.lang.python Date: Tue, 25 Dec 2012 15:42:45 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.196.111.248; posting-account=h3aEwQoAAACiuqX-oR3gvCVFm8lLHoWj References: <3f14f739-e660-4883-a940-c77a6092cb79@googlegroups.com> <50d9adb5$0$29967$c3e8da3$5496439d@news.astraweb.com> <04786b93-4b0c-41fd-adfe-b89cb35c886c@googlegroups.com> <0d16cf90-88bc-4f0b-8775-c0fdbf05bc94@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 70.196.111.248 MIME-Version: 1.0 Subject: Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) From: Rick Johnson To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 63 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356479669 news.xs4all.nl 6929 [2001:888:2000:d::a6]:35154 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35501 On Tuesday, December 25, 2012 3:08:21 PM UTC-6, Dennis Lee Bieber wrote: > Only that many of us don't believe Python has /variables/, the use > of instance/class as a modifier is thereby moot. What IS a variable Dennis? # ############################################################ # Variable (ComputerScience) # ############################################################ # In computer programming, a variable is a storage # # location and an associated symbolic name (an identifier) # # which contains some known or unknown quantity or # # information, a value. The variable name is the usual way # # to reference the stored value; this separation of name # # and content allows the name to be used independently of # # the exact information it represents. [...] The # # identifier in computer source code can be bound to a # # value during run time, and the value of the variable may # # thus change during the course of program execution. # ############################################################ # With that accurate definition in mind you can now understand how Python cla= sses CAN and DO have variables, just as Python modules have variables; psst= : they're called "global variables"! Now, whilst i don't believe we should haphazardly re-define the definition = of CS terms (or worse, re-invent the wheel by inventing new terms when perf= ectly good terms exist) I DO believe we should interpret these terms in the= ir current context. For instance, Python has no REAL "global variables", so we can happily refe= r to module level variables as global variables. However in many other lang= uages (like Ruby for instance) we can declare REAL "global variables" that = are known across all namespaces. And since Ruby also has modules which /the= mselves/ can contain variables, we would refer to "module level variables" = as "module variables".=20 > An instance method is a method that works on an instance of the > class, whereas a class method is meant to work on the class as a > whole Allow me to use better terms: An instance method is a method that is known to an instance of the class only, whereas a class method is known to all instances and accessible from the class identifier Now with that clear description in mind, apply it to variables: An instance method is a method that is known to an instance of the class only, whereas a class method is known to all instances and accessible from the class identifier. This transformation is without flaw because it is based on logic and not em= otion. > ...I don't know of anyone arguing that Python does not have > "methods". Of course not because they would have to be insane. However, we should neve= r adopt illogical terms just because a few folks cannot resolve the definit= ion of the proper terms.