[Python-bugs-list] [ python-Bugs-454446 ] new int overflow handling needs docs

noreply@sourceforge.net noreply@sourceforge.net
Sat, 25 Aug 2001 18:33:34 -0700


Bugs item #454446, was opened at 2001-08-22 20:18
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454446&group_id=5470

Category: Documentation
Group: Python 2.2
Status: Open
Resolution: None
>Priority: 6
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: new int overflow handling needs docs

Initial Comment:
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!

----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-08-25 18:33

Message:
Logged In: YES 
user_id=3066

Bumped priority.

No, the int-to-negative-int-power behavior has not been documented.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454446&group_id=5470