Message3899
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 |
|
Date |
User |
Action |
Args |
2008-12-10 04:55:03 | pjenvey | set | recipients:
+ pjenvey |
2008-12-10 04:55:02 | pjenvey | set | messageid: <1228884902.74.0.194324834784.issue1197@psf.upfronthosting.co.za> |
2008-12-10 04:55:02 | pjenvey | link | issue1197 messages |
2008-12-10 04:55:01 | pjenvey | create | |
|