1.1 --- a/lib/__builtins__/int.py Mon Apr 03 00:13:46 2017 +0200
1.2 +++ b/lib/__builtins__/int.py Mon Apr 03 01:36:47 2017 +0200
1.3 @@ -22,9 +22,9 @@
1.4 from __builtins__.operator import _negate
1.5 from __builtins__.unicode import utf8string
1.6 from native import get_maxint, get_minint, is_int, \
1.7 - int_add, int_and, int_div, int_eq, int_gt, int_lt, int_mod, \
1.8 - int_mul, int_ne, int_neg, int_not, int_or, int_pow, \
1.9 - int_str, int_sub, int_xor
1.10 + int_add, int_and, int_div, int_eq, int_gt, int_lshift, \
1.11 + int_lt, int_mod, int_mul, int_ne, int_neg, int_not, \
1.12 + int_or, int_pow, int_rshift, int_str, int_sub, int_xor
1.13
1.14 class int:
1.15
1.16 @@ -164,6 +164,34 @@
1.17 __or__ = __ror__ = __ior__
1.18 __xor__ = __rxor__ = __ixor__
1.19
1.20 + def __lshift__(self, other):
1.21 +
1.22 + "Return a new int left-shifted by 'other'."
1.23 +
1.24 + return self._binary_op(int_lshift, other)
1.25 +
1.26 + def __rlshift__(self, other):
1.27 +
1.28 + "Return a new int left-shifted by 'other'."
1.29 +
1.30 + return self._binary_op_rev(int_lshift, other)
1.31 +
1.32 + def __rshift__(self, other):
1.33 +
1.34 + "Return a new int right-shifted by 'other'."
1.35 +
1.36 + return self._binary_op(int_rshift, other)
1.37 +
1.38 + def __rrshift__(self, other):
1.39 +
1.40 + "Return a new int right-shifted by 'other'."
1.41 +
1.42 + return self._binary_op_rev(int_rshift, other)
1.43 +
1.44 + __ilshift__ = __lshift__
1.45 +
1.46 + __irshift__ = __rshift__
1.47 +
1.48 def __lt__(self, other):
1.49
1.50 "Return whether this int is less than 'other'."
1.51 @@ -220,13 +248,6 @@
1.52
1.53 __repr__ = __str__
1.54
1.55 - def __lshift__(self): pass
1.56 - def __rlshift__(self): pass
1.57 - def __rshift__(self): pass
1.58 - def __rrshift__(self): pass
1.59 - def __ilshift__(self): pass
1.60 - def __irshift__(self): pass
1.61 -
1.62 def __bool__(self):
1.63
1.64 "Return whether this int is non-zero."