@@ -2,8 +2,8 @@ import sys
22import types
33from collections .abc import Callable , Iterator
44from opcode import * # `dis` re-exports it as a part of public API
5- from typing import IO , Any , Final , NamedTuple
6- from typing_extensions import Self , TypeAlias , disjoint_base
5+ from typing import IO , Any , Final , NamedTuple , overload
6+ from typing_extensions import Self , TypeAlias , deprecated , disjoint_base
77
88__all__ = [
99 "code_info" ,
@@ -277,7 +277,14 @@ else:
277277 def distb (tb : types .TracebackType | None = None , * , file : IO [str ] | None = None ) -> None : ...
278278
279279if sys .version_info >= (3 , 13 ):
280- # 3.13 made `show_cache` `None` by default
280+ # 3.13 made `show_caches` `None` by default and has no effect
281+ @overload
282+ def get_instructions (x : _HaveCodeType , * , first_line : int | None = None , adaptive : bool = False ) -> Iterator [Instruction ]: ...
283+ @overload
284+ @deprecated (
285+ "The `show_caches` parameter is deprecated since Python 3.13. "
286+ "The iterator generates the `Instruction` instances with the `cache_info` field populated."
287+ )
281288 def get_instructions (
282289 x : _HaveCodeType , * , first_line : int | None = None , show_caches : bool | None = None , adaptive : bool = False
283290 ) -> Iterator [Instruction ]: ...
0 commit comments