[stdlib] Copy-edit deprecation messages (#14614)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Semyon Moroz
2025-08-21 11:12:00 +00:00
committed by GitHub
parent 9bb8c4f1f9
commit 5e0d6ee95e
28 changed files with 191 additions and 120 deletions
+5 -4
View File
@@ -37,7 +37,7 @@ def spec_from_file_location(
submodule_search_locations: list[str] | None = ...,
) -> importlib.machinery.ModuleSpec | None: ...
@deprecated(
"Deprecated as of Python 3.6: Use site configuration instead. "
"Deprecated since Python 3.6. Use site configuration instead. "
"Future versions of Python may not enable this finder by default."
)
class WindowsRegistryFinder(importlib.abc.MetaPathFinder):
@@ -155,7 +155,7 @@ if sys.version_info >= (3, 11):
def get_code(self, fullname: str) -> types.CodeType: ...
def create_module(self, spec: ModuleSpec) -> None: ...
def exec_module(self, module: types.ModuleType) -> None: ...
@deprecated("load_module() is deprecated; use exec_module() instead")
@deprecated("Deprecated since Python 3.10; will be removed in Python 3.15. Use `exec_module()` instead.")
def load_module(self, fullname: str) -> types.ModuleType: ...
def get_resource_reader(self, module: types.ModuleType) -> importlib.readers.NamespaceReader: ...
if sys.version_info < (3, 12):
@@ -177,9 +177,9 @@ else:
def get_code(self, fullname: str) -> types.CodeType: ...
def create_module(self, spec: ModuleSpec) -> None: ...
def exec_module(self, module: types.ModuleType) -> None: ...
@deprecated("load_module() is deprecated; use exec_module() instead")
def load_module(self, fullname: str) -> types.ModuleType: ...
if sys.version_info >= (3, 10):
@deprecated("Deprecated since Python 3.10; will be removed in Python 3.15. Use `exec_module()` instead.")
def load_module(self, fullname: str) -> types.ModuleType: ...
@staticmethod
@deprecated(
"Deprecated since Python 3.4; removed in Python 3.12. "
@@ -188,6 +188,7 @@ else:
def module_repr(module: types.ModuleType) -> str: ...
def get_resource_reader(self, module: types.ModuleType) -> importlib.readers.NamespaceReader: ...
else:
def load_module(self, fullname: str) -> types.ModuleType: ...
@classmethod
@deprecated(
"Deprecated since Python 3.4; removed in Python 3.12. "
+3 -3
View File
@@ -28,17 +28,17 @@ class ABCMeta(type):
def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ...
def abstractmethod(funcobj: _FuncT) -> _FuncT: ...
@deprecated("Use 'classmethod' with 'abstractmethod' instead")
@deprecated("Deprecated since Python 3.3. Use `@classmethod` stacked on top of `@abstractmethod` instead.")
class abstractclassmethod(classmethod[_T, _P, _R_co]):
__isabstractmethod__: Literal[True]
def __init__(self, callable: Callable[Concatenate[type[_T], _P], _R_co]) -> None: ...
@deprecated("Use 'staticmethod' with 'abstractmethod' instead")
@deprecated("Deprecated since Python 3.3. Use `@staticmethod` stacked on top of `@abstractmethod` instead.")
class abstractstaticmethod(staticmethod[_P, _R_co]):
__isabstractmethod__: Literal[True]
def __init__(self, callable: Callable[_P, _R_co]) -> None: ...
@deprecated("Use 'property' with 'abstractmethod' instead")
@deprecated("Deprecated since Python 3.3. Use `@property` stacked on top of `@abstractmethod` instead.")
class abstractproperty(property):
__isabstractmethod__: Literal[True]
+1 -1
View File
@@ -64,7 +64,7 @@ if sys.version_info >= (3, 14):
owner: object = None,
format: Format = Format.VALUE, # noqa: Y011
) -> AnnotationForm: ...
@deprecated("Use ForwardRef.evaluate() or typing.evaluate_forward_ref() instead.")
@deprecated("Use `ForwardRef.evaluate()` or `typing.evaluate_forward_ref()` instead.")
def _evaluate(
self,
globalns: dict[str, Any] | None,
+1 -1
View File
@@ -468,7 +468,7 @@ class Namespace(_AttributeHolder):
__hash__: ClassVar[None] # type: ignore[assignment]
if sys.version_info >= (3, 14):
@deprecated("Deprecated in Python 3.14; Simply open files after parsing arguments")
@deprecated("Deprecated since Python 3.14. Open files after parsing arguments instead.")
class FileType:
# undocumented
_mode: str
+15 -15
View File
@@ -1098,16 +1098,16 @@ class Constant(expr):
if sys.version_info < (3, 14):
# Aliases for value, for backwards compatibility
@property
@deprecated("Will be removed in Python 3.14. Use `value` instead.")
@deprecated("Removed in Python 3.14. Use `value` instead.")
def n(self) -> _ConstantValue: ...
@n.setter
@deprecated("Will be removed in Python 3.14. Use `value` instead.")
@deprecated("Removed in Python 3.14. Use `value` instead.")
def n(self, value: _ConstantValue) -> None: ...
@property
@deprecated("Will be removed in Python 3.14. Use `value` instead.")
@deprecated("Removed in Python 3.14. Use `value` instead.")
def s(self) -> _ConstantValue: ...
@s.setter
@deprecated("Will be removed in Python 3.14. Use `value` instead.")
@deprecated("Removed in Python 3.14. Use `value` instead.")
def s(self, value: _ConstantValue) -> None: ...
def __init__(self, value: _ConstantValue, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
@@ -1206,7 +1206,7 @@ class Slice(expr):
self, *, lower: expr | None = ..., upper: expr | None = ..., step: expr | None = ..., **kwargs: Unpack[_Attributes]
) -> Self: ...
@deprecated("Deprecated since Python 3.9. Use ast.Tuple instead.")
@deprecated("Deprecated since Python 3.9. Use `ast.Tuple` instead.")
class ExtSlice(slice):
def __new__(cls, dims: Iterable[slice] = (), **kwargs: Unpack[_Attributes]) -> Tuple: ... # type: ignore[misc]
@@ -1711,23 +1711,23 @@ else:
def __init__(cls, *args: Unused) -> None: ...
if sys.version_info < (3, 14):
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `ast.Constant` instead.")
class Num(Constant, metaclass=_ABC):
def __new__(cls, n: complex, **kwargs: Unpack[_Attributes]) -> Constant: ... # type: ignore[misc] # pyright: ignore[reportInconsistentConstructor]
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `ast.Constant` instead.")
class Str(Constant, metaclass=_ABC):
def __new__(cls, s: str, **kwargs: Unpack[_Attributes]) -> Constant: ... # type: ignore[misc] # pyright: ignore[reportInconsistentConstructor]
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `ast.Constant` instead.")
class Bytes(Constant, metaclass=_ABC):
def __new__(cls, s: bytes, **kwargs: Unpack[_Attributes]) -> Constant: ... # type: ignore[misc] # pyright: ignore[reportInconsistentConstructor]
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `ast.Constant` instead.")
class NameConstant(Constant, metaclass=_ABC):
def __new__(cls, value: _ConstantValue, kind: str | None, **kwargs: Unpack[_Attributes]) -> Constant: ... # type: ignore[misc] # pyright: ignore[reportInconsistentConstructor]
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `ast.Constant` instead.")
class Ellipsis(Constant, metaclass=_ABC):
def __new__(cls, **kwargs: Unpack[_Attributes]) -> Constant: ... # type: ignore[misc] # pyright: ignore[reportInconsistentConstructor]
@@ -2046,15 +2046,15 @@ class NodeVisitor:
def visit_Param(self, node: Param) -> Any: ...
if sys.version_info < (3, 14):
@deprecated("Replaced by visit_Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `visit_Constant` instead.")
def visit_Num(self, node: Num) -> Any: ... # type: ignore[deprecated]
@deprecated("Replaced by visit_Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `visit_Constant` instead.")
def visit_Str(self, node: Str) -> Any: ... # type: ignore[deprecated]
@deprecated("Replaced by visit_Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `visit_Constant` instead.")
def visit_Bytes(self, node: Bytes) -> Any: ... # type: ignore[deprecated]
@deprecated("Replaced by visit_Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `visit_Constant` instead.")
def visit_NameConstant(self, node: NameConstant) -> Any: ... # type: ignore[deprecated]
@deprecated("Replaced by visit_Constant; removed in Python 3.14")
@deprecated("Removed in Python 3.14. Use `visit_Constant` instead.")
def visit_Ellipsis(self, node: Ellipsis) -> Any: ... # type: ignore[deprecated]
class NodeTransformer(NodeVisitor):
+6 -6
View File
@@ -614,10 +614,10 @@ class _AbstractEventLoopPolicy:
if sys.version_info < (3, 14):
if sys.version_info >= (3, 12):
@abstractmethod
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def get_child_watcher(self) -> AbstractChildWatcher: ...
@abstractmethod
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
else:
@abstractmethod
@@ -643,9 +643,9 @@ else:
if sys.version_info >= (3, 14):
def _get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
def _set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...
@deprecated("Deprecated as of Python 3.14; will be removed in Python 3.16")
@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
def get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
@deprecated("Deprecated as of Python 3.14; will be removed in Python 3.16")
@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
def set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...
else:
@@ -657,9 +657,9 @@ def new_event_loop() -> AbstractEventLoop: ...
if sys.version_info < (3, 14):
if sys.version_info >= (3, 12):
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def get_child_watcher() -> AbstractChildWatcher: ...
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
else:
+6 -6
View File
@@ -48,7 +48,7 @@ if sys.platform != "win32":
# So, it is special cased.
if sys.version_info < (3, 14):
if sys.version_info >= (3, 12):
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
class AbstractChildWatcher:
@abstractmethod
def add_child_handler(
@@ -100,7 +100,7 @@ if sys.platform != "win32":
def is_active(self) -> bool: ...
def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ...
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
class SafeChildWatcher(BaseChildWatcher):
def __enter__(self) -> Self: ...
def __exit__(
@@ -111,7 +111,7 @@ if sys.platform != "win32":
) -> None: ...
def remove_child_handler(self, pid: int) -> bool: ...
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
class FastChildWatcher(BaseChildWatcher):
def __enter__(self) -> Self: ...
def __exit__(
@@ -171,9 +171,9 @@ if sys.platform != "win32":
else:
class _UnixDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
if sys.version_info >= (3, 12):
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def get_child_watcher(self) -> AbstractChildWatcher: ...
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
else:
def get_child_watcher(self) -> AbstractChildWatcher: ...
@@ -191,7 +191,7 @@ if sys.platform != "win32":
if sys.version_info < (3, 14):
if sys.version_info >= (3, 12):
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
class MultiLoopChildWatcher(AbstractChildWatcher):
def is_active(self) -> bool: ...
def close(self) -> None: ...
+8 -2
View File
@@ -162,8 +162,14 @@ def create_string_buffer(init: int | bytes, size: int | None = None) -> Array[c_
c_buffer = create_string_buffer
def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ...
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
else:
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
def ARRAY(typ: _CT, len: int) -> Array[_CT]: ... # Soft Deprecated, no plans to remove
if sys.platform == "win32":
+6 -2
View File
@@ -10,9 +10,13 @@ if sys.version_info >= (3, 13):
__all__ += ["translate"]
if sys.version_info >= (3, 10):
@deprecated("Will be removed in Python 3.15; Use `glob.glob` and pass *root_dir* argument instead.")
@deprecated(
"Deprecated since Python 3.10; will be removed in Python 3.15. Use `glob.glob()` with the *root_dir* argument instead."
)
def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
@deprecated("Will be removed in Python 3.15; Use `glob.glob` and pass *root_dir* argument instead.")
@deprecated(
"Deprecated since Python 3.10; will be removed in Python 3.15. Use `glob.glob()` with the *root_dir* argument instead."
)
def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
else:
+21 -9
View File
@@ -119,12 +119,24 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def guess_type(self, path: StrPath) -> str: ... # undocumented
def executable(path: StrPath) -> bool: ... # undocumented
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
cgi_directories: list[str]
have_fork: bool # undocumented
def do_POST(self) -> None: ...
def is_cgi(self) -> bool: ... # undocumented
def is_executable(self, path: StrPath) -> bool: ... # undocumented
def is_python(self, path: StrPath) -> bool: ... # undocumented
def run_cgi(self) -> None: ... # undocumented
if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
cgi_directories: list[str]
have_fork: bool # undocumented
def do_POST(self) -> None: ...
def is_cgi(self) -> bool: ... # undocumented
def is_executable(self, path: StrPath) -> bool: ... # undocumented
def is_python(self, path: StrPath) -> bool: ... # undocumented
def run_cgi(self) -> None: ... # undocumented
else:
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
cgi_directories: list[str]
have_fork: bool # undocumented
def do_POST(self) -> None: ...
def is_cgi(self) -> bool: ... # undocumented
def is_executable(self, path: StrPath) -> bool: ... # undocumented
def is_python(self, path: StrPath) -> bool: ... # undocumented
def run_cgi(self) -> None: ... # undocumented
+2 -2
View File
@@ -40,7 +40,7 @@ if sys.version_info < (3, 12):
@deprecated("Deprecated since Python 3.3; removed in Python 3.12. Use `MetaPathFinder` or `PathEntryFinder` instead.")
class Finder(metaclass=ABCMeta): ...
@deprecated("Deprecated as of Python 3.7: Use importlib.resources.abc.TraversableResources instead.")
@deprecated("Deprecated since Python 3.7. Use `importlib.resources.abc.TraversableResources` instead.")
class ResourceLoader(Loader):
@abstractmethod
def get_data(self, path: str) -> bytes: ...
@@ -61,7 +61,7 @@ class ExecutionLoader(InspectLoader):
def get_filename(self, fullname: str) -> str: ...
class SourceLoader(_bootstrap_external.SourceLoader, ResourceLoader, ExecutionLoader, metaclass=ABCMeta): # type: ignore[misc] # incompatible definitions of source_to_code in the base classes
@deprecated("Deprecated as of Python 3.3: Use importlib.resources.abc.SourceLoader.path_stats instead.")
@deprecated("Deprecated since Python 3.3. Use `importlib.resources.abc.SourceLoader.path_stats` instead.")
def path_mtime(self, path: str) -> float: ...
def set_data(self, path: str, data: bytes) -> None: ...
def get_source(self, fullname: str) -> str | None: ...
+3 -3
View File
@@ -155,7 +155,7 @@ class Logger(Filterer):
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
) -> None: ...
@deprecated("Deprecated; use warning() instead.")
@deprecated("Deprecated since Python 3.3. Use `Logger.warning()` instead.")
def warn(
self,
msg: object,
@@ -409,7 +409,7 @@ class LoggerAdapter(Generic[_L]):
extra: Mapping[str, object] | None = None,
**kwargs: object,
) -> None: ...
@deprecated("Deprecated; use warning() instead.")
@deprecated("Deprecated since Python 3.3. Use `LoggerAdapter.warning()` instead.")
def warn(
self,
msg: object,
@@ -519,7 +519,7 @@ def warning(
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
) -> None: ...
@deprecated("Deprecated; use warning() instead.")
@deprecated("Deprecated since Python 3.3. Use `warning()` instead.")
def warn(
msg: object,
*args: object,
+2 -2
View File
@@ -2,9 +2,9 @@ import sys
from typing_extensions import deprecated
if sys.version_info >= (3, 14):
@deprecated("nturl2path module was deprecated since Python 3.14")
@deprecated("The `nturl2path` module is deprecated since Python 3.14.")
def url2pathname(url: str) -> str: ...
@deprecated("nturl2path module was deprecated since Python 3.14")
@deprecated("The `nturl2path` module is deprecated since Python 3.14.")
def pathname2url(p: str) -> str: ...
else:
+3 -3
View File
@@ -34,11 +34,11 @@ def visiblename(name: str, all: Container[str] | None = None, obj: object = None
def classify_class_attrs(object: object) -> list[tuple[str, str, type, str]]: ...
if sys.version_info >= (3, 13):
@deprecated("Deprecated in Python 3.13.")
def ispackage(path: str) -> bool: ...
@deprecated("Deprecated since Python 3.13.")
def ispackage(path: str) -> bool: ... # undocumented
else:
def ispackage(path: str) -> bool: ...
def ispackage(path: str) -> bool: ... # undocumented
def source_synopsis(file: IO[AnyStr]) -> AnyStr | None: ...
def synopsis(filename: str, cache: MutableMapping[str, tuple[int, str]] = {}) -> str | None: ...
+2 -2
View File
@@ -81,7 +81,7 @@ class SSLCertVerificationError(SSLError, ValueError):
CertificateError = SSLCertVerificationError
if sys.version_info < (3, 12):
@deprecated("Deprecated since Python 3.7. Removed in Python 3.12. Use `SSLContext.wrap_socket()` instead.")
@deprecated("Deprecated since Python 3.7; removed in Python 3.12. Use `SSLContext.wrap_socket()` instead.")
def wrap_socket(
sock: socket.socket,
keyfile: StrOrBytesPath | None = None,
@@ -94,7 +94,7 @@ if sys.version_info < (3, 12):
suppress_ragged_eofs: bool = True,
ciphers: str | None = None,
) -> SSLSocket: ...
@deprecated("Deprecated since Python 3.7. Removed in Python 3.12.")
@deprecated("Deprecated since Python 3.7; removed in Python 3.12.")
def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ...
def cert_time_to_seconds(cert_time: str) -> int: ...
+5 -2
View File
@@ -49,8 +49,11 @@ class Function(SymbolTable):
def get_nonlocals(self) -> tuple[str, ...]: ...
class Class(SymbolTable):
@deprecated("deprecated in Python 3.14, will be removed in Python 3.16")
def get_methods(self) -> tuple[str, ...]: ...
if sys.version_info >= (3, 14):
@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
def get_methods(self) -> tuple[str, ...]: ...
else:
def get_methods(self) -> tuple[str, ...]: ...
class Symbol:
def __init__(
+1 -1
View File
@@ -345,7 +345,7 @@ version_info: _version_info
def call_tracing(func: Callable[..., _T], args: Any, /) -> _T: ...
if sys.version_info >= (3, 13):
@deprecated("Deprecated in Python 3.13; use _clear_internal_caches() instead.")
@deprecated("Deprecated since Python 3.13. Use `_clear_internal_caches()` instead.")
def _clear_type_cache() -> None: ...
else:
+1 -1
View File
@@ -46,7 +46,7 @@ class _events:
BRANCH_TAKEN: Final[int]
@property
@deprecated("BRANCH is deprecated; use BRANCH_LEFT or BRANCH_TAKEN instead")
@deprecated("Deprecated since Python 3.14. Use `BRANCH_LEFT` or `BRANCH_TAKEN` instead.")
def BRANCH(self) -> int: ...
else:
+2 -2
View File
@@ -765,10 +765,10 @@ class TarInfo:
def __init__(self, name: str = "") -> None: ...
if sys.version_info >= (3, 13):
@property
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.16")
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.16.")
def tarfile(self) -> TarFile | None: ...
@tarfile.setter
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.16")
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.16.")
def tarfile(self, tarfile: TarFile | None) -> None: ...
else:
tarfile: TarFile | None
+8 -8
View File
@@ -46,10 +46,10 @@ if sys.version_info >= (3, 12):
_profile_hook: ProfileFunction | None
def active_count() -> int: ...
@deprecated("Use active_count() instead")
@deprecated("Deprecated since Python 3.10. Use `active_count()` instead.")
def activeCount() -> int: ...
def current_thread() -> Thread: ...
@deprecated("Use current_thread() instead")
@deprecated("Deprecated since Python 3.10. Use `current_thread()` instead.")
def currentThread() -> Thread: ...
def get_ident() -> int: ...
def enumerate() -> list[Thread]: ...
@@ -107,13 +107,13 @@ class Thread:
@property
def native_id(self) -> int | None: ... # only available on some platforms
def is_alive(self) -> bool: ...
@deprecated("Get the daemon attribute instead")
@deprecated("Deprecated since Python 3.10. Read the `daemon` attribute instead.")
def isDaemon(self) -> bool: ...
@deprecated("Set the daemon attribute instead")
@deprecated("Deprecated since Python 3.10. Set the `daemon` attribute instead.")
def setDaemon(self, daemonic: bool) -> None: ...
@deprecated("Use the name attribute instead")
@deprecated("Deprecated since Python 3.10. Read the `name` attribute instead.")
def getName(self) -> str: ...
@deprecated("Use the name attribute instead")
@deprecated("Deprecated since Python 3.10. Set the `name` attribute instead.")
def setName(self, name: str) -> None: ...
class _DummyThread(Thread):
@@ -148,7 +148,7 @@ class Condition:
def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ...
def notify(self, n: int = 1) -> None: ...
def notify_all(self) -> None: ...
@deprecated("Use notify_all() instead")
@deprecated("Deprecated since Python 3.10. Use `notify_all()` instead.")
def notifyAll(self) -> None: ...
class Semaphore:
@@ -163,7 +163,7 @@ class BoundedSemaphore(Semaphore): ...
class Event:
def is_set(self) -> bool: ...
@deprecated("Use is_set() instead")
@deprecated("Deprecated since Python 3.10. Use `is_set()` instead.")
def isSet(self) -> bool: ...
def set(self) -> None: ...
def clear(self) -> None: ...
+15 -8
View File
@@ -321,14 +321,21 @@ class Variable:
def trace_add(self, mode: Literal["array", "read", "write", "unset"], callback: Callable[[str, str, str], object]) -> str: ...
def trace_remove(self, mode: Literal["array", "read", "write", "unset"], cbname: str) -> None: ...
def trace_info(self) -> list[tuple[tuple[Literal["array", "read", "write", "unset"], ...], str]]: ...
@deprecated("use trace_add() instead of trace()")
def trace(self, mode, callback): ...
@deprecated("use trace_add() instead of trace_variable()")
def trace_variable(self, mode, callback): ...
@deprecated("use trace_remove() instead of trace_vdelete()")
def trace_vdelete(self, mode, cbname) -> None: ...
@deprecated("use trace_info() instead of trace_vinfo()")
def trace_vinfo(self): ...
if sys.version_info >= (3, 14):
@deprecated("Deprecated since Python 3.14. Use `trace_add()` instead.")
def trace(self, mode, callback) -> str: ...
@deprecated("Deprecated since Python 3.14. Use `trace_add()` instead.")
def trace_variable(self, mode, callback) -> str: ...
@deprecated("Deprecated since Python 3.14. Use `trace_remove()` instead.")
def trace_vdelete(self, mode, cbname) -> None: ...
@deprecated("Deprecated since Python 3.14. Use `trace_info()` instead.")
def trace_vinfo(self): ...
else:
def trace(self, mode, callback) -> str: ...
def trace_variable(self, mode, callback) -> str: ...
def trace_vdelete(self, mode, cbname) -> None: ...
def trace_vinfo(self): ...
def __eq__(self, other: object) -> bool: ...
def __del__(self) -> None: ...
__hash__: ClassVar[None] # type: ignore[assignment]
+1 -1
View File
@@ -16,7 +16,7 @@ if sys.version_info >= (3, 14):
@overload
def __init__(self, msg: str, doc: str, pos: int) -> None: ...
@overload
@deprecated("Deprecated in Python 3.14; Please set 'msg', 'doc' and 'pos' arguments only.")
@deprecated("Deprecated since Python 3.14. Set the 'msg', 'doc' and 'pos' arguments only.")
def __init__(self, msg: str | type = ..., doc: str | type = ..., pos: int | type = ..., *args: Any) -> None: ...
else:
+1 -1
View File
@@ -138,7 +138,7 @@ class TracebackException:
@property
def exc_type_str(self) -> str: ...
@property
@deprecated("Deprecated in 3.13. Use exc_type_str instead.")
@deprecated("Deprecated since Python 3.13. Use `exc_type_str` instead.")
def exc_type(self) -> type[BaseException] | None: ...
else:
exc_type: type[BaseException]
+1 -1
View File
@@ -151,7 +151,7 @@ class CodeType:
def co_firstlineno(self) -> int: ...
if sys.version_info >= (3, 10):
@property
@deprecated("Will be removed in Python 3.15. Use the co_lines() method instead.")
@deprecated("Deprecated since Python 3.10; will be removed in Python 3.15. Use `CodeType.co_lines()` instead.")
def co_lnotab(self) -> bytes: ...
else:
@property
+35 -18
View File
@@ -35,21 +35,38 @@ class TestLoader:
defaultTestLoader: TestLoader
if sys.version_info < (3, 13):
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
def getTestCaseNames(
testCaseClass: type[unittest.case.TestCase],
prefix: str,
sortUsing: _SortComparisonMethod = ...,
testNamePatterns: list[str] | None = None,
) -> Sequence[str]: ...
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
def makeSuite(
testCaseClass: type[unittest.case.TestCase],
prefix: str = "test",
sortUsing: _SortComparisonMethod = ...,
suiteClass: _SuiteClass = ...,
) -> unittest.suite.TestSuite: ...
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
def findTestCases(
module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ...
) -> unittest.suite.TestSuite: ...
if sys.version_info >= (3, 11):
@deprecated("Deprecated since Python 3.11; removed in Python 3.13.")
def getTestCaseNames(
testCaseClass: type[unittest.case.TestCase],
prefix: str,
sortUsing: _SortComparisonMethod = ...,
testNamePatterns: list[str] | None = None,
) -> Sequence[str]: ...
@deprecated("Deprecated since Python 3.11; removed in Python 3.13.")
def makeSuite(
testCaseClass: type[unittest.case.TestCase],
prefix: str = "test",
sortUsing: _SortComparisonMethod = ...,
suiteClass: _SuiteClass = ...,
) -> unittest.suite.TestSuite: ...
@deprecated("Deprecated since Python 3.11; removed in Python 3.13.")
def findTestCases(
module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ...
) -> unittest.suite.TestSuite: ...
else:
def getTestCaseNames(
testCaseClass: type[unittest.case.TestCase],
prefix: str,
sortUsing: _SortComparisonMethod = ...,
testNamePatterns: list[str] | None = None,
) -> Sequence[str]: ...
def makeSuite(
testCaseClass: type[unittest.case.TestCase],
prefix: str = "test",
sortUsing: _SortComparisonMethod = ...,
suiteClass: _SuiteClass = ...,
) -> unittest.suite.TestSuite: ...
def findTestCases(
module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ...
) -> unittest.suite.TestSuite: ...
+5 -2
View File
@@ -64,8 +64,11 @@ class TestProgram:
) -> None: ...
if sys.version_info < (3, 13):
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
def usageExit(self, msg: Any = None) -> None: ...
if sys.version_info >= (3, 11):
@deprecated("Deprecated since Python 3.11; removed in Python 3.13.")
def usageExit(self, msg: Any = None) -> None: ...
else:
def usageExit(self, msg: Any = None) -> None: ...
def parseArgs(self, argv: list[str]) -> None: ...
def createTests(self, from_discovery: bool = False, Loader: unittest.loader.TestLoader | None = None) -> None: ...
+22 -10
View File
@@ -1,3 +1,4 @@
import sys
from _typeshed import ReadableBuffer, Unused
from typing import IO, Any, BinaryIO, Final, Literal, NamedTuple, NoReturn, overload
from typing_extensions import Self, TypeAlias, deprecated
@@ -34,10 +35,15 @@ class Wave_read:
def getcomptype(self) -> str: ...
def getcompname(self) -> str: ...
def getparams(self) -> _wave_params: ...
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
def getmarkers(self) -> None: ...
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
def getmark(self, id: Any) -> NoReturn: ...
if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def getmarkers(self) -> None: ...
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def getmark(self, id: Any) -> NoReturn: ...
else:
def getmarkers(self) -> None: ...
def getmark(self, id: Any) -> NoReturn: ...
def setpos(self, pos: int) -> None: ...
def readframes(self, nframes: int) -> bytes: ...
@@ -59,12 +65,18 @@ class Wave_write:
def getcompname(self) -> str: ...
def setparams(self, params: _wave_params | tuple[int, int, int, int, str, str]) -> None: ...
def getparams(self) -> _wave_params: ...
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ...
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
def getmark(self, id: Any) -> NoReturn: ...
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
def getmarkers(self) -> None: ...
if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ...
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def getmark(self, id: Any) -> NoReturn: ...
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def getmarkers(self) -> None: ...
else:
def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ...
def getmark(self, id: Any) -> NoReturn: ...
def getmarkers(self) -> None: ...
def tell(self) -> int: ...
def writeframesraw(self, data: ReadableBuffer) -> None: ...
def writeframes(self, data: ReadableBuffer) -> None: ...
+10 -4
View File
@@ -64,10 +64,16 @@ if sys.platform == "win32":
if sys.platform == "darwin":
if sys.version_info < (3, 13):
@deprecated("Deprecated in 3.11, to be removed in 3.13.")
class MacOSX(BaseBrowser):
def __init__(self, name: str) -> None: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
if sys.version_info >= (3, 11):
@deprecated("Deprecated since Python 3.11; removed in Python 3.13.")
class MacOSX(BaseBrowser):
def __init__(self, name: str) -> None: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
else:
class MacOSX(BaseBrowser):
def __init__(self, name: str) -> None: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
class MacOSXOSAScript(BaseBrowser): # In runtime this class does not have `name` and `basename`
if sys.version_info >= (3, 11):