mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 20:45:49 +08:00
[dis] Deprecate show_caches parameter in get_instructions (#15294)
This commit is contained in:
+10
-3
@@ -2,8 +2,8 @@ import sys
|
||||
import types
|
||||
from collections.abc import Callable, Iterator
|
||||
from opcode import * # `dis` re-exports it as a part of public API
|
||||
from typing import IO, Any, Final, NamedTuple
|
||||
from typing_extensions import Self, TypeAlias, disjoint_base
|
||||
from typing import IO, Any, Final, NamedTuple, overload
|
||||
from typing_extensions import Self, TypeAlias, deprecated, disjoint_base
|
||||
|
||||
__all__ = [
|
||||
"code_info",
|
||||
@@ -277,7 +277,14 @@ else:
|
||||
def distb(tb: types.TracebackType | None = None, *, file: IO[str] | None = None) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
# 3.13 made `show_cache` `None` by default
|
||||
# 3.13 made `show_caches` `None` by default and has no effect
|
||||
@overload
|
||||
def get_instructions(x: _HaveCodeType, *, first_line: int | None = None, adaptive: bool = False) -> Iterator[Instruction]: ...
|
||||
@overload
|
||||
@deprecated(
|
||||
"The `show_caches` parameter is deprecated since Python 3.13. "
|
||||
"The iterator generates the `Instruction` instances with the `cache_info` field populated."
|
||||
)
|
||||
def get_instructions(
|
||||
x: _HaveCodeType, *, first_line: int | None = None, show_caches: bool | None = None, adaptive: bool = False
|
||||
) -> Iterator[Instruction]: ...
|
||||
|
||||
Reference in New Issue
Block a user