mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
ast: mark ast.Num etc. as deprecated (#10994)
This commit is contained in:
@@ -42,4 +42,6 @@
|
||||
"reportOverlappingOverload": "none",
|
||||
// The name of the self/cls parameter is out of typeshed's control.
|
||||
"reportSelfClsParameterName": "none",
|
||||
// Not actionable in typeshed
|
||||
"reportDeprecated": "none",
|
||||
}
|
||||
|
||||
@@ -109,4 +109,6 @@
|
||||
"reportOverlappingOverload": "none",
|
||||
// The name of the self/cls parameter is out of typeshed's control.
|
||||
"reportSelfClsParameterName": "none",
|
||||
// Not actionable in typeshed
|
||||
"reportDeprecated": "none",
|
||||
}
|
||||
|
||||
@@ -4,27 +4,30 @@ from _ast import *
|
||||
from _typeshed import ReadableBuffer, Unused
|
||||
from collections.abc import Iterator
|
||||
from typing import Any, TypeVar as _TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, deprecated
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class _ABC(type):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __init__(cls, *args: Unused) -> None: ...
|
||||
|
||||
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
|
||||
class Num(Constant, metaclass=_ABC):
|
||||
value: int | float | complex
|
||||
|
||||
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
|
||||
class Str(Constant, metaclass=_ABC):
|
||||
value: str
|
||||
# Aliases for value, for backwards compatibility
|
||||
s: str
|
||||
|
||||
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
|
||||
class Bytes(Constant, metaclass=_ABC):
|
||||
value: bytes
|
||||
# Aliases for value, for backwards compatibility
|
||||
s: bytes
|
||||
|
||||
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
|
||||
class NameConstant(Constant, metaclass=_ABC): ...
|
||||
|
||||
@deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
|
||||
class Ellipsis(Constant, metaclass=_ABC): ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
Reference in New Issue
Block a user