Skip to content

Commit 815d8bf

Browse files
authored
ast removals for 3.14 (#12488)
1 parent 033e5d1 commit 815d8bf

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

stdlib/_ast.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,11 @@ class Constant(expr):
753753
__match_args__ = ("value", "kind")
754754
value: Any # None, str, bytes, bool, int, float, complex, Ellipsis
755755
kind: str | None
756-
# Aliases for value, for backwards compatibility
757-
s: Any
758-
n: int | float | complex
756+
if sys.version_info < (3, 14):
757+
# Aliases for value, for backwards compatibility
758+
s: Any
759+
n: int | float | complex
760+
759761
def __init__(self, value: Any, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
760762

761763
class NamedExpr(expr):

stdlib/ast.pyi

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,28 @@ class _ABC(type):
1010
if sys.version_info >= (3, 9):
1111
def __init__(cls, *args: Unused) -> None: ...
1212

13-
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
14-
class Num(Constant, metaclass=_ABC):
15-
value: int | float | complex
13+
if sys.version_info < (3, 14):
14+
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
15+
class Num(Constant, metaclass=_ABC):
16+
value: int | float | complex
1617

17-
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
18-
class Str(Constant, metaclass=_ABC):
19-
value: str
20-
# Aliases for value, for backwards compatibility
21-
s: str
18+
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
19+
class Str(Constant, metaclass=_ABC):
20+
value: str
21+
# Aliases for value, for backwards compatibility
22+
s: str
2223

23-
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
24-
class Bytes(Constant, metaclass=_ABC):
25-
value: bytes
26-
# Aliases for value, for backwards compatibility
27-
s: bytes
24+
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
25+
class Bytes(Constant, metaclass=_ABC):
26+
value: bytes
27+
# Aliases for value, for backwards compatibility
28+
s: bytes
2829

29-
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
30-
class NameConstant(Constant, metaclass=_ABC): ...
30+
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
31+
class NameConstant(Constant, metaclass=_ABC): ...
3132

32-
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
33-
class Ellipsis(Constant, metaclass=_ABC): ...
33+
@deprecated("Replaced by ast.Constant; removed in Python 3.14")
34+
class Ellipsis(Constant, metaclass=_ABC): ...
3435

3536
if sys.version_info >= (3, 9):
3637
class slice(AST): ...

0 commit comments

Comments
 (0)