[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
+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):