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


Groups > comp.lang.python > #55149

Re: Python variables? [was Re: class implementation]

Newsgroups comp.lang.python
Subject Re: Python variables? [was Re: class implementation]
References (1 earlier) <02724244-c924-4cf0-9656-71ade6e435c2@googlegroups.com> <l2cjnf$42l$1@ger.gmane.org> <5249ECFE.2050402@nedbatchelder.com> <5249F4EE.60604@stoneleaf.us> <mailman.523.1380584711.18130.python-list@python.org>
From "Rhodri James" <rhodri@wildebst.demon.co.uk>
Organization The Wildebestiary
Message-ID <op.w382a2pwa8ncjz@gnudebeest> (permalink)
Date 2013-10-01 01:29 +0100

Show all headers | View raw


On Tue, 01 Oct 2013 00:45:06 +0100, Ned Batchelder <ned@nedbatchelder.com>  
wrote:

>
> On 9/30/13 6:02 PM, Ethan Furman wrote:
>> From your blog:
>>>
>>> Names are Python's variables: they refer to values, and
>>>  those values can change (vary) over the course of your
>>>  program.
>>
>> This is partially incorrect.  If the value referred to by the name is  
>> immutable, then it cannot change; perhaps you meant to say that which  
>> object the name points to can vary over time?
>
> Yes, I meant that 1) names refer to values, and 2) a name can refer to  
> different values over the course of a program.  Hence, the value varies,  
> hence, a variable.

Yes, except no.  The problem is that word "value", which I can practically  
see morphing its meaning through that paragraph.  Names refer to objects,  
which have values or interpretations or however you choose to say it.   
Some (mutable) objects can change their value, some (immutable) can't.   
Independently, names can refer to different objects, which may or may not  
have different values (or indeed concepts of value).

When you say "The value varies", it begs the question "Which 'the value'?"

> In fact, it's more accurate to say that Python has no constants! :)

Or, alternatively, that Python has many constants, such as all those  
immutable integers cached around the place :-)  What it doesn't have is  
fixed bindings.

-- 
Rhodri James *-* Wildebeest Herder to the Masses

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


Thread

class implementation markotaht@gmail.com - 2013-09-30 01:43 -0700
  Re: class implementation Peter Otten <__peter__@web.de> - 2013-09-30 11:03 +0200
  Re: class implementation markotaht@gmail.com - 2013-09-30 02:10 -0700
    Re: class implementation Peter Otten <__peter__@web.de> - 2013-09-30 11:27 +0200
  Re: class implementation markotaht@gmail.com - 2013-09-30 05:41 -0700
    Re: class implementation Peter Otten <__peter__@web.de> - 2013-09-30 15:02 +0200
    Re: class implementation Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-30 09:21 -0400
    Re: class implementation Piet van Oostrum <piet@vanoostrum.org> - 2013-09-30 13:32 -0400
    Re: class implementation Dave Angel <davea@davea.name> - 2013-09-30 19:34 +0000
      Re: class implementation 88888 Dihedral <dihedral88888@gmail.com> - 2013-10-01 00:01 -0700
    Re: class implementation Ned Batchelder <ned@nedbatchelder.com> - 2013-09-30 17:28 -0400
      Re: class implementation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-30 23:45 +0000
        Re: class implementation Ethan Furman <ethan@stoneleaf.us> - 2013-09-30 17:31 -0700
    Re: class implementation random832@fastmail.us - 2013-09-30 17:49 -0400
    Python variables?  [was Re: class implementation] Ethan Furman <ethan@stoneleaf.us> - 2013-09-30 15:02 -0700
    Re: Python variables? Ben Finney <ben+python@benfinney.id.au> - 2013-10-01 08:37 +1000
    Re: Python variables?  [was Re: class implementation] Ned Batchelder <ned@nedbatchelder.com> - 2013-09-30 19:45 -0400
      Re: Python variables?  [was Re: class implementation] "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-10-01 01:29 +0100
    Re: Python variables? Ned Batchelder <ned@nedbatchelder.com> - 2013-09-30 19:47 -0400
      Re: Python variables? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-01 01:03 +0000
        Re: Python variables? Ned Batchelder <ned@nedbatchelder.com> - 2013-09-30 21:28 -0400
    Re: class implementation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-01 00:19 +0000
  Re: class implementation markotaht@gmail.com - 2013-10-06 06:15 -0700
    Re: class implementation Terry Reedy <tjreedy@udel.edu> - 2013-10-06 15:52 -0400
    Re: class implementation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-07 01:24 +0000
  Re: class implementation markotaht@gmail.com - 2013-10-08 01:20 -0700
    Re: class implementation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-08 09:41 +0100
    Re: class implementation Dave Angel <davea@davea.name> - 2013-10-08 10:31 +0000
    Re: class implementation Cameron Simpson <cs@zip.com.au> - 2013-10-09 10:55 +1100
      Re: class implementation markotaht@gmail.com - 2013-10-10 11:34 -0700
        Re: class implementation Cameron Simpson <cs@zip.com.au> - 2013-10-11 09:07 +1100
        Re: class implementation Piet van Oostrum <piet@vanoostrum.org> - 2013-10-10 19:29 -0400
          Re: class implementation Ben Finney <ben+python@benfinney.id.au> - 2013-10-11 10:51 +1100
  Re: class implementation markotaht@gmail.com - 2013-10-08 07:05 -0700
    Re: class implementation "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-10-09 00:41 +0100

csiph-web