Skip to content

Commit ed71d40

Browse files
sobolevnmingyu.park
authored andcommitted
Add new ast node from 3.14 (python#14034)
1 parent a3a7c9e commit ed71d40

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ _socket.IP_RECVTTL
1515
_socket.if_indextoname
1616
_thread.RLock.locked
1717
_thread.set_name
18-
ast.Interpolation
19-
ast.TemplateStr
2018
asyncio.__all__
2119
asyncio._AbstractEventLoopPolicy
2220
asyncio._DefaultEventLoopPolicy

stdlib/ast.pyi

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import builtins
12
import os
23
import sys
34
import typing_extensions
@@ -1063,6 +1064,37 @@ class JoinedStr(expr):
10631064
if sys.version_info >= (3, 14):
10641065
def __replace__(self, *, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
10651066

1067+
if sys.version_info >= (3, 14):
1068+
class TemplateStr(expr):
1069+
__match_args__ = ("values",)
1070+
values: list[expr]
1071+
def __init__(self, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1072+
def __replace__(self, *, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1073+
1074+
class Interpolation(expr):
1075+
__match_args__ = ("value", "str", "conversion", "format_spec")
1076+
value: expr
1077+
str: builtins.str
1078+
conversion: int
1079+
format_spec: builtins.str | None = None
1080+
def __init__(
1081+
self,
1082+
value: expr = ...,
1083+
str: builtins.str = ...,
1084+
conversion: int = ...,
1085+
format_spec: builtins.str | None = ...,
1086+
**kwargs: Unpack[_Attributes],
1087+
) -> None: ...
1088+
def __replace__(
1089+
self,
1090+
*,
1091+
value: expr = ...,
1092+
str: builtins.str = ...,
1093+
conversion: int = ...,
1094+
format_spec: builtins.str | None = ...,
1095+
**kwargs: Unpack[_Attributes],
1096+
) -> Self: ...
1097+
10661098
class Constant(expr):
10671099
if sys.version_info >= (3, 10):
10681100
__match_args__ = ("value", "kind")

0 commit comments

Comments
 (0)