summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew/3.10.rst
diff options
context:
space:
mode:
authorNiklas Fiekas <niklas.fiekas@backscattering.de>2020-05-29 16:28:02 (GMT)
committerGitHub <noreply@github.com>2020-05-29 16:28:02 (GMT)
commit8bd216dfede9cb2d5bedb67f20a30c99844dbfb8 (patch)
tree0cae604e76e929467bba3cb1ebbec3ac8a417947 /Doc/whatsnew/3.10.rst
parent364b5ead1584583db91ef7f9d9f87f01bfbb5774 (diff)
downloadcpython-8bd216dfede9cb2d5bedb67f20a30c99844dbfb8.zip
cpython-8bd216dfede9cb2d5bedb67f20a30c99844dbfb8.tar.gz
cpython-8bd216dfede9cb2d5bedb67f20a30c99844dbfb8.tar.bz2
bpo-29882: Add an efficient popcount method for integers (#771)
* bpo-29882: Add an efficient popcount method for integers * Update 'sign bit' and versionadded in docs * Add entry to whatsnew document * Doc: use positive example, mention population count * Minor cleanups of the core code * Move popcount_digit closer to where it's used * Use z instead of self after conversion * Add 'absolute value' and 'population count' to docstring * Fix clinic error about missing summary line * Ensure popcount_digit is portable with 64-bit ints Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Diffstat (limited to 'Doc/whatsnew/3.10.rst')
-rw-r--r--Doc/whatsnew/3.10.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index 34a09fe..8a6b021 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -70,6 +70,9 @@ Summary -- Release highlights
New Features
============
+* The :class:`int` type has a new method :meth:`int.bit_count`, returning the
+ number of ones in the binary expansion of a given integer, also known
+ as the population count. (Contributed by Niklas Fiekas in :issue:`29882`.)
Other Language Changes