cpython/Misc
Cody Maloney 732224e113
gh-139871: Add bytearray.take_bytes([n]) to efficiently extract bytes (GH-140128)
Update `bytearray` to contain a `bytes` and provide a zero-copy path to
"extract" the `bytes`. This allows making several code paths more efficient.

This does not move any codepaths to make use of this new API. The documentation
changes include common code patterns which can be made more efficient with
this API.

---

When just changing `bytearray` to contain `bytes` I ran pyperformance on a
`--with-lto --enable-optimizations --with-static-libpython` build and don't see
any major speedups or slowdowns with this; all seems to be in the noise of
my machine (Generally changes under 5% or benchmarks that don't touch
bytes/bytearray).


Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Maurycy Pawłowski-Wieroński <5383+maurycy@users.noreply.github.com>
2025-11-13 13:19:44 +00:00
..
mypy gh-131507: Add support for syntax highlighting in PyREPL (GH-133247) 2025-05-02 20:22:31 +02:00
NEWS.d gh-139871: Add bytearray.take_bytes([n]) to efficiently extract bytes (GH-140128) 2025-11-13 13:19:44 +00:00
rhel7
ACKS gh-140443: Use fma in loghelper to improve accuracy of log for very large integers (#140469) 2025-10-23 12:05:12 -05:00
externals.spdx.json gh-140849: Update bundled liblzma to 5.8.1 on Windows (#141022) 2025-11-07 22:28:01 -08:00
HISTORY
indent.pro
platform_triplet.c
Porting
python-config.in
python-config.sh.in
python-embed.pc.in
python.man Manpage: -X gil is not related to PYTHON_HISTORY (#133753) 2025-05-09 17:11:21 +03:00
python.pc.in
README
README.AIX
README.valgrind
sbom.spdx.json gh-140120: Refresh HACL* to fix an hmac memory leak (GH-140188) 2025-10-16 05:25:51 +00:00
SpecialBuilds.txt
stable_abi.toml gh-140550: Initial implementation of PEP 793 – PyModExport (GH-140556) 2025-11-05 12:31:42 +01:00
svnmap.txt
valgrind-python.supp
vgrindefs

Python Misc subdirectory
========================

This directory contains files that wouldn't fit in elsewhere.  Some
documents are only of historic importance.

Files found here
----------------

ACKS                    Acknowledgements
HISTORY                 News from previous releases -- oldest last
indent.pro              GNU indent profile approximating my C style
NEWS                    News for this release (for some meaning of "this")
Porting                 Mini-FAQ on porting to new platforms
python-config.in        Python script template for python-config
python.man              UNIX man page for the python interpreter
python.pc.in            Package configuration info template for pkg-config
README                  The file you're reading now
README.AIX              Information about using Python on AIX
README.valgrind         Information for Valgrind users, see valgrind-python.supp
SpecialBuilds.txt       Describes extra symbols you can set for debug builds
svnmap.txt              Map of old SVN revs and branches to hg changeset ids,
                        help history-digging
valgrind-python.supp    Valgrind suppression file, see README.valgrind
vgrindefs               Python configuration for vgrind (a generic pretty printer)