From: Mark Dickinson Date: Tue, 6 Apr 2010 18:20:11 +0000 (+0000) Subject: Issue #8259: Clarify that there's an upper bound on the right-hand operand of a shift... X-Git-Tag: v2.7b1~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5db4310f312727b49f5ea5d32e575be6b91bdf8;p=python Issue #8259: Clarify that there's an upper bound on the right-hand operand of a shift operator. --- diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 4677fdc85b..60ab6ea672 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1000,6 +1000,9 @@ A right shift by *n* bits is defined as division by ``pow(2, n)``. A left shift by *n* bits is defined as multiplication with ``pow(2, n)``. Negative shift counts raise a :exc:`ValueError` exception. +.. note:: In the current implementation, the right-hand operand is required + to be at most :attr:`sys.maxsize`. If the right-hand operand is larger than + :attr:`sys.maxsize` an :exc:`OverflowError` exception is raised. .. _bitwise: