Issue1197
Created on 2008-12-10.04:55:02 by pjenvey, last changed 2009-04-06.01:41:14 by pjenvey.
msg3899 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2008-12-10.04:55:01 |
|
Our binop methods return null to signal the binop "doesn't support the
operation -- try alternatives". When we expose them as binary ops, those
nulls are translated into Py.NotImplemented
The binop fast path looks for nulls, the slow path (_binop_rule) uses
the exposed methods and looks for Py.NotImplemented
PyInstance still does not use exposed annotations, provides binops for
all ops, and they all return null. This breaks _binop_rule:
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 Foo: pass
...
>>> class Bar(object):
... def __radd__(self, other):
... return 3
...
>>> print Foo() + Bar()
None
(We at least got a None, instead of null, because it went through the
exposed version -- which is the Java integration version)
i.e.
>>> # should return NotImplemented
>>> print types.InstanceType.__add__(Foo(), Bar())
None
We either need to expose PyInstance (a bunch more generated .classes) or
think of another workaround
|
msg3900 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2008-12-10.04:55:54 |
|
This is the cause of at least one SymPy test failure:
__________ sympy/mpmath/tests/test_convert.py:test_conversion_methods
__________
File "/home/ondra/repos/sympy/sympy/mpmath/tests/test_convert.py",
line 112, in test_conversion_methods
assert (y+x).ae(mpf('4.3'))
AttributeError: 'NoneType' object has no attribute 'ae'
|
msg4452 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2009-04-06.01:41:13 |
|
fixed in r6172 by converting PyInstance to exposed annotations
This added like 350KB of exposed descriptor bytecode =[ half of which are
binops. oh well
|
|
Date |
User |
Action |
Args |
2009-04-06 01:41:14 | pjenvey | set | status: open -> closed resolution: fixed messages:
+ msg4452 |
2009-04-04 02:42:15 | pjenvey | set | priority: normal -> high |
2009-03-14 14:26:00 | fwierzbicki | set | priority: normal |
2009-03-08 07:20:06 | zyasoft | set | nosy:
+ zyasoft |
2008-12-10 05:16:32 | pjenvey | set | components:
+ Core |
2008-12-10 04:55:54 | pjenvey | set | messages:
+ msg3900 |
2008-12-10 04:55:02 | pjenvey | create | |
|