Modifying the value of a float-like object

David Robinow drobinow at gmail.com
Tue Apr 14 17:34:17 CEST 2009


On Tue, Apr 14, 2009 at 9:03 AM,  <Eric.Le.Bigot at spectro.jussieu.fr> wrote:
> Hello,
>
> Is there a way to easily build an object that behaves exactly like a
> float, but whose value can be changed?  The goal is to maintain a list
> [x, y,…] of these float-like objects, and to modify their value on the
> fly (with something like x.value = 3.14) so that any expression like "x
> +y" uses the new value.
>
It's not clear what your requirement is.
Why can't you just use floats?
For your list, why can't you use a list of floats?
Something is missing from your explanation.



More information about the Python-list mailing list