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


Groups > comp.lang.python > #86306

Re: list storing variables

From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: list storing variables
Date 2015-02-24 10:18 +0200
Organization A noiseless patient Spider
Message-ID <87385ven8x.fsf@elektro.pacujo.net> (permalink)
References <54eb2357$0$3011$426a74cc@news.free.fr> <mailman.19104.1424728988.18130.python-list@python.org> <54ebe0c8$0$11114$c3e8da3@news.astraweb.com>

Show all headers | View raw


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

> Ben Finney wrote:
>> There is no “address of a value” concept in Python.
>
> Furthermore, in Python, values can *change their address*.
>
> Jython and IronPython both are built on top of a garbage collector
> which can move memory around, meaning that objects can end up in a
> completely different location. This makes no difference to Python
> code, and there is no supported way of getting to the address of an
> object. (In fact, objects may be split over multiple locations, even
> in CPython, e.g. the new optimized implementation for dicts has shared
> storage for keys.)

You are taking the concept of "address" far too literally, and yet not
literally enough.

Even in C programs, the *physical* address of a variable/value can
change at any point without warning.

In abstract terms, an address is a reference. And that reference stays
still in both C and Python. What happens under the hood of the data
model is irrelevant.


Marko

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


Thread

list storing variables "ast" <nomail@invalid.com> - 2015-02-23 13:55 +0100
  Re: list storing variables Dave Angel <davea@davea.name> - 2015-02-23 08:24 -0500
  Re: list storing variables Marko Rauhamaa <marko@pacujo.net> - 2015-02-23 15:49 +0200
  Re: list storing variables Peter Pearson <pkpearson@nowhere.invalid> - 2015-02-23 17:35 +0000
    Re: list storing variables Marko Rauhamaa <marko@pacujo.net> - 2015-02-23 20:22 +0200
      Re: list storing variables Peter Otten <__peter__@web.de> - 2015-02-23 19:41 +0100
        Re: list storing variables Marko Rauhamaa <marko@pacujo.net> - 2015-02-23 21:06 +0200
          Re: list storing variables Chris Angelico <rosuav@gmail.com> - 2015-02-24 06:17 +1100
            Re: list storing variables Marko Rauhamaa <marko@pacujo.net> - 2015-02-23 22:25 +0200
          Re: list storing variables Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-23 12:29 -0700
            Re: list storing variables Marko Rauhamaa <marko@pacujo.net> - 2015-02-23 22:38 +0200
  Re: list storing variables Ben Finney <ben+python@benfinney.id.au> - 2015-02-24 09:03 +1100
    Re: list storing variables Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-24 13:24 +1100
      Re: list storing variables Marko Rauhamaa <marko@pacujo.net> - 2015-02-24 10:18 +0200

csiph-web