Bengt Richter enlightened us with:
> Float is an immutable, so you need to override __new__
Thanks, that works!
Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let
Sybren Stuvel wrote:
> Hi all,
>
> I'm trying to make a float-like class (preferably a subclass of
> 'float') that wraps around. The background: I'm modeling a
> multi-dimensional space, and some of those dimensions are circular.
>
> Here is my code so far:
>
> class WrapFloat(float):
> def
On Sat, 17 Sep 2005 11:12:34 +0200, Sybren Stuvel <[EMAIL PROTECTED]> wrote:
>Hi all,
>
>I'm trying to make a float-like class (preferably a subclass of
>'float') that wraps around. The background: I'm modeling a
>multi-dimensional space, and some of those dimensions are circular.
>
>Here is my co
Hi all,
I'm trying to make a float-like class (preferably a subclass of
'float') that wraps around. The background: I'm modeling a
multi-dimensional space, and some of those dimensions are circular.
Here is my code so far:
class WrapFloat(float):
def __init__(self, value, wrap = None):