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


Groups > comp.lang.python > #20844

Re: namespace question

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 <python-python-list@m.gmane.org>
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 <breamoreboy@yahoo.co.uk>
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 <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.147.1330130406.3037.python-list@python.org> (permalink)
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

Show key headers only | View raw


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.

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


Thread

namespace question xixiliguo <wangbo.red@gmail.com> - 2012-02-23 21:55 -0800
  Re: namespace question Chris Rebert <clp2@rebertia.com> - 2012-02-23 22:35 -0800
  Re: namespace question Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-02-24 12:56 +0100
  Re: namespace question David <dwblas@gmail.com> - 2012-02-24 10:08 -0800
    Re: namespace question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-24 22:25 +0000
      Re: namespace question Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-02-25 00:39 +0000
        Re: namespace question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-25 01:38 +0000
      Re: namespace question Ben Finney <ben+python@benfinney.id.au> - 2012-02-26 19:47 +1100
        Re: namespace question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-26 13:40 +0000
          Re: namespace question Ben Finney <ben+python@benfinney.id.au> - 2012-02-28 22:36 +1100
            Re: namespace question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-28 14:06 +0000

csiph-web