]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-114616: Improve docs regarding changes to caches representation in dis...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 4 Jun 2024 23:15:39 +0000 (01:15 +0200)
committerGitHub <noreply@github.com>
Tue, 4 Jun 2024 23:15:39 +0000 (23:15 +0000)
gh-114616: Improve docs regarding changes to caches representation in dis (GH-120033)
(cherry picked from commit 770f3c1eadd3392c72fd55be47770234dd143a14)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Doc/library/dis.rst
Doc/whatsnew/3.13.rst

index b9e2efab827384b243f73a44da8f875ed0d8050c..ca215888f09a740da12e04a4e8c827a5df5d0903 100644 (file)
@@ -336,9 +336,10 @@ operation is being performed, so the intermediate analysis object isn't useful:
       Added the *show_caches* and *adaptive* parameters.
 
    .. versionchanged:: 3.13
-      The *show_caches* parameter is deprecated and has no effect. The *cache_info*
-      field of each instruction is populated regardless of its value.
-
+      The *show_caches* parameter is deprecated and has no effect. The iterator
+      generates the :class:`Instruction` instances with the *cache_info*
+      field populated (regardless of the value of *show_caches*) and it no longer
+      generates separate items for the cache entries.
 
 .. function:: findlinestarts(code)
 
index e655710e083bbc863b3b3b8fec5a3cc9bd7876be..b4b7cb9be527849f0c6b48078f14f22b7ba20aa0 100644 (file)
@@ -694,6 +694,13 @@ dis
   the ``show_offsets`` parameter.
   (Contributed by Irit Katriel in :gh:`112137`.)
 
+* :meth:`~dis.get_instructions` no longer represents cache entries as
+  separate instructions. Instead, it returns them as part of the
+  :class:`~dis.Instruction`, in the new *cache_info* field. The
+  *show_caches* argument to :meth:`~dis.get_instructions` is
+  deprecated and no longer has any effect.
+  (Contributed by Irit Katriel in :gh:`112962`.)
+
 .. _whatsnew313-doctest:
 
 doctest