Re: Re: Modifying the value of a float-like object

2009-04-15 Thread Dave Angel
Steven D'Aprano wrote: Oh nonsense. Many programming languages have mutable floats. That's irrelevant. Python doesn't. So introducing one will quite likely alter the OP's code's behavior. It doesn't matter if it's possible, it matters whether the existing code's behav

Re: Re: Modifying the value of a float-like object

2009-04-15 Thread Dave Angel
Steven D'Aprano wrote: On Tue, 14 Apr 2009 14:45:47 -0400, Dave Angel wrote: The answer to your original question is no. If the value can be changed, then it doesn't behave like a float. And that's not just a pedantic answer, it's a serious consideration. Oh nonsense. Many programmi

Re: Re: Modifying the value of a float-like object

2009-04-15 Thread Dave Angel
eric.le.bi...@spectro.jussieu.fr wrote: Thanks Dave for your thoughtful remarks, which you sent right when I was writing a response to the previous posts. I was wondering about a kind "mutable float"; so you're right, it's not fully a float, because it's mutable. I'd like to have an object that

Re: Re: Modifying the value of a float-like object

2009-04-14 Thread Dave Angel
eric.le.bi...@spectro.jussieu.fr wrote: It looks like what is needed here are a kind of "mutable float". Is there a simple way of creating such a type? I don't mind changing the value through x.value =.23 instead of x = 1.23... :) On Apr 14, 3:03 pm, eric.le.bi...@spectro.jussieu.fr wrote: