From 72df65ac0e47de0918be58c02d973990d2e45445 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Mon, 10 Feb 2003 15:08:16 +0000 Subject: Add Neil's suggestions for avoiding this warning --- Doc/whatsnew/whatsnew23.tex | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/whatsnew23.tex b/Doc/whatsnew/whatsnew23.tex index 941f4aa..6d75de2 100644 --- a/Doc/whatsnew/whatsnew23.tex +++ b/Doc/whatsnew/whatsnew23.tex @@ -2076,9 +2076,17 @@ wrapped with a \class{_tkinter.Tcl_Obj} object if no Python equivalent exists. \item Large octal and hex literals such as -0xffffffff now trigger a \exception{FutureWarning} because currently +\code{0xffffffff} now trigger a \exception{FutureWarning}. Currently they're stored as 32-bit numbers and result in a negative value, but -in Python 2.4 they'll become positive long integers. +in Python 2.4 they'll become positive long integers. + +There are a few ways to fix this warning. If you really need a +positive number, just add an \samp{L} to the end of the literal. If +you're trying to get a 32-bit integer with low bits set and have +previously used an expression such as \code{~(1 << 31)}, it's probably +clearest to start with all bits set and clear the desired upper bits. +For example, to clear just the top bit (bit 31), you could write +\code{0xffffffffL {\&}{\textasciitilde}(1L<<31)}. \item You can no longer disable assertions by assigning to \code{__debug__}. -- cgit v0.12