mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Add @disjoint_base decorator in the stdlib (#14599)
And fix some other new stubtest finds.
This commit is contained in:
+17
-9
@@ -11,7 +11,7 @@ from _ast import (
|
||||
from _typeshed import ReadableBuffer, Unused
|
||||
from collections.abc import Iterable, Iterator, Sequence
|
||||
from typing import Any, ClassVar, Generic, Literal, TypedDict, TypeVar as _TypeVar, overload, type_check_only
|
||||
from typing_extensions import Self, Unpack, deprecated
|
||||
from typing_extensions import Self, Unpack, deprecated, disjoint_base
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
from _ast import PyCF_OPTIMIZED_AST as PyCF_OPTIMIZED_AST
|
||||
@@ -30,16 +30,24 @@ class _Attributes(TypedDict, Generic[_EndPositionT], total=False):
|
||||
# The various AST classes are implemented in C, and imported from _ast at runtime,
|
||||
# but they consider themselves to live in the ast module,
|
||||
# so we'll define the stubs in this file.
|
||||
class AST:
|
||||
if sys.version_info >= (3, 10):
|
||||
if sys.version_info >= (3, 12):
|
||||
@disjoint_base
|
||||
class AST:
|
||||
__match_args__ = ()
|
||||
_attributes: ClassVar[tuple[str, ...]]
|
||||
_fields: ClassVar[tuple[str, ...]]
|
||||
if sys.version_info >= (3, 13):
|
||||
_field_types: ClassVar[dict[str, Any]]
|
||||
_attributes: ClassVar[tuple[str, ...]]
|
||||
_fields: ClassVar[tuple[str, ...]]
|
||||
if sys.version_info >= (3, 13):
|
||||
_field_types: ClassVar[dict[str, Any]]
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
def __replace__(self) -> Self: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
def __replace__(self) -> Self: ...
|
||||
|
||||
else:
|
||||
class AST:
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__ = ()
|
||||
_attributes: ClassVar[tuple[str, ...]]
|
||||
_fields: ClassVar[tuple[str, ...]]
|
||||
|
||||
class mod(AST): ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user