@@ -710,22 +710,54 @@ class Assert(stmt):
710710 def __replace__ (self , * , test : expr = ..., msg : expr | None = ..., ** kwargs : Unpack [_Attributes ]) -> Self : ...
711711
712712class Import (stmt ):
713- __match_args__ = ("names" ,)
713+ if sys .version_info >= (3 , 15 ):
714+ __match_args__ = ("names" , "is_lazy" )
715+ else :
716+ __match_args__ = ("names" ,)
714717 names : list [alias ]
715- if sys .version_info >= (3 , 13 ):
718+ if sys .version_info >= (3 , 15 ):
719+ is_lazy : bool | None
720+ if sys .version_info >= (3 , 15 ):
721+ def __init__ (self , names : list [alias ] = ..., is_lazy : bool | None = None , ** kwargs : Unpack [_Attributes ]) -> None : ...
722+
723+ elif sys .version_info >= (3 , 13 ):
716724 def __init__ (self , names : list [alias ] = ..., ** kwargs : Unpack [_Attributes ]) -> None : ...
717725 else :
718726 def __init__ (self , names : list [alias ], ** kwargs : Unpack [_Attributes ]) -> None : ...
719727
720- if sys .version_info >= (3 , 14 ):
728+ if sys .version_info >= (3 , 15 ):
729+ def __replace__ (self , * , names : list [alias ] = ..., is_lazy : bool | None = ..., ** kwargs : Unpack [_Attributes ]) -> Self : ...
730+
731+ elif sys .version_info >= (3 , 14 ):
721732 def __replace__ (self , * , names : list [alias ] = ..., ** kwargs : Unpack [_Attributes ]) -> Self : ...
722733
723734class ImportFrom (stmt ):
724- __match_args__ = ("module" , "names" , "level" )
735+ if sys .version_info >= (3 , 15 ):
736+ __match_args__ = ("module" , "names" , "level" , "is_lazy" )
737+ else :
738+ __match_args__ = ("module" , "names" , "level" )
725739 module : str | None
726740 names : list [alias ]
727741 level : int
728- if sys .version_info >= (3 , 13 ):
742+ if sys .version_info >= (3 , 15 ):
743+ is_lazy : bool | None
744+ if sys .version_info >= (3 , 15 ):
745+ @overload
746+ def __init__ (
747+ self , module : str | None , names : list [alias ], level : int , is_lazy : bool | None = None , ** kwargs : Unpack [_Attributes ]
748+ ) -> None : ...
749+ @overload
750+ def __init__ (
751+ self ,
752+ module : str | None = None ,
753+ names : list [alias ] = ...,
754+ * ,
755+ level : int ,
756+ is_lazy : bool | None = None ,
757+ ** kwargs : Unpack [_Attributes ],
758+ ) -> None : ...
759+
760+ elif sys .version_info >= (3 , 13 ):
729761 @overload
730762 def __init__ (self , module : str | None , names : list [alias ], level : int , ** kwargs : Unpack [_Attributes ]) -> None : ...
731763 @overload
@@ -740,7 +772,18 @@ class ImportFrom(stmt):
740772 self , module : str | None = None , * , names : list [alias ], level : int , ** kwargs : Unpack [_Attributes ]
741773 ) -> None : ...
742774
743- if sys .version_info >= (3 , 14 ):
775+ if sys .version_info >= (3 , 15 ):
776+ def __replace__ (
777+ self ,
778+ * ,
779+ module : str | None = ...,
780+ names : list [alias ] = ...,
781+ level : int = ...,
782+ is_lazy : bool | None = ...,
783+ ** kwargs : Unpack [_Attributes ],
784+ ) -> Self : ...
785+
786+ elif sys .version_info >= (3 , 14 ):
744787 def __replace__ (
745788 self , * , module : str | None = ..., names : list [alias ] = ..., level : int = ..., ** kwargs : Unpack [_Attributes ]
746789 ) -> Self : ...
@@ -908,7 +951,10 @@ class SetComp(expr):
908951class DictComp (expr ):
909952 __match_args__ = ("key" , "value" , "generators" )
910953 key : expr
911- value : expr
954+ if sys .version_info >= (3 , 15 ):
955+ value : expr | None
956+ else :
957+ value : expr
912958 generators : list [comprehension ]
913959 if sys .version_info >= (3 , 13 ):
914960 def __init__ (
@@ -1672,7 +1718,105 @@ if sys.version_info < (3, 14):
16721718
16731719_T = _TypeVar ("_T" , bound = AST )
16741720
1675- if sys .version_info >= (3 , 13 ):
1721+ if sys .version_info >= (3 , 15 ):
1722+ @overload
1723+ def parse (
1724+ source : _T ,
1725+ filename : str | bytes | os .PathLike [Any ] = "<unknown>" ,
1726+ mode : Literal ["exec" , "eval" , "func_type" , "single" ] = "exec" ,
1727+ * ,
1728+ type_comments : bool = False ,
1729+ feature_version : None | int | tuple [int , int ] = None ,
1730+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1731+ module : str | None = None ,
1732+ ) -> _T : ...
1733+ @overload
1734+ def parse (
1735+ source : str | ReadableBuffer ,
1736+ filename : str | bytes | os .PathLike [Any ] = "<unknown>" ,
1737+ mode : Literal ["exec" ] = "exec" ,
1738+ * ,
1739+ type_comments : bool = False ,
1740+ feature_version : None | int | tuple [int , int ] = None ,
1741+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1742+ module : str | None = None ,
1743+ ) -> Module : ...
1744+ @overload
1745+ def parse (
1746+ source : str | ReadableBuffer ,
1747+ filename : str | bytes | os .PathLike [Any ],
1748+ mode : Literal ["eval" ],
1749+ * ,
1750+ type_comments : bool = False ,
1751+ feature_version : None | int | tuple [int , int ] = None ,
1752+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1753+ module : str | None = None ,
1754+ ) -> Expression : ...
1755+ @overload
1756+ def parse (
1757+ source : str | ReadableBuffer ,
1758+ filename : str | bytes | os .PathLike [Any ],
1759+ mode : Literal ["func_type" ],
1760+ * ,
1761+ type_comments : bool = False ,
1762+ feature_version : None | int | tuple [int , int ] = None ,
1763+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1764+ module : str | None = None ,
1765+ ) -> FunctionType : ...
1766+ @overload
1767+ def parse (
1768+ source : str | ReadableBuffer ,
1769+ filename : str | bytes | os .PathLike [Any ],
1770+ mode : Literal ["single" ],
1771+ * ,
1772+ type_comments : bool = False ,
1773+ feature_version : None | int | tuple [int , int ] = None ,
1774+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1775+ module : str | None = None ,
1776+ ) -> Interactive : ...
1777+ @overload
1778+ def parse (
1779+ source : str | ReadableBuffer ,
1780+ * ,
1781+ mode : Literal ["eval" ],
1782+ type_comments : bool = False ,
1783+ feature_version : None | int | tuple [int , int ] = None ,
1784+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1785+ module : str | None = None ,
1786+ ) -> Expression : ...
1787+ @overload
1788+ def parse (
1789+ source : str | ReadableBuffer ,
1790+ * ,
1791+ mode : Literal ["func_type" ],
1792+ type_comments : bool = False ,
1793+ feature_version : None | int | tuple [int , int ] = None ,
1794+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1795+ module : str | None = None ,
1796+ ) -> FunctionType : ...
1797+ @overload
1798+ def parse (
1799+ source : str | ReadableBuffer ,
1800+ * ,
1801+ mode : Literal ["single" ],
1802+ type_comments : bool = False ,
1803+ feature_version : None | int | tuple [int , int ] = None ,
1804+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1805+ module : str | None = None ,
1806+ ) -> Interactive : ...
1807+ @overload
1808+ def parse (
1809+ source : str | ReadableBuffer ,
1810+ filename : str | bytes | os .PathLike [Any ] = "<unknown>" ,
1811+ mode : str = "exec" ,
1812+ * ,
1813+ type_comments : bool = False ,
1814+ feature_version : None | int | tuple [int , int ] = None ,
1815+ optimize : Literal [- 1 , 0 , 1 , 2 ] = - 1 ,
1816+ module : str | None = None ,
1817+ ) -> mod : ...
1818+
1819+ elif sys .version_info >= (3 , 13 ):
16761820 @overload
16771821 def parse (
16781822 source : _T ,
@@ -1843,7 +1987,18 @@ else:
18431987
18441988def literal_eval (node_or_string : str | AST ) -> Any : ...
18451989
1846- if sys .version_info >= (3 , 13 ):
1990+ if sys .version_info >= (3 , 15 ):
1991+ def dump (
1992+ node : AST ,
1993+ annotate_fields : bool = True ,
1994+ include_attributes : bool = False ,
1995+ * ,
1996+ indent : int | str | None = None ,
1997+ show_empty : bool = False ,
1998+ color : bool = False ,
1999+ ) -> str : ...
2000+
2001+ elif sys .version_info >= (3 , 13 ):
18472002 def dump (
18482003 node : AST ,
18492004 annotate_fields : bool = True ,
0 commit comments