Index: src/org/python/core/PyLong.java =================================================================== --- src/org/python/core/PyLong.java (revision 2972) +++ src/org/python/core/PyLong.java (working copy) @@ -1886,6 +1886,10 @@ } + public int asInt(int index) { + return (int) getLong(Integer.MIN_VALUE, Integer.MAX_VALUE); + } + public boolean isMappingType() { return false; } public boolean isSequenceType() { return false; } Index: src/org/python/core/PyInteger.java =================================================================== --- src/org/python/core/PyInteger.java (revision 2972) +++ src/org/python/core/PyInteger.java (working copy) @@ -1637,8 +1637,16 @@ } public PyObject __lshift__(PyObject right) { - return int___lshift__(right); - } + PyObject ret; + if (right instanceof PyLong) { + PyObject lg = new PyLong(getValue()); + ret = lg.__lshift__(right); + } + else { + ret = int___lshift__(right); + } + return ret; + } final PyObject int___lshift__(PyObject right) { int rightv; @@ -1655,7 +1663,15 @@ } public PyObject __rshift__(PyObject right) { - return int___rshift__(right); + PyObject ret; + if (right instanceof PyLong) { + PyObject lg = new PyLong(getValue()); + ret = lg.__rshift__(right); + } + else { + ret = int___rshift__(right); + } + return ret; } final PyObject int___rshift__(PyObject right) {