Re: [Pyobjc-dev] NSDecimalNumber to the next level
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2004-03-10 16:24:39
|
On 10-mrt-04, at 17:08, Pierce T.Wetter III wrote: >> >> I completely forgot to mention that the usual numeric operators do >> work correctly, as long as you manually convert floats to NSDecimal, >> e.g. ``NSDecimalNumber.zero() + 4`` is valid code and will do what >> you want. > > Hmmm.... That must have changed, because I submitted a change which > you accepted awhile back to not implicitly convert. Checking... > > >>> print type(Foundation.NSDecimalNumber.zero()) > <type 'float'> > > Arrgh, its converting again. That works because Python converted it > implicitly to a float. (Which is actually kind of surprising, since I > thought it had stopped doing that. See comment for (Bug #831774) in > objc/objc_support.m) You're using the wrong version of PyObjC: >>> type (Foundation.NSDecimalNumber.zero()) <objective-c class NSDecimalNumber at 0xa0a061f4> Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |