10000 ast: mark ast.Num etc. as deprecated (#10994) · python/typeshed@17f8a82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 17f8a82

Browse files
ast: mark ast.Num etc. as deprecated (#10994)
1 parent 516f665 commit 17f8a82

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

pyrightconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@
4242
"reportOverlappingOverload": "none",
4343
// The name of the self/cls parameter is out of typeshed's control.
4444
"reportSelfClsParameterName": "none",
45+
// Not actionable in typeshed
46+
"reportDeprecated": "none",
4547
}

pyrightconfig.stricter.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,6 @@
109109
"reportOverlappingOverload": "none",
110110
// The name of the self/cls parameter is out of typeshed's control.
111111
"reportSelfClsParameterName": "none",
112+
// Not actionable in typeshed
113+
"reportDeprecated": "none",
112114
}

stdlib/ast.pyi

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,30 @@ from _ast import *
44
from _typeshed import ReadableBuffer, Unused
55
from collections.abc import Iterator
66
from typing import Any, TypeVar as _TypeVar, overload
7-
from typing_extensions import Literal
7+
from typing_extensions import Literal, deprecated
88

99
if sys.version_info >= (3, 8):
1010
class _ABC(type):
11< E503 code>11
if sys.version_info >= (3, 9):
1212
def __init__(cls, *args: Unused) -> None: ...
1313

14+
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
1415
class Num(Constant, metaclass=_ABC):
1516
value: int | float | complex
16-
17+
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
1718
class Str(Constant, metaclass=_ABC):
1819
value: str
1920
# Aliases for value, for backwards compatibility
2021
s: str
21-
22+
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
2223
class Bytes(Constant, metaclass=_ABC):
2324
value: bytes
2425
# Aliases for value, for backwards compatibility
2526
s: bytes
26-
27+
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
2728
class NameConstant(Constant, metaclass=_ABC): ...
29+
30+
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
2831
class Ellipsis(Constant, metaclass=_ABC): ...
2932

3033
if sys.version_info >= (3, 9):

0 commit comments

Comments
 (0)
0