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


Groups > comp.lang.python > #16883

Re: tracking variable value changes

References <jbr607$eer$1@news.jpl.nasa.gov> <CALwzidkfbtYVyBvEYrs8B-CcYyJsMp6R-zLLLnZRAtkbMnz4Yw@mail.gmail.com>
Date 2011-12-08 22:10 +0000
Subject Re: tracking variable value changes
From Arnaud Delobelle <arnodel@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3457.1323382205.27778.python-list@python.org> (permalink)

Show all headers | View raw


On 8 December 2011 21:50, Ian Kelly <ian.g.kelly@gmail.com> wrote:

> You can get the same effect with a float by putting it in a container
> object and binding both variables to the same container objects rather
> than to the float directly.  Then, to change the value, change the
> contents of the container object.  What you use as a container object
> is up to you.  Some use a 1-element list, although I find that ugly.

This kind of trick is not often necessary anyway.  It may be a sign
that there is a better approach to the problem that the OP is trying
to solve.

-- 
Arnaud

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


Thread

tracking variable value changes Catherine Moroney <Catherine.M.Moroney@jpl.nasa.gov> - 2011-12-08 12:17 -0800
  Re: tracking variable value changes Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-08 14:50 -0700
  Re: tracking variable value changes Ben Finney <ben+python@benfinney.id.au> - 2011-12-09 09:06 +1100
  Re: tracking variable value changes Arnaud Delobelle <arnodel@gmail.com> - 2011-12-08 22:10 +0000
  Re: tracking variable value changes Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-12-09 12:43 +0000
    Re: tracking variable value changes alex23 <wuwei23@gmail.com> - 2011-12-11 21:45 -0800
  Re: tracking variable value changes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-10 00:41 +0000

csiph-web