mirror of
https://github.com/python/cpython.git
synced 2025-11-11 22:55:08 +00:00
Add Neil's suggestions for avoiding this warning
This commit is contained in:
parent
2c646c9fc1
commit
72df65ac0e
1 changed files with 10 additions and 2 deletions
|
|
@ -2076,10 +2076,18 @@ wrapped with a \class{_tkinter.Tcl_Obj} object if no Python equivalent
|
||||||
exists.
|
exists.
|
||||||
|
|
||||||
\item Large octal and hex literals such as
|
\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
|
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__}.
|
\item You can no longer disable assertions by assigning to \code{__debug__}.
|
||||||
|
|
||||||
\item The Distutils \function{setup()} function has gained various new
|
\item The Distutils \function{setup()} function has gained various new
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue