File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2076,9 +2076,17 @@ \section{Porting to Python 2.3}
20762076exists.
20772077
20782078\item Large octal and hex literals such as
2079- 0xffffffff now trigger a \exception {FutureWarning} because currently
2079+ \code { 0xffffffff} now trigger a \exception {FutureWarning}. Currently
20802080they're stored as 32-bit numbers and result in a negative value, but
2081- in Python 2.4 they'll become positive long integers.
2081+ in Python 2.4 they'll become positive long integers.
2082+
2083+ There are a few ways to fix this warning. If you really need a
2084+ positive number, just add an \samp {L} to the end of the literal. If
2085+ you're trying to get a 32-bit integer with low bits set and have
2086+ previously used an expression such as \code {~(1 << 31)}, it's probably
2087+ clearest to start with all bits set and clear the desired upper bits.
2088+ For example, to clear just the top bit (bit 31), you could write
2089+ \code {0xffffffffL {\& }{\textasciitilde }(1L<<31)}.
20822090
20832091\item You can no longer disable assertions by assigning to \code {__debug__}.
20842092
You can’t perform that action at this time.
0 commit comments