Issue2173
Created on 2014-06-23.15:20:25 by santa4nt, last changed 2014-06-23.21:14:57 by zyasoft.
msg8794 (view) |
Author: Santoso Wijaya (santa4nt) |
Date: 2014-06-23.15:20:25 |
|
Observe:
Jython 2.7b3+ (default:68cf3c217269+, Jun 23 2014, 08:17:03)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_60
Type "help", "copyright", "credits" or "license" for more information.
>>> (10).__pow__(10L)
NotImplemented
>>> (10).__add__(10L)
NotImplemented
This is caused by `canCoerce()` guards peppered throughout PyInteger method implementation, which simply test if the argument is an instance of PyInteger, which PyLong is not.
|
msg8799 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-06-23.16:07:31 |
|
Makes sense, yesterday I was seeing a somewhat related issues in terms of PyLong not playing well with PyInteger in java2py adapting.
Fortunately these are usually easy, to the point of trivial, to fix, once we have identified and started testing.
Note that is one example where CPython also doesn't get it right:
$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> (10).__add__(10L)
NotImplemented
|
msg8803 (view) |
Author: Santoso Wijaya (santa4nt) |
Date: 2014-06-23.17:17:12 |
|
Oh. By design, I guess.
|
msg8804 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-06-23.17:50:09 |
|
I think it's just an oversight in CPython 2.7. Clearly code like (10).__add__(10L) is not likely to be written by the average user, and while a lot of tests in core Python are good about not just looking at "average user" tests, they do occasionally miss things like this.
|
msg8808 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2014-06-23.18:36:09 |
|
Indeed by design so I wouldn't consider this not a bug/wontfix. 10 + 10L still works of course because it defers to 10L.__radd__(10)
|
msg8809 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2014-06-23.18:36:41 |
|
er I meant I wouldn't consider this a bug: it's not a bug/wontfix =]
|
msg8811 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-06-23.21:14:57 |
|
Sounds good, closing out
|
|
Date |
User |
Action |
Args |
2014-06-23 21:14:57 | zyasoft | set | status: open -> closed resolution: wont fix messages:
+ msg8811 |
2014-06-23 18:36:41 | pjenvey | set | messages:
+ msg8809 |
2014-06-23 18:36:10 | pjenvey | set | nosy:
+ pjenvey messages:
+ msg8808 |
2014-06-23 17:50:09 | zyasoft | set | messages:
+ msg8804 |
2014-06-23 17:17:13 | santa4nt | set | messages:
+ msg8803 |
2014-06-23 16:07:31 | zyasoft | set | nosy:
+ zyasoft messages:
+ msg8799 |
2014-06-23 15:20:25 | santa4nt | create | |
|