@@ -10,7 +10,7 @@ from _ast import (
1010)
1111from _typeshed import ReadableBuffer , Unused
1212from collections .abc import Iterable , Iterator , Sequence
13- from typing import Any , ClassVar , Generic , Literal , TypedDict , TypeVar as _TypeVar , overload
13+ from typing import Any , ClassVar , Generic , Literal , TypedDict , TypeVar as _TypeVar , overload , type_check_only
1414from typing_extensions import Self , Unpack , deprecated
1515
1616if sys .version_info >= (3 , 13 ):
@@ -20,6 +20,7 @@ if sys.version_info >= (3, 13):
2020_EndPositionT = typing_extensions .TypeVar ("_EndPositionT" , int , int | None , default = int | None )
2121
2222# Corresponds to the names in the `_attributes` class variable which is non-empty in certain AST nodes
23+ @type_check_only
2324class _Attributes (TypedDict , Generic [_EndPositionT ], total = False ):
2425 lineno : int
2526 col_offset : int
@@ -1698,8 +1699,14 @@ if sys.version_info >= (3, 12):
16981699 self , * , name : str = ..., default_value : expr | None = ..., ** kwargs : Unpack [_Attributes [int ]]
16991700 ) -> Self : ...
17001701
1701- class _ABC (type ):
1702- def __init__ (cls , * args : Unused ) -> None : ...
1702+ if sys .version_info >= (3 , 14 ):
1703+ @type_check_only
1704+ class _ABC (type ):
1705+ def __init__ (cls , * args : Unused ) -> None : ...
1706+
1707+ else :
1708+ class _ABC (type ):
1709+ def __init__ (cls , * args : Unused ) -> None : ...
17031710
17041711if sys .version_info < (3 , 14 ):
17051712 @deprecated ("Replaced by ast.Constant; removed in Python 3.14" )
0 commit comments