From: Cody Maloney Date: Fri, 28 Nov 2025 21:07:34 +0000 (-0800) Subject: Docs: Move to method references for bytearray.take_bytes (#142053) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2d2e92110751fff3cbb2ce26355af292dbcdcf6;p=thirdparty%2FPython%2Fcpython.git Docs: Move to method references for bytearray.take_bytes (#142053) --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index a87898dadf4a..8b896011734d 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -3240,7 +3240,7 @@ objects. See the :ref:`What's New ` entry for common code patterns which can be optimized with - :func:`bytearray.take_bytes`. + :meth:`bytearray.take_bytes`. Since bytearray objects are sequences of integers (akin to a list), for a bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be diff --git a/Misc/NEWS.d/3.15.0a2.rst b/Misc/NEWS.d/3.15.0a2.rst index ba439d49517a..4e3a62b0f4a7 100644 --- a/Misc/NEWS.d/3.15.0a2.rst +++ b/Misc/NEWS.d/3.15.0a2.rst @@ -1451,7 +1451,7 @@ under no memory. .. section: Core and Builtins Update :class:`bytearray` to use a :class:`bytes` under the hood as its -buffer and add :func:`bytearray.take_bytes` to take it out. +buffer and add :meth:`bytearray.take_bytes` to take it out. .. diff --git a/Misc/NEWS.d/next/Library/2025-11-22-16-33-48.gh-issue-141863.4PLhnv.rst b/Misc/NEWS.d/next/Library/2025-11-22-16-33-48.gh-issue-141863.4PLhnv.rst index 910ab98c950f..585774ba2cb6 100644 --- a/Misc/NEWS.d/next/Library/2025-11-22-16-33-48.gh-issue-141863.4PLhnv.rst +++ b/Misc/NEWS.d/next/Library/2025-11-22-16-33-48.gh-issue-141863.4PLhnv.rst @@ -1,2 +1,2 @@ -Update :ref:`asyncio-streams` to use :func:`bytearray.take_bytes` for a over +Update :ref:`asyncio-streams` to use :meth:`bytearray.take_bytes` for a over 10% performance improvement on pyperformance asyncio_tcp benchmark. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-22-54-07.gh-issue-141968.vg3AMJ.rst b/Misc/NEWS.d/next/Library/2025-11-25-22-54-07.gh-issue-141968.vg3AMJ.rst index 8492cb35d5bc..4c89902813f6 100644 --- a/Misc/NEWS.d/next/Library/2025-11-25-22-54-07.gh-issue-141968.vg3AMJ.rst +++ b/Misc/NEWS.d/next/Library/2025-11-25-22-54-07.gh-issue-141968.vg3AMJ.rst @@ -1,2 +1,2 @@ Remove a data copy from :func:`base64.b32decode` and -:func:`base64.b32encode` by using :func:`bytearray.take_bytes`. +:func:`base64.b32encode` by using :meth:`bytearray.take_bytes`. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-23-22-46.gh-issue-141968.R1sHnJ.rst b/Misc/NEWS.d/next/Library/2025-11-25-23-22-46.gh-issue-141968.R1sHnJ.rst index 16b9ad78c3cd..eca0ac4c8e60 100644 --- a/Misc/NEWS.d/next/Library/2025-11-25-23-22-46.gh-issue-141968.R1sHnJ.rst +++ b/Misc/NEWS.d/next/Library/2025-11-25-23-22-46.gh-issue-141968.R1sHnJ.rst @@ -1,2 +1,2 @@ Remove data copy from :func:`wave.Wave_read.readframes` and -:func:`wave.Wave_write.writeframes` by using :func:`bytearray.take_bytes`. +:func:`wave.Wave_write.writeframes` by using :meth:`bytearray.take_bytes`. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-23-35-07.gh-issue-141968.b3Gscp.rst b/Misc/NEWS.d/next/Library/2025-11-25-23-35-07.gh-issue-141968.b3Gscp.rst index 32658be5b2f6..50124e8b1960 100644 --- a/Misc/NEWS.d/next/Library/2025-11-25-23-35-07.gh-issue-141968.b3Gscp.rst +++ b/Misc/NEWS.d/next/Library/2025-11-25-23-35-07.gh-issue-141968.b3Gscp.rst @@ -1,2 +1,2 @@ Remove data copy from :mod:`encodings.idna` :meth:`~codecs.Codec.encode` and -:meth:`~codecs.IncrementalEncoder.encode` by using :func:`bytearray.take_bytes`. +:meth:`~codecs.IncrementalEncoder.encode` by using :meth:`bytearray.take_bytes`.