This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: new int overflow handling needs docs
Type: Stage:
Components: Documentation Versions: Python 2.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: fdrake Nosy List: facundobatista, fdrake, gvanrossum
Priority: high Keywords:

Created on 2001-08-23 03:18 by gvanrossum, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (3)
msg6142 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-08-23 03:18
Docs are needed for the new handling of overflow of
short int operations. Would you mind adding these?

This affects x+y, x-y, x*y, x/y, x%y, divmod(x, y),
x**y, pow(x, y[, z]), and -x.

The rules are as follows:

- If an int result overflows, the (new) OverflowWarning
warning is issued (with a message argument indicating
the operation, e.g. "integer addition").

- This warning is ignored by default.

- The warning can be controlled like all warnings, via
the -W command line option (use
-Wdefault::OverflowWarning to cause the warning to be
issued) or via the warnings.filterwarnings() call.

- Unless the warning is turned into an error, the
result is recomputed after converting the arguments to
long ints.

- If the warning is turned into an error, OverflowError
is substituted (for backwards compatibility).

PS. Is it documented yet that
int-to-the-negative-int-power now returns a float?

Thanks!
msg6143 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2001-08-26 01:33
Logged In: YES 
user_id=3066

Bumped priority.

No, the int-to-negative-int-power behavior has not been documented.
msg6144 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2004-11-26 00:04
Logged In: YES 
user_id=752496

The behaviour changed, there's no need of this docs.
History
Date User Action Args
2022-04-10 16:04:21adminsetgithub: 35030
2001-08-23 03:18:07gvanrossumcreate