Message3901
Java integration's py2float doesn't consider __float__ for conversion.
This is an issue with other conversions (py2int, etc) and likely affects
more than the math module
Jython 2.5b0+ (trunk:5722:5725M, Dec 9 2008, 16:06:58)
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_07
Type "help", "copyright", "credits" or "license" for more information.
>>> class F(object):
... def __float__(self):
... return 1.6
...
>>> import math
>>> math.cos(F())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cos(): 1st arg can't be coerced to double
Python 2.5.2 (r252:60911, Apr 22 2008, 12:00:45)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class F(object):
... def __float__(self):
... return 1.6
...
>>> import math
>>> math.cos(F())
-0.029199522301288815 |
|
Date |
User |
Action |
Args |
2008-12-10 05:16:10 | pjenvey | set | recipients:
+ pjenvey |
2008-12-10 05:16:10 | pjenvey | set | messageid: <1228886170.16.0.479575251288.issue1198@psf.upfronthosting.co.za> |
2008-12-10 05:16:10 | pjenvey | link | issue1198 messages |
2008-12-10 05:16:09 | pjenvey | create | |
|