Skip to content

Commit 7aa96f9

Browse files
committed
Improve deprecation messages for many backported deprecations
1 parent d0d2a7e commit 7aa96f9

21 files changed

Lines changed: 40 additions & 40 deletions

stdlib/argparse.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class _ActionsContainer:
103103
conflict_handler: str = ...,
104104
) -> _ArgumentGroup: ...
105105
@overload
106-
@deprecated("The `prefix_chars` parameter deprecated since Python 3.14.")
106+
@deprecated("The `prefix_chars` parameter is deprecated.")
107107
def add_argument_group(
108108
self,
109109
title: str | None = None,
@@ -530,7 +530,7 @@ class Namespace(_AttributeHolder):
530530
def __eq__(self, other: object) -> bool: ...
531531
__hash__: ClassVar[None] # type: ignore[assignment]
532532

533-
@deprecated("Deprecated since Python 3.14. Open files after parsing arguments instead.")
533+
@deprecated("Deprecated; may leave files open. Open files after parsing arguments instead.")
534534
class FileType:
535535
# undocumented
536536
_mode: str
@@ -556,7 +556,7 @@ class _ArgumentGroup(_ActionsContainer):
556556
conflict_handler: str = ...,
557557
) -> None: ...
558558
@overload
559-
@deprecated("Undocumented `prefix_chars` parameter is deprecated since Python 3.14.")
559+
@deprecated("Undocumented `prefix_chars` parameter is deprecated.")
560560
def __init__(
561561
self,
562562
container: _ActionsContainer,

stdlib/asyncio/events.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,10 @@ else:
633633
def new_event_loop(self) -> AbstractEventLoop: ...
634634
# Child processes handling (Unix only).
635635
@abstractmethod
636-
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
636+
@deprecated("Deprecated; removed in Python 3.14.")
637637
def get_child_watcher(self) -> AbstractChildWatcher: ...
638638
@abstractmethod
639-
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
639+
@deprecated("Deprecated; removed in Python 3.14.")
640640
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
641641

642642
AbstractEventLoopPolicy = _AbstractEventLoopPolicy
@@ -657,15 +657,15 @@ if sys.version_info >= (3, 14):
657657
def _get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
658658
def _set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...
659659

660-
@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
660+
@deprecated("Deprecated; will be removed in Python 3.16.")
661661
def get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
662-
@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
662+
@deprecated("Deprecated; will be removed in Python 3.16.")
663663
def set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...
664664
def set_event_loop(loop: AbstractEventLoop | None) -> None: ...
665665
def new_event_loop() -> AbstractEventLoop: ...
666666

667667
if sys.version_info < (3, 14):
668-
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
668+
@deprecated("Deprecated; removed in Python 3.14.")
669669
def get_child_watcher() -> AbstractChildWatcher: ...
670-
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
670+
@deprecated("Deprecated; removed in Python 3.14.")
671671
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...

stdlib/ctypes/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ c_buffer = create_string_buffer
168168
def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ...
169169

170170
if sys.version_info < (3, 15):
171-
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
171+
@deprecated("Deprecated; will be removed in Python 3.15.")
172172
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
173173

174-
@deprecated("Soft deprecated since Python 3.13. Use multiplication instead.")
174+
@deprecated("Soft deprecated. Use multiplication instead.")
175175
def ARRAY(typ: _CT, len: int) -> Array[_CT]: ...
176176

177177
if sys.platform == "win32":

stdlib/http/server.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
128128
def executable(path: StrPath) -> bool: ... # undocumented
129129

130130
if sys.version_info < (3, 15):
131-
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
131+
@deprecated("Deprecated and unsafe; will be removed in Python 3.15.")
132132
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
133133
cgi_directories: list[str]
134134
have_fork: bool # undocumented

stdlib/importlib/resources/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ else:
6262
def read_text(package: Package, resource: Resource, encoding: str = "utf-8", errors: str = "strict") -> str: ...
6363
def path(package: Package, resource: Resource) -> AbstractContextManager[Path, Literal[False]]: ...
6464
def is_resource(package: Package, name: str) -> bool: ...
65-
@deprecated("Deprecated since Python 3.11. Use `files(anchor).iterdir()`.")
65+
@deprecated("Deprecated; limited resource support. Use `files(anchor).iterdir()`.")
6666
def contents(package: Package) -> Iterator[str]: ...
6767

6868
if sys.version_info >= (3, 11):

stdlib/locale.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def getpreferredencoding(do_setlocale: bool = True) -> _str: ...
138138
def normalize(localename: _str) -> _str: ...
139139

140140
if sys.version_info < (3, 13):
141-
@deprecated("Deprecated since Python 3.11; removed in Python 3.13. Use `locale.setlocale(locale.LC_ALL, '')` instead.")
141+
@deprecated("Deprecated; removed in Python 3.13. Use `locale.setlocale(locale.LC_ALL, '')` instead.")
142142
def resetlocale(category: int = ...) -> None: ...
143143

144144
if sys.version_info < (3, 12):

stdlib/nturl2path.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing_extensions import deprecated
22

3-
@deprecated("The `nturl2path` module is deprecated since Python 3.14.")
3+
@deprecated("Deprecated; use `urllib.request` file-URL helpers instead.")
44
def url2pathname(url: str) -> str: ...
5-
@deprecated("The `nturl2path` module is deprecated since Python 3.14.")
5+
@deprecated("Deprecated; use `urllib.request` file-URL helpers instead.")
66
def pathname2url(p: str) -> str: ...

stdlib/pathlib/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class PurePath(PathLike[str]):
112112
@overload
113113
def is_relative_to(self, other: StrPath, /) -> bool: ...
114114
@overload
115-
@deprecated("Passing additional arguments is deprecated since Python 3.12; removed in Python 3.14.")
115+
@deprecated("Passing additional arguments is deprecated; removed in Python 3.14.")
116116
def is_relative_to(self, other: StrPath, /, *_deprecated: StrPath) -> bool: ...
117117

118118
if sys.version_info >= (3, 12):

stdlib/pkgutil.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ if sys.version_info < (3, 12):
3939
def __init__(self, fullname: str, file: IO[str], filename: StrOrBytesPath, etc: tuple[str, str, int]) -> None: ...
4040

4141
if sys.version_info < (3, 14):
42-
@deprecated("Deprecated since Python 3.12; removed in Python 3.14. Use `importlib.util.find_spec()` instead.")
42+
@deprecated("Deprecated; removed in Python 3.14. Use `importlib.util.find_spec()` instead.")
4343
def find_loader(fullname: str) -> LoaderProtocol | None: ...
44-
@deprecated("Deprecated since Python 3.12; removed in Python 3.14. Use `importlib.util.find_spec()` instead.")
44+
@deprecated("Deprecated; removed in Python 3.14. Use `importlib.util.find_spec()` instead.")
4545
def get_loader(module_or_name: str) -> LoaderProtocol | None: ...
4646

4747
def get_importer(path_item: StrOrBytesPath) -> PathEntryFinderProtocol | None: ...

stdlib/pty.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ if sys.platform != "win32":
1515
def openpty() -> tuple[int, int]: ...
1616

1717
if sys.version_info < (3, 14):
18-
@deprecated("Deprecated since Python 3.12; removed in Python 3.14. Use `openpty()` instead.")
18+
@deprecated("Deprecated; removed in Python 3.14. Use `openpty()` instead.")
1919
def master_open() -> tuple[int, str]: ...
20-
@deprecated("Deprecated since Python 3.12; removed in Python 3.14. Use `openpty()` instead.")
20+
@deprecated("Deprecated; removed in Python 3.14. Use `openpty()` instead.")
2121
def slave_open(tty_name: str) -> int: ...
2222

2323
def fork() -> tuple[int, int]: ...

0 commit comments

Comments
 (0)