AT2k Design BBS Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages!

You are not logged in. Login here for full access privileges.

Previous Message | Next Message | Back to Computer Support/Help/Discussion...  <--  <--- Return to Home Page
   Networked Database  Computer Support/Help/Discussion...   [1576 / 2000] RSS
 From   To   Subject   Date/Time 
Message   LWN.net    All   [$] The troubles with Boolean inversion in Python   February 28, 2026
 6:40 AM *  

The Python bitwise-inversion (or complement) operator, "~", behaves
pretty much as expected when it is applied to integers-it toggles every
bit, from one
to zero and vice versa.  It might be expected that applying the
operator to a non-integer, a bool
for example, would raise a TypeError, but, because the
bool type is really an int
in disguise, the complement operator is allowed, at least for now.  For
nearly 15�years (and perhaps longer), there have been discussions about the
oddity of that behavior and whether it should be changed.  Eventually,
that resulted in the "feature" being deprecated, producing a warning, with
removal slated for
Python�3.16 (due October 2027). That has led to some reconsideration and the
deprecation may itself be deprecated.

https://lwn.net/Articles/1059177/
--- SBBSecho 3.37-Linux
 * Origin: Palantir * palantirbbs.ddns.net * Pensacola, FL * (618:250/24)
  Show ANSI Codes | Hide BBCodes | Show Color Codes | Hide Encoding | Hide HTML Tags | Show Routing
Previous Message | Next Message | Back to Computer Support/Help/Discussion...  <--  <--- Return to Home Page

VADV-PHP
Execution Time: 0.0173 seconds

If you experience any problems with this website or need help, contact the webmaster.
VADV-PHP Copyright © 2002-2026 Steve Winn, Aspect Technologies. All Rights Reserved.
Virtual Advanced Copyright © 1995-1997 Roland De Graaf.
v2.1.250224