mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +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,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__}.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue