Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'string.': 0.04; 'variable,': 0.07; 'python': 0.08; 'instance.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'variables.': 0.09; 'class,': 0.15; 'integer.': 0.16; 'variable.': 0.16; 'subject:question': 0.16; 'wrote:': 0.18; 'instance': 0.18; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'string': 0.24; 'preferred': 0.25; 'classes': 0.26; 'code': 0.26; 'variable': 0.28; 'class': 0.29; 'quite': 0.31; 'objects': 0.32; 'list': 0.32; 'languages': 0.32; 'header:User-Agent:1': 0.33; 'updated': 0.33; 'fri,': 0.34; 'header:X-Complaints-To:1': 0.34; 'from:addr:yahoo.co.uk': 0.34; 'steven': 0.34; 'integer': 0.34; 'to:addr:python-list': 0.35; 'david': 0.35; 'list.': 0.35; 'received:org': 0.36; 'difference': 0.38; 'received:78': 0.40; 'to:addr:python.org': 0.40; 'your': 0.61; 'choose': 0.64; 'show': 0.66; '(int,': 0.84; 'circles': 0.84; 'received:as13285.net': 0.84; 'terminology': 0.84; 'choose.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: namespace question Date: Sat, 25 Feb 2012 00:39:39 +0000 References: <4895480.4960.1330062902417.JavaMail.geo-discussion-forums@ynjd19> <02658273-fb07-4cb6-a223-27520f4a0168@p13g2000yqd.googlegroups.com> <4f480e68$0$29989$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-146-4-197.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <4f480e68$0$29989$c3e8da3$5496439d@news.astraweb.com> X-Antivirus: avast! (VPS 120224-2, 24/02/2012), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1330130406 news.xs4all.nl 6902 [2001:888:2000:d::a6]:53595 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20844 On 24/02/2012 22:25, Steven D'Aprano wrote: > On Fri, 24 Feb 2012 10:08:43 -0800, David wrote: > >> Your code updated to show the difference between a variable, a class >> variable, and an instance variable. > > The preferred terms in Python circles are class and instance > *attributes*, not variables. > > An integer variable is a variable holding an integer. > > A string variable is a variable holding a string. > > A list variable is a variable holding a list. > > Therefore a class variable is a variable holding a class, and an instance > variable is a variable holding an instance. > > Yes, in Python, classes and types are first-class objects (pun not > intended), and it is quite common to store them in variables: > > for cls in (int, float, Decimal, Fraction, myint, myfloat): > do_something_with(cls) > > > Other languages may choose to use illogical terminology if they choose. > Surely you mean names, not variables? :) -- Cheers. Mark Lawrence.