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


Groups > comp.lang.python > #20974

Re: namespace question

From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: namespace question
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> <87y5rqrney.fsf@benfinney.id.au> <4f4a3633$0$29989$c3e8da3$5496439d@news.astraweb.com>
Date 2012-02-28 22:36 +1100
Message-ID <87mx83p4tj.fsf@benfinney.id.au> (permalink)
Organization Unlimited download news at news.astraweb.com

Show all headers | View raw


Steven D'Aprano <steve+comp.lang.python@pearwood.info> writes:

> On Sun, 26 Feb 2012 19:47:49 +1100, Ben Finney wrote:
>
> >> 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.
> > 
> > And Python has none of those. Its references don't “hold” anything.
>
> Ah, but they do. Following the name binding:
>
> x = 1
>
> the name "x" now holds a reference to an int, or if you want to cut out 
> one layer of indirection, the name "x" holds an int. That is to say, the 
> value associated with the name "x" is an int.

Names don't hold anything. Not in natural language, and not in Python.

Which is exactly *why* the term “name” is a good one, since Python's
bindings don't hold anything either. It's a reference, not a container.

> I don't believe this is a troublesome concept.

Then you have a different concept of “name” from anything I'd expect
anyone to understand.

> > I appreciate that you think “variable” is a useful term in Python,
> > but this kind of mangling of the concept convinces me that it's not
> > worth it.
>
> I'm not sure that there is any mangling here. Or at least, the concept
> is only mangled if you believe that Pascal- or C-like variables (named
> memory locations) are the one true definition of "variable". I do not
> believe this.

The fact that you keep having to come back to container analogies, when
that's exactly what Python doesn't have and what differentiates it, is
why I think the term “variable” isn't helping the discussion. Not for
us, and not for newcomers to the language.

> Words vary in their meanings

Of course they do. but we don't have to let any word mean any arbitrary
thing. I reject attempts to Humpty Dumpty our way through discussions
with newcomers about Python concepts.

-- 
 \         “Simplicity and elegance are unpopular because they require |
  `\           hard work and discipline to achieve and education to be |
_o__)                                appreciated.” —Edsger W. Dijkstra |
Ben Finney

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