Moving Python and other dynamic languages to the popular rigid virtual machines should preserve Python behavior while providing access to the host language and platform capabilities.
When I used Jython a couple years ago I guess I did not stress this behavior. And so today I am a bit surprised to see the following in Jython 2.1...
>>> java.lang.Integer.MAX_VALUE
2147483647
>>> n = java.lang.Integer.MAX_VALUE
>>> n
2147483647
>>> n.__class__
CommentsOK. So the goal becomes getting Jython up to 2.4 or at least the version past CPython 2.1 where bothIt is a correct behavior. Try evaluating "
sys.maxint + 1
" on CPython 2.1...If you do "
sys.maxint + 1L
", (note "L") it works both on CPython 2.1 and Jython 2.1.End Comments
sys.maxint + 1L
and sys.maxint + 1
do the (same) right thing.
Thanks
2 comments:
It is a correct behavior. Try evaluating "sys.maxint + 1" on CPython 2.1...
If you do "sys.maxint + 1L", (note "L") it works both on CPython 2.1 and Jython 2.1.
Post a Comment