basedpyright 1.18.3 → 1.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/README.md +3 -3
  2. package/dist/pyright-langserver.js +1 -1
  3. package/dist/pyright-langserver.js.map +1 -1
  4. package/dist/pyright.js +1 -1
  5. package/dist/pyright.js.map +1 -1
  6. package/dist/typeshed-fallback/commit.txt +1 -1
  7. package/dist/typeshed-fallback/stdlib/VERSIONS +2 -0
  8. package/dist/typeshed-fallback/stdlib/_ast.pyi +140 -1667
  9. package/dist/typeshed-fallback/stdlib/_csv.pyi +14 -3
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +857 -65
  11. package/dist/typeshed-fallback/stdlib/_decimal.pyi +29 -820
  12. package/dist/typeshed-fallback/stdlib/_socket.pyi +4 -12
  13. package/dist/typeshed-fallback/stdlib/_sqlite3.pyi +387 -0
  14. package/dist/typeshed-fallback/stdlib/_ssl.pyi +406 -0
  15. package/dist/typeshed-fallback/stdlib/_weakref.pyi +2 -41
  16. package/dist/typeshed-fallback/stdlib/ast.pyi +1843 -172
  17. package/dist/typeshed-fallback/stdlib/builtins.pyi +5 -0
  18. package/dist/typeshed-fallback/stdlib/cProfile.pyi +3 -3
  19. package/dist/typeshed-fallback/stdlib/calendar.pyi +3 -3
  20. package/dist/typeshed-fallback/stdlib/concurrent/futures/process.pyi +3 -2
  21. package/dist/typeshed-fallback/stdlib/contextlib.pyi +6 -8
  22. package/dist/typeshed-fallback/stdlib/csv.pyi +4 -3
  23. package/dist/typeshed-fallback/stdlib/curses/__init__.pyi +7 -2
  24. package/dist/typeshed-fallback/stdlib/curses/panel.pyi +4 -4
  25. package/dist/typeshed-fallback/stdlib/curses/textpad.pyi +3 -3
  26. package/dist/typeshed-fallback/stdlib/decimal.pyi +840 -2
  27. package/dist/typeshed-fallback/stdlib/email/_policybase.pyi +27 -18
  28. package/dist/typeshed-fallback/stdlib/email/feedparser.pyi +5 -5
  29. package/dist/typeshed-fallback/stdlib/email/generator.pyi +46 -9
  30. package/dist/typeshed-fallback/stdlib/email/message.pyi +8 -6
  31. package/dist/typeshed-fallback/stdlib/email/parser.pyi +6 -4
  32. package/dist/typeshed-fallback/stdlib/email/policy.pyi +28 -10
  33. package/dist/typeshed-fallback/stdlib/http/client.pyi +3 -2
  34. package/dist/typeshed-fallback/stdlib/io.pyi +6 -22
  35. package/dist/typeshed-fallback/stdlib/multiprocessing/connection.pyi +27 -19
  36. package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +5 -2
  37. package/dist/typeshed-fallback/stdlib/multiprocessing/managers.pyi +4 -2
  38. package/dist/typeshed-fallback/stdlib/multiprocessing/reduction.pyi +2 -2
  39. package/dist/typeshed-fallback/stdlib/profile.pyi +3 -3
  40. package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +1 -5
  41. package/dist/typeshed-fallback/stdlib/re.pyi +10 -1
  42. package/dist/typeshed-fallback/stdlib/socket.pyi +12 -4
  43. package/dist/typeshed-fallback/stdlib/sqlite3/__init__.pyi +739 -1
  44. package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +220 -884
  45. package/dist/typeshed-fallback/stdlib/sre_constants.pyi +1 -8
  46. package/dist/typeshed-fallback/stdlib/ssl.pyi +40 -128
  47. package/dist/typeshed-fallback/stdlib/tarfile.pyi +111 -6
  48. package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +127 -21
  49. package/dist/typeshed-fallback/stdlib/tokenize.pyi +1 -1
  50. package/dist/typeshed-fallback/stdlib/typing.pyi +7 -7
  51. package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +1 -1
  52. package/dist/typeshed-fallback/stdlib/unittest/mock.pyi +2 -2
  53. package/dist/typeshed-fallback/stdlib/weakref.pyi +49 -14
  54. package/dist/typeshed-fallback/stdlib/xml/parsers/expat/__init__.pyi +6 -0
  55. package/dist/typeshed-fallback/stdlib/xmlrpc/client.pyi +1 -1
  56. package/dist/typeshed-fallback/stdlib/xmlrpc/server.pyi +3 -2
  57. package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +41 -44
  58. package/dist/typeshed-fallback/stdlib/zoneinfo/_common.pyi +13 -0
  59. package/dist/typeshed-fallback/stdlib/zoneinfo/_tzpath.pyi +13 -0
  60. package/dist/typeshed-fallback/stubs/Flask-SocketIO/METADATA.toml +1 -1
  61. package/dist/typeshed-fallback/stubs/braintree/METADATA.toml +1 -1
  62. package/dist/typeshed-fallback/stubs/braintree/braintree/error_codes.pyi +1 -0
  63. package/dist/typeshed-fallback/stubs/docutils/docutils/__init__.pyi +3 -1
  64. package/dist/typeshed-fallback/stubs/docutils/docutils/frontend.pyi +1 -2
  65. package/dist/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/admonitions.pyi +15 -2
  66. package/dist/typeshed-fallback/stubs/docutils/docutils/readers/doctree.pyi +1 -1
  67. package/dist/typeshed-fallback/stubs/docutils/docutils/writers/__init__.pyi +21 -2
  68. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi +4 -4
  69. package/dist/typeshed-fallback/stubs/greenlet/METADATA.toml +1 -1
  70. package/dist/typeshed-fallback/stubs/hdbcli/METADATA.toml +1 -1
  71. package/dist/typeshed-fallback/stubs/icalendar/METADATA.toml +5 -2
  72. package/dist/typeshed-fallback/stubs/icalendar/icalendar/__init__.pyi +49 -5
  73. package/dist/typeshed-fallback/stubs/icalendar/icalendar/cal.pyi +32 -6
  74. package/dist/typeshed-fallback/stubs/icalendar/icalendar/caselessdict.pyi +2 -0
  75. package/dist/typeshed-fallback/stubs/icalendar/icalendar/parser.pyi +25 -1
  76. package/dist/typeshed-fallback/stubs/icalendar/icalendar/parser_tools.pyi +7 -3
  77. package/dist/typeshed-fallback/stubs/icalendar/icalendar/prop.pyi +112 -72
  78. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/__init__.pyi +8 -0
  79. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/provider.pyi +29 -0
  80. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/pytz.pyi +22 -0
  81. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/tzp.pyi +30 -0
  82. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/zoneinfo.pyi +33 -0
  83. package/dist/typeshed-fallback/stubs/icalendar/icalendar/tools.pyi +2 -0
  84. package/dist/typeshed-fallback/stubs/icalendar/icalendar/version.pyi +8 -0
  85. package/dist/typeshed-fallback/stubs/jwcrypto/METADATA.toml +3 -0
  86. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/common.pyi +48 -0
  87. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwa.pyi +35 -0
  88. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwe.pyi +51 -0
  89. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwk.pyi +115 -0
  90. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jws.pyi +52 -0
  91. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwt.pyi +78 -0
  92. package/dist/typeshed-fallback/stubs/m3u8/METADATA.toml +2 -0
  93. package/dist/typeshed-fallback/stubs/m3u8/m3u8/__init__.pyi +74 -0
  94. package/dist/typeshed-fallback/stubs/m3u8/m3u8/httpclient.pyi +19 -0
  95. package/dist/typeshed-fallback/stubs/m3u8/m3u8/mixins.pyi +25 -0
  96. package/dist/typeshed-fallback/stubs/m3u8/m3u8/model.pyi +406 -0
  97. package/dist/typeshed-fallback/stubs/m3u8/m3u8/parser.pyi +14 -0
  98. package/dist/typeshed-fallback/stubs/m3u8/m3u8/protocol.pyi +41 -0
  99. package/dist/typeshed-fallback/stubs/m3u8/m3u8/version_matching.pyi +5 -0
  100. package/dist/typeshed-fallback/stubs/m3u8/m3u8/version_matching_rules.pyi +24 -0
  101. package/dist/typeshed-fallback/stubs/paramiko/paramiko/transport.pyi +2 -1
  102. package/dist/typeshed-fallback/stubs/protobuf/METADATA.toml +2 -2
  103. package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +4 -3
  104. package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +0 -1
  105. package/dist/typeshed-fallback/stubs/pytz/pytz/__init__.pyi +4 -4
  106. package/dist/typeshed-fallback/stubs/pytz/pytz/tzinfo.pyi +1 -1
  107. package/dist/typeshed-fallback/stubs/qrcode/METADATA.toml +3 -2
  108. package/dist/typeshed-fallback/stubs/redis/redis/client.pyi +18 -0
  109. package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +1 -1
  110. package/dist/typeshed-fallback/stubs/reportlab/reportlab/graphics/renderPDF.pyi +2 -2
  111. package/dist/typeshed-fallback/stubs/seaborn/METADATA.toml +9 -1
  112. package/dist/typeshed-fallback/stubs/vobject/vobject/__init__.pyi +4 -0
  113. package/dist/typeshed-fallback/stubs/vobject/vobject/base.pyi +11 -2
  114. package/dist/typeshed-fallback/stubs/vobject/vobject/behavior.pyi +1 -1
  115. package/dist/typeshed-fallback/stubs/vobject/vobject/change_tz.pyi +4 -0
  116. package/dist/typeshed-fallback/stubs/vobject/vobject/ics_diff.pyi +0 -3
  117. package/dist/typeshed-fallback/stubs/vobject/vobject/vcard.pyi +1 -1
  118. package/dist/typeshed-fallback/stubs/waitress/waitress/__init__.pyi +2 -2
  119. package/package.json +1 -1
  120. package/dist/typeshed-fallback/stubs/Pillow/METADATA.toml +0 -8
  121. package/dist/typeshed-fallback/stubs/Pillow/PIL/BdfFontFile.pyi +0 -11
  122. package/dist/typeshed-fallback/stubs/Pillow/PIL/BlpImagePlugin.pyi +0 -39
  123. package/dist/typeshed-fallback/stubs/Pillow/PIL/BmpImagePlugin.pyi +0 -25
  124. package/dist/typeshed-fallback/stubs/Pillow/PIL/BufrStubImagePlugin.pyi +0 -9
  125. package/dist/typeshed-fallback/stubs/Pillow/PIL/ContainerIO.pyi +0 -14
  126. package/dist/typeshed-fallback/stubs/Pillow/PIL/CurImagePlugin.pyi +0 -6
  127. package/dist/typeshed-fallback/stubs/Pillow/PIL/DcxImagePlugin.pyi +0 -13
  128. package/dist/typeshed-fallback/stubs/Pillow/PIL/DdsImagePlugin.pyi +0 -314
  129. package/dist/typeshed-fallback/stubs/Pillow/PIL/EpsImagePlugin.pyi +0 -34
  130. package/dist/typeshed-fallback/stubs/Pillow/PIL/ExifTags.pyi +0 -347
  131. package/dist/typeshed-fallback/stubs/Pillow/PIL/FitsImagePlugin.pyi +0 -7
  132. package/dist/typeshed-fallback/stubs/Pillow/PIL/FliImagePlugin.pyi +0 -9
  133. package/dist/typeshed-fallback/stubs/Pillow/PIL/FontFile.pyi +0 -16
  134. package/dist/typeshed-fallback/stubs/Pillow/PIL/FpxImagePlugin.pyi +0 -23
  135. package/dist/typeshed-fallback/stubs/Pillow/PIL/FtexImagePlugin.pyi +0 -15
  136. package/dist/typeshed-fallback/stubs/Pillow/PIL/GbrImagePlugin.pyi +0 -11
  137. package/dist/typeshed-fallback/stubs/Pillow/PIL/GdImageFile.pyi +0 -9
  138. package/dist/typeshed-fallback/stubs/Pillow/PIL/GifImagePlugin.pyi +0 -31
  139. package/dist/typeshed-fallback/stubs/Pillow/PIL/GimpGradientFile.pyi +0 -19
  140. package/dist/typeshed-fallback/stubs/Pillow/PIL/GimpPaletteFile.pyi +0 -7
  141. package/dist/typeshed-fallback/stubs/Pillow/PIL/GribStubImagePlugin.pyi +0 -9
  142. package/dist/typeshed-fallback/stubs/Pillow/PIL/Hdf5StubImagePlugin.pyi +0 -9
  143. package/dist/typeshed-fallback/stubs/Pillow/PIL/IcnsImagePlugin.pyi +0 -36
  144. package/dist/typeshed-fallback/stubs/Pillow/PIL/IcoImagePlugin.pyi +0 -26
  145. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImImagePlugin.pyi +0 -34
  146. package/dist/typeshed-fallback/stubs/Pillow/PIL/Image.pyi +0 -342
  147. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageChops.pyi +0 -23
  148. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageCms.pyi +0 -84
  149. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageColor.pyi +0 -10
  150. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageDraw.pyi +0 -155
  151. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageDraw2.pyi +0 -37
  152. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageEnhance.pyi +0 -25
  153. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageFile.pyi +0 -89
  154. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageFilter.pyi +0 -136
  155. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageFont.pyi +0 -114
  156. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageGrab.pyi +0 -36
  157. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageMath.pyi +0 -49
  158. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageMode.pyi +0 -10
  159. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageMorph.pyi +0 -26
  160. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi +0 -53
  161. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImagePalette.pyi +0 -26
  162. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImagePath.pyi +0 -3
  163. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageQt.pyi +0 -26
  164. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageSequence.pyi +0 -14
  165. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageShow.pyi +0 -58
  166. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageStat.pyi +0 -14
  167. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageTk.pyi +0 -51
  168. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageTransform.pyi +0 -21
  169. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageWin.pyi +0 -38
  170. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImtImagePlugin.pyi +0 -10
  171. package/dist/typeshed-fallback/stubs/Pillow/PIL/IptcImagePlugin.pyi +0 -23
  172. package/dist/typeshed-fallback/stubs/Pillow/PIL/Jpeg2KImagePlugin.pyi +0 -23
  173. package/dist/typeshed-fallback/stubs/Pillow/PIL/JpegImagePlugin.pyi +0 -30
  174. package/dist/typeshed-fallback/stubs/Pillow/PIL/JpegPresets.pyi +0 -3
  175. package/dist/typeshed-fallback/stubs/Pillow/PIL/McIdasImagePlugin.pyi +0 -7
  176. package/dist/typeshed-fallback/stubs/Pillow/PIL/MicImagePlugin.pyi +0 -18
  177. package/dist/typeshed-fallback/stubs/Pillow/PIL/MpegImagePlugin.pyi +0 -18
  178. package/dist/typeshed-fallback/stubs/Pillow/PIL/MpoImagePlugin.pyi +0 -15
  179. package/dist/typeshed-fallback/stubs/Pillow/PIL/MspImagePlugin.pyi +0 -10
  180. package/dist/typeshed-fallback/stubs/Pillow/PIL/PSDraw.pyi +0 -19
  181. package/dist/typeshed-fallback/stubs/Pillow/PIL/PaletteFile.pyi +0 -7
  182. package/dist/typeshed-fallback/stubs/Pillow/PIL/PalmImagePlugin.pyi +0 -5
  183. package/dist/typeshed-fallback/stubs/Pillow/PIL/PcdImagePlugin.pyi +0 -10
  184. package/dist/typeshed-fallback/stubs/Pillow/PIL/PcfFontFile.pyi +0 -25
  185. package/dist/typeshed-fallback/stubs/Pillow/PIL/PcxImagePlugin.pyi +0 -10
  186. package/dist/typeshed-fallback/stubs/Pillow/PIL/PdfParser.pyi +0 -167
  187. package/dist/typeshed-fallback/stubs/Pillow/PIL/PixarImagePlugin.pyi +0 -7
  188. package/dist/typeshed-fallback/stubs/Pillow/PIL/PngImagePlugin.pyi +0 -115
  189. package/dist/typeshed-fallback/stubs/Pillow/PIL/PpmImagePlugin.pyi +0 -17
  190. package/dist/typeshed-fallback/stubs/Pillow/PIL/PsdImagePlugin.pyi +0 -17
  191. package/dist/typeshed-fallback/stubs/Pillow/PIL/PyAccess.pyi +0 -69
  192. package/dist/typeshed-fallback/stubs/Pillow/PIL/QoiImagePlugin.pyi +0 -11
  193. package/dist/typeshed-fallback/stubs/Pillow/PIL/SgiImagePlugin.pyi +0 -13
  194. package/dist/typeshed-fallback/stubs/Pillow/PIL/SpiderImagePlugin.pyi +0 -28
  195. package/dist/typeshed-fallback/stubs/Pillow/PIL/SunImagePlugin.pyi +0 -7
  196. package/dist/typeshed-fallback/stubs/Pillow/PIL/TarIO.pyi +0 -12
  197. package/dist/typeshed-fallback/stubs/Pillow/PIL/TgaImagePlugin.pyi +0 -12
  198. package/dist/typeshed-fallback/stubs/Pillow/PIL/TiffImagePlugin.pyi +0 -295
  199. package/dist/typeshed-fallback/stubs/Pillow/PIL/TiffTags.pyi +0 -46
  200. package/dist/typeshed-fallback/stubs/Pillow/PIL/WalImageFile.pyi +0 -14
  201. package/dist/typeshed-fallback/stubs/Pillow/PIL/WebPImagePlugin.pyi +0 -18
  202. package/dist/typeshed-fallback/stubs/Pillow/PIL/WmfImagePlugin.pyi +0 -19
  203. package/dist/typeshed-fallback/stubs/Pillow/PIL/XVThumbImagePlugin.pyi +0 -9
  204. package/dist/typeshed-fallback/stubs/Pillow/PIL/XbmImagePlugin.pyi +0 -10
  205. package/dist/typeshed-fallback/stubs/Pillow/PIL/XpmImagePlugin.pyi +0 -11
  206. package/dist/typeshed-fallback/stubs/Pillow/PIL/__init__.pyi +0 -3
  207. package/dist/typeshed-fallback/stubs/Pillow/PIL/_binary.pyi +0 -13
  208. package/dist/typeshed-fallback/stubs/Pillow/PIL/_imaging.pyi +0 -29
  209. package/dist/typeshed-fallback/stubs/Pillow/PIL/_tkinter_finder.pyi +0 -2
  210. package/dist/typeshed-fallback/stubs/Pillow/PIL/_version.pyi +0 -1
  211. package/dist/typeshed-fallback/stubs/Pillow/PIL/features.pyi +0 -23
  212. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone_cache.pyi +0 -0
  213. /package/dist/typeshed-fallback/stubs/icalendar/icalendar/{windows_to_olson.pyi → timezone/windows_to_olson.pyi} +0 -0
  214. /package/dist/typeshed-fallback/stubs/{Pillow/PIL/PdfImagePlugin.pyi → jwcrypto/jwcrypto/__init__.pyi} +0 -0
@@ -1,1676 +1,149 @@
1
1
  import sys
2
- import typing_extensions
3
- from typing import Any, ClassVar, Generic, Literal, TypedDict, overload
4
- from typing_extensions import Self, Unpack
2
+ from ast import (
3
+ AST as AST,
4
+ Add as Add,
5
+ And as And,
6
+ AnnAssign as AnnAssign,
7
+ Assert as Assert,
8
+ Assign as Assign,
9
+ AsyncFor as AsyncFor,
10
+ AsyncFunctionDef as AsyncFunctionDef,
11
+ AsyncWith as AsyncWith,
12
+ Attribute as Attribute,
13
+ AugAssign as AugAssign,
14
+ Await as Await,
15
+ BinOp as BinOp,
16
+ BitAnd as BitAnd,
17
+ BitOr as BitOr,
18
+ BitXor as BitXor,
19
+ BoolOp as BoolOp,
20
+ Break as Break,
21
+ Call as Call,
22
+ ClassDef as ClassDef,
23
+ Compare as Compare,
24
+ Constant as Constant,
25
+ Continue as Continue,
26
+ Del as Del,
27
+ Delete as Delete,
28
+ Dict as Dict,
29
+ DictComp as DictComp,
30
+ Div as Div,
31
+ Eq as Eq,
32
+ ExceptHandler as ExceptHandler,
33
+ Expr as Expr,
34
+ Expression as Expression,
35
+ FloorDiv as FloorDiv,
36
+ For as For,
37
+ FormattedValue as FormattedValue,
38
+ FunctionDef as FunctionDef,
39
+ FunctionType as FunctionType,
40
+ GeneratorExp as GeneratorExp,
41
+ Global as Global,
42
+ Gt as Gt,
43
+ GtE as GtE,
44
+ If as If,
45
+ IfExp as IfExp,
46
+ Import as Import,
47
+ ImportFrom as ImportFrom,
48
+ In as In,
49
+ Interactive as Interactive,
50
+ Invert as Invert,
51
+ Is as Is,
52
+ IsNot as IsNot,
53
+ JoinedStr as JoinedStr,
54
+ Lambda as Lambda,
55
+ List as List,
56
+ ListComp as ListComp,
57
+ Load as Load,
58
+ LShift as LShift,
59
+ Lt as Lt,
60
+ LtE as LtE,
61
+ MatMult as MatMult,
62
+ Mod as Mod,
63
+ Module as Module,
64
+ Mult as Mult,
65
+ Name as Name,
66
+ NamedExpr as NamedExpr,
67
+ Nonlocal as Nonlocal,
68
+ Not as Not,
69
+ NotEq as NotEq,
70
+ NotIn as NotIn,
71
+ Or as Or,
72
+ Pass as Pass,
73
+ Pow as Pow,
74
+ Raise as Raise,
75
+ Return as Return,
76
+ RShift as RShift,
77
+ Set as Set,
78
+ SetComp as SetComp,
79
+ Slice as Slice,
80
+ Starred as Starred,
81
+ Store as Store,
82
+ Sub as Sub,
83
+ Subscript as Subscript,
84
+ Try as Try,
85
+ Tuple as Tuple,
86
+ TypeIgnore as TypeIgnore,
87
+ UAdd as UAdd,
88
+ UnaryOp as UnaryOp,
89
+ USub as USub,
90
+ While as While,
91
+ With as With,
92
+ Yield as Yield,
93
+ YieldFrom as YieldFrom,
94
+ alias as alias,
95
+ arg as arg,
96
+ arguments as arguments,
97
+ boolop as boolop,
98
+ cmpop as cmpop,
99
+ comprehension as comprehension,
100
+ excepthandler as excepthandler,
101
+ expr as expr,
102
+ expr_context as expr_context,
103
+ keyword as keyword,
104
+ mod as mod,
105
+ operator as operator,
106
+ stmt as stmt,
107
+ type_ignore as type_ignore,
108
+ unaryop as unaryop,
109
+ withitem as withitem,
110
+ )
111
+ from typing import Literal
5
112
 
6
- PyCF_ONLY_AST: Literal[1024]
7
- PyCF_TYPE_COMMENTS: Literal[4096]
8
- PyCF_ALLOW_TOP_LEVEL_AWAIT: Literal[8192]
9
-
10
- if sys.version_info >= (3, 13):
11
- PyCF_OPTIMIZED_AST: Literal[33792]
12
-
13
- # Used for node end positions in constructor keyword arguments
14
- _EndPositionT = typing_extensions.TypeVar("_EndPositionT", int, int | None, default=int | None)
15
-
16
- # Alias used for fields that must always be valid identifiers
17
- # A string `x` counts as a valid identifier if both the following are True
18
- # (1) `x.isidentifier()` evaluates to `True`
19
- # (2) `keyword.iskeyword(x)` evaluates to `False`
20
- _Identifier: typing_extensions.TypeAlias = str
21
-
22
- # Corresponds to the names in the `_attributes` class variable which is non-empty in certain AST nodes
23
- class _Attributes(TypedDict, Generic[_EndPositionT], total=False):
24
- lineno: int
25
- col_offset: int
26
- end_lineno: _EndPositionT
27
- end_col_offset: _EndPositionT
28
-
29
- class AST:
30
- if sys.version_info >= (3, 10):
31
- __match_args__ = ()
32
- _attributes: ClassVar[tuple[str, ...]]
33
- _fields: ClassVar[tuple[str, ...]]
34
- if sys.version_info >= (3, 13):
35
- _field_types: ClassVar[dict[str, Any]]
36
-
37
- if sys.version_info >= (3, 14):
38
- def __replace__(self) -> Self: ...
39
-
40
- class mod(AST): ...
41
- class type_ignore(AST): ...
42
-
43
- class TypeIgnore(type_ignore):
44
- if sys.version_info >= (3, 10):
45
- __match_args__ = ("lineno", "tag")
46
- lineno: int
47
- tag: str
48
- def __init__(self, lineno: int, tag: str) -> None: ...
49
-
50
- if sys.version_info >= (3, 14):
51
- def __replace__(self, *, lineno: int = ..., tag: str = ...) -> Self: ...
52
-
53
- class FunctionType(mod):
54
- if sys.version_info >= (3, 10):
55
- __match_args__ = ("argtypes", "returns")
56
- argtypes: list[expr]
57
- returns: expr
58
- if sys.version_info >= (3, 13):
59
- @overload
60
- def __init__(self, argtypes: list[expr], returns: expr) -> None: ...
61
- @overload
62
- def __init__(self, argtypes: list[expr] = ..., *, returns: expr) -> None: ...
63
- else:
64
- def __init__(self, argtypes: list[expr], returns: expr) -> None: ...
65
-
66
- if sys.version_info >= (3, 14):
67
- def __replace__(self, *, argtypes: list[expr] = ..., returns: expr = ...) -> Self: ...
68
-
69
- class Module(mod):
70
- if sys.version_info >= (3, 10):
71
- __match_args__ = ("body", "type_ignores")
72
- body: list[stmt]
73
- type_ignores: list[TypeIgnore]
74
- if sys.version_info >= (3, 13):
75
- def __init__(self, body: list[stmt] = ..., type_ignores: list[TypeIgnore] = ...) -> None: ...
76
- else:
77
- def __init__(self, body: list[stmt], type_ignores: list[TypeIgnore]) -> None: ...
78
-
79
- if sys.version_info >= (3, 14):
80
- def __replace__(self, *, body: list[stmt] = ..., type_ignores: list[TypeIgnore] = ...) -> Self: ...
81
-
82
- class Interactive(mod):
83
- if sys.version_info >= (3, 10):
84
- __match_args__ = ("body",)
85
- body: list[stmt]
86
- if sys.version_info >= (3, 13):
87
- def __init__(self, body: list[stmt] = ...) -> None: ...
88
- else:
89
- def __init__(self, body: list[stmt]) -> None: ...
90
-
91
- if sys.version_info >= (3, 14):
92
- def __replace__(self, *, body: list[stmt] = ...) -> Self: ...
93
-
94
- class Expression(mod):
95
- if sys.version_info >= (3, 10):
96
- __match_args__ = ("body",)
97
- body: expr
98
- def __init__(self, body: expr) -> None: ...
99
-
100
- if sys.version_info >= (3, 14):
101
- def __replace__(self, *, body: expr = ...) -> Self: ...
102
-
103
- class stmt(AST):
104
- lineno: int
105
- col_offset: int
106
- end_lineno: int | None
107
- end_col_offset: int | None
108
- def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ...
109
-
110
- if sys.version_info >= (3, 14):
111
- def __replace__(self, **kwargs: Unpack[_Attributes]) -> Self: ...
112
-
113
- class FunctionDef(stmt):
114
- if sys.version_info >= (3, 12):
115
- __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment", "type_params")
116
- elif sys.version_info >= (3, 10):
117
- __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment")
118
- name: _Identifier
119
- args: arguments
120
- body: list[stmt]
121
- decorator_list: list[expr]
122
- returns: expr | None
123
- type_comment: str | None
124
- if sys.version_info >= (3, 12):
125
- type_params: list[type_param]
126
- if sys.version_info >= (3, 13):
127
- def __init__(
128
- self,
129
- name: _Identifier,
130
- args: arguments,
131
- body: list[stmt] = ...,
132
- decorator_list: list[expr] = ...,
133
- returns: expr | None = None,
134
- type_comment: str | None = None,
135
- type_params: list[type_param] = ...,
136
- **kwargs: Unpack[_Attributes],
137
- ) -> None: ...
138
- elif sys.version_info >= (3, 12):
139
- @overload
140
- def __init__(
141
- self,
142
- name: _Identifier,
143
- args: arguments,
144
- body: list[stmt],
145
- decorator_list: list[expr],
146
- returns: expr | None,
147
- type_comment: str | None,
148
- type_params: list[type_param],
149
- **kwargs: Unpack[_Attributes],
150
- ) -> None: ...
151
- @overload
152
- def __init__(
153
- self,
154
- name: _Identifier,
155
- args: arguments,
156
- body: list[stmt],
157
- decorator_list: list[expr],
158
- returns: expr | None = None,
159
- type_comment: str | None = None,
160
- *,
161
- type_params: list[type_param],
162
- **kwargs: Unpack[_Attributes],
163
- ) -> None: ...
164
- else:
165
- def __init__(
166
- self,
167
- name: _Identifier,
168
- args: arguments,
169
- body: list[stmt],
170
- decorator_list: list[expr],
171
- returns: expr | None = None,
172
- type_comment: str | None = None,
173
- **kwargs: Unpack[_Attributes],
174
- ) -> None: ...
175
-
176
- if sys.version_info >= (3, 14):
177
- def __replace__(
178
- self,
179
- *,
180
- name: _Identifier = ...,
181
- args: arguments = ...,
182
- body: list[stmt] = ...,
183
- decorator_list: list[expr] = ...,
184
- returns: expr | None = ...,
185
- type_comment: str | None = ...,
186
- type_params: list[type_param] = ...,
187
- ) -> Self: ...
188
-
189
- class AsyncFunctionDef(stmt):
190
- if sys.version_info >= (3, 12):
191
- __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment", "type_params")
192
- elif sys.version_info >= (3, 10):
193
- __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment")
194
- name: _Identifier
195
- args: arguments
196
- body: list[stmt]
197
- decorator_list: list[expr]
198
- returns: expr | None
199
- type_comment: str | None
200
- if sys.version_info >= (3, 12):
201
- type_params: list[type_param]
202
- if sys.version_info >= (3, 13):
203
- def __init__(
204
- self,
205
- name: _Identifier,
206
- args: arguments,
207
- body: list[stmt] = ...,
208
- decorator_list: list[expr] = ...,
209
- returns: expr | None = None,
210
- type_comment: str | None = None,
211
- type_params: list[type_param] = ...,
212
- **kwargs: Unpack[_Attributes],
213
- ) -> None: ...
214
- elif sys.version_info >= (3, 12):
215
- @overload
216
- def __init__(
217
- self,
218
- name: _Identifier,
219
- args: arguments,
220
- body: list[stmt],
221
- decorator_list: list[expr],
222
- returns: expr | None,
223
- type_comment: str | None,
224
- type_params: list[type_param],
225
- **kwargs: Unpack[_Attributes],
226
- ) -> None: ...
227
- @overload
228
- def __init__(
229
- self,
230
- name: _Identifier,
231
- args: arguments,
232
- body: list[stmt],
233
- decorator_list: list[expr],
234
- returns: expr | None = None,
235
- type_comment: str | None = None,
236
- *,
237
- type_params: list[type_param],
238
- **kwargs: Unpack[_Attributes],
239
- ) -> None: ...
240
- else:
241
- def __init__(
242
- self,
243
- name: _Identifier,
244
- args: arguments,
245
- body: list[stmt],
246
- decorator_list: list[expr],
247
- returns: expr | None = None,
248
- type_comment: str | None = None,
249
- **kwargs: Unpack[_Attributes],
250
- ) -> None: ...
251
-
252
- if sys.version_info >= (3, 14):
253
- def __replace__(
254
- self,
255
- *,
256
- name: _Identifier = ...,
257
- args: arguments = ...,
258
- body: list[stmt],
259
- decorator_list: list[expr],
260
- returns: expr | None,
261
- type_comment: str | None,
262
- type_params: list[type_param],
263
- ) -> Self: ...
264
-
265
- class ClassDef(stmt):
266
- if sys.version_info >= (3, 12):
267
- __match_args__ = ("name", "bases", "keywords", "body", "decorator_list", "type_params")
268
- elif sys.version_info >= (3, 10):
269
- __match_args__ = ("name", "bases", "keywords", "body", "decorator_list")
270
- name: _Identifier
271
- bases: list[expr]
272
- keywords: list[keyword]
273
- body: list[stmt]
274
- decorator_list: list[expr]
275
- if sys.version_info >= (3, 12):
276
- type_params: list[type_param]
277
- if sys.version_info >= (3, 13):
278
- def __init__(
279
- self,
280
- name: _Identifier,
281
- bases: list[expr] = ...,
282
- keywords: list[keyword] = ...,
283
- body: list[stmt] = ...,
284
- decorator_list: list[expr] = ...,
285
- type_params: list[type_param] = ...,
286
- **kwargs: Unpack[_Attributes],
287
- ) -> None: ...
288
- elif sys.version_info >= (3, 12):
289
- def __init__(
290
- self,
291
- name: _Identifier,
292
- bases: list[expr],
293
- keywords: list[keyword],
294
- body: list[stmt],
295
- decorator_list: list[expr],
296
- type_params: list[type_param],
297
- **kwargs: Unpack[_Attributes],
298
- ) -> None: ...
299
- else:
300
- def __init__(
301
- self,
302
- name: _Identifier,
303
- bases: list[expr],
304
- keywords: list[keyword],
305
- body: list[stmt],
306
- decorator_list: list[expr],
307
- **kwargs: Unpack[_Attributes],
308
- ) -> None: ...
309
-
310
- if sys.version_info >= (3, 14):
311
- def __replace__(
312
- self,
313
- *,
314
- name: _Identifier,
315
- bases: list[expr],
316
- keywords: list[keyword],
317
- body: list[stmt],
318
- decorator_list: list[expr],
319
- type_params: list[type_param],
320
- **kwargs: Unpack[_Attributes],
321
- ) -> Self: ...
322
-
323
- class Return(stmt):
324
- if sys.version_info >= (3, 10):
325
- __match_args__ = ("value",)
326
- value: expr | None
327
- def __init__(self, value: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
328
-
329
- if sys.version_info >= (3, 14):
330
- def __replace__(self, *, value: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
331
-
332
- class Delete(stmt):
333
- if sys.version_info >= (3, 10):
334
- __match_args__ = ("targets",)
335
- targets: list[expr]
336
- if sys.version_info >= (3, 13):
337
- def __init__(self, targets: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
338
- else:
339
- def __init__(self, targets: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
340
-
341
- if sys.version_info >= (3, 14):
342
- def __replace__(self, *, targets: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
343
-
344
- class Assign(stmt):
345
- if sys.version_info >= (3, 10):
346
- __match_args__ = ("targets", "value", "type_comment")
347
- targets: list[expr]
348
- value: expr
349
- type_comment: str | None
350
- if sys.version_info >= (3, 13):
351
- @overload
352
- def __init__(
353
- self, targets: list[expr], value: expr, type_comment: str | None = None, **kwargs: Unpack[_Attributes]
354
- ) -> None: ...
355
- @overload
356
- def __init__(
357
- self, targets: list[expr] = ..., *, value: expr, type_comment: str | None = None, **kwargs: Unpack[_Attributes]
358
- ) -> None: ...
359
- else:
360
- def __init__(
361
- self, targets: list[expr], value: expr, type_comment: str | None = None, **kwargs: Unpack[_Attributes]
362
- ) -> None: ...
363
-
364
- if sys.version_info >= (3, 14):
365
- def __replace__(
366
- self, *, targets: list[expr] = ..., value: expr = ..., type_comment: str | None = ..., **kwargs: Unpack[_Attributes]
367
- ) -> Self: ...
368
-
369
- class AugAssign(stmt):
370
- if sys.version_info >= (3, 10):
371
- __match_args__ = ("target", "op", "value")
372
- target: Name | Attribute | Subscript
373
- op: operator
374
- value: expr
375
- def __init__(
376
- self, target: Name | Attribute | Subscript, op: operator, value: expr, **kwargs: Unpack[_Attributes]
377
- ) -> None: ...
378
-
379
- if sys.version_info >= (3, 14):
380
- def __replace__(
381
- self,
382
- *,
383
- target: Name | Attribute | Subscript = ...,
384
- op: operator = ...,
385
- value: expr = ...,
386
- **kwargs: Unpack[_Attributes],
387
- ) -> Self: ...
388
-
389
- class AnnAssign(stmt):
390
- if sys.version_info >= (3, 10):
391
- __match_args__ = ("target", "annotation", "value", "simple")
392
- target: Name | Attribute | Subscript
393
- annotation: expr
394
- value: expr | None
395
- simple: int
396
- @overload
397
- def __init__(
398
- self,
399
- target: Name | Attribute | Subscript,
400
- annotation: expr,
401
- value: expr | None,
402
- simple: int,
403
- **kwargs: Unpack[_Attributes],
404
- ) -> None: ...
405
- @overload
406
- def __init__(
407
- self,
408
- target: Name | Attribute | Subscript,
409
- annotation: expr,
410
- value: expr | None = None,
411
- *,
412
- simple: int,
413
- **kwargs: Unpack[_Attributes],
414
- ) -> None: ...
415
-
416
- if sys.version_info >= (3, 14):
417
- def __replace__(
418
- self,
419
- *,
420
- target: Name | Attribute | Subscript = ...,
421
- annotation: expr = ...,
422
- value: expr | None = ...,
423
- simple: int = ...,
424
- **kwargs: Unpack[_Attributes],
425
- ) -> Self: ...
426
-
427
- class For(stmt):
428
- if sys.version_info >= (3, 10):
429
- __match_args__ = ("target", "iter", "body", "orelse", "type_comment")
430
- target: expr
431
- iter: expr
432
- body: list[stmt]
433
- orelse: list[stmt]
434
- type_comment: str | None
435
- if sys.version_info >= (3, 13):
436
- def __init__(
437
- self,
438
- target: expr,
439
- iter: expr,
440
- body: list[stmt] = ...,
441
- orelse: list[stmt] = ...,
442
- type_comment: str | None = None,
443
- **kwargs: Unpack[_Attributes],
444
- ) -> None: ...
445
- else:
446
- def __init__(
447
- self,
448
- target: expr,
449
- iter: expr,
450
- body: list[stmt],
451
- orelse: list[stmt],
452
- type_comment: str | None = None,
453
- **kwargs: Unpack[_Attributes],
454
- ) -> None: ...
455
-
456
- if sys.version_info >= (3, 14):
457
- def __replace__(
458
- self,
459
- *,
460
- target: expr = ...,
461
- iter: expr = ...,
462
- body: list[stmt] = ...,
463
- orelse: list[stmt] = ...,
464
- type_comment: str | None = ...,
465
- **kwargs: Unpack[_Attributes],
466
- ) -> Self: ...
467
-
468
- class AsyncFor(stmt):
469
- if sys.version_info >= (3, 10):
470
- __match_args__ = ("target", "iter", "body", "orelse", "type_comment")
471
- target: expr
472
- iter: expr
473
- body: list[stmt]
474
- orelse: list[stmt]
475
- type_comment: str | None
476
- if sys.version_info >= (3, 13):
477
- def __init__(
478
- self,
479
- target: expr,
480
- iter: expr,
481
- body: list[stmt] = ...,
482
- orelse: list[stmt] = ...,
483
- type_comment: str | None = None,
484
- **kwargs: Unpack[_Attributes],
485
- ) -> None: ...
486
- else:
487
- def __init__(
488
- self,
489
- target: expr,
490
- iter: expr,
491
- body: list[stmt],
492
- orelse: list[stmt],
493
- type_comment: str | None = None,
494
- **kwargs: Unpack[_Attributes],
495
- ) -> None: ...
496
-
497
- if sys.version_info >= (3, 14):
498
- def __replace__(
499
- self,
500
- *,
501
- target: expr = ...,
502
- iter: expr = ...,
503
- body: list[stmt] = ...,
504
- orelse: list[stmt] = ...,
505
- type_comment: str | None = ...,
506
- **kwargs: Unpack[_Attributes],
507
- ) -> Self: ...
508
-
509
- class While(stmt):
510
- if sys.version_info >= (3, 10):
511
- __match_args__ = ("test", "body", "orelse")
512
- test: expr
513
- body: list[stmt]
514
- orelse: list[stmt]
515
- if sys.version_info >= (3, 13):
516
- def __init__(
517
- self, test: expr, body: list[stmt] = ..., orelse: list[stmt] = ..., **kwargs: Unpack[_Attributes]
518
- ) -> None: ...
519
- else:
520
- def __init__(self, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> None: ...
521
-
522
- if sys.version_info >= (3, 14):
523
- def __replace__(self, *, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> Self: ...
524
-
525
- class If(stmt):
526
- if sys.version_info >= (3, 10):
527
- __match_args__ = ("test", "body", "orelse")
528
- test: expr
529
- body: list[stmt]
530
- orelse: list[stmt]
531
- if sys.version_info >= (3, 13):
532
- def __init__(
533
- self, test: expr, body: list[stmt] = ..., orelse: list[stmt] = ..., **kwargs: Unpack[_Attributes]
534
- ) -> None: ...
535
- else:
536
- def __init__(self, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> None: ...
537
-
538
- if sys.version_info >= (3, 14):
539
- def __replace__(
540
- self, *, test: expr = ..., body: list[stmt] = ..., orelse: list[stmt] = ..., **kwargs: Unpack[_Attributes]
541
- ) -> Self: ...
542
-
543
- class With(stmt):
544
- if sys.version_info >= (3, 10):
545
- __match_args__ = ("items", "body", "type_comment")
546
- items: list[withitem]
547
- body: list[stmt]
548
- type_comment: str | None
549
- if sys.version_info >= (3, 13):
550
- def __init__(
551
- self,
552
- items: list[withitem] = ...,
553
- body: list[stmt] = ...,
554
- type_comment: str | None = None,
555
- **kwargs: Unpack[_Attributes],
556
- ) -> None: ...
557
- else:
558
- def __init__(
559
- self, items: list[withitem], body: list[stmt], type_comment: str | None = None, **kwargs: Unpack[_Attributes]
560
- ) -> None: ...
561
-
562
- if sys.version_info >= (3, 14):
563
- def __replace__(
564
- self,
565
- *,
566
- items: list[withitem] = ...,
567
- body: list[stmt] = ...,
568
- type_comment: str | None = ...,
569
- **kwargs: Unpack[_Attributes],
570
- ) -> Self: ...
571
-
572
- class AsyncWith(stmt):
573
- if sys.version_info >= (3, 10):
574
- __match_args__ = ("items", "body", "type_comment")
575
- items: list[withitem]
576
- body: list[stmt]
577
- type_comment: str | None
578
- if sys.version_info >= (3, 13):
579
- def __init__(
580
- self,
581
- items: list[withitem] = ...,
582
- body: list[stmt] = ...,
583
- type_comment: str | None = None,
584
- **kwargs: Unpack[_Attributes],
585
- ) -> None: ...
586
- else:
587
- def __init__(
588
- self, items: list[withitem], body: list[stmt], type_comment: str | None = None, **kwargs: Unpack[_Attributes]
589
- ) -> None: ...
590
-
591
- if sys.version_info >= (3, 14):
592
- def __replace__(
593
- self,
594
- *,
595
- items: list[withitem] = ...,
596
- body: list[stmt] = ...,
597
- type_comment: str | None = ...,
598
- **kwargs: Unpack[_Attributes],
599
- ) -> Self: ...
600
-
601
- class Raise(stmt):
602
- if sys.version_info >= (3, 10):
603
- __match_args__ = ("exc", "cause")
604
- exc: expr | None
605
- cause: expr | None
606
- def __init__(self, exc: expr | None = None, cause: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
607
-
608
- if sys.version_info >= (3, 14):
609
- def __replace__(self, *, exc: expr | None = ..., cause: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
610
-
611
- class Try(stmt):
612
- if sys.version_info >= (3, 10):
613
- __match_args__ = ("body", "handlers", "orelse", "finalbody")
614
- body: list[stmt]
615
- handlers: list[ExceptHandler]
616
- orelse: list[stmt]
617
- finalbody: list[stmt]
618
- if sys.version_info >= (3, 13):
619
- def __init__(
620
- self,
621
- body: list[stmt] = ...,
622
- handlers: list[ExceptHandler] = ...,
623
- orelse: list[stmt] = ...,
624
- finalbody: list[stmt] = ...,
625
- **kwargs: Unpack[_Attributes],
626
- ) -> None: ...
627
- else:
628
- def __init__(
629
- self,
630
- body: list[stmt],
631
- handlers: list[ExceptHandler],
632
- orelse: list[stmt],
633
- finalbody: list[stmt],
634
- **kwargs: Unpack[_Attributes],
635
- ) -> None: ...
636
-
637
- if sys.version_info >= (3, 14):
638
- def __replace__(
639
- self,
640
- *,
641
- body: list[stmt] = ...,
642
- handlers: list[ExceptHandler] = ...,
643
- orelse: list[stmt] = ...,
644
- finalbody: list[stmt] = ...,
645
- **kwargs: Unpack[_Attributes],
646
- ) -> Self: ...
113
+ if sys.version_info >= (3, 12):
114
+ from ast import ParamSpec as ParamSpec, TypeVar as TypeVar, TypeVarTuple as TypeVarTuple, type_param as type_param
647
115
 
648
116
  if sys.version_info >= (3, 11):
649
- class TryStar(stmt):
650
- __match_args__ = ("body", "handlers", "orelse", "finalbody")
651
- body: list[stmt]
652
- handlers: list[ExceptHandler]
653
- orelse: list[stmt]
654
- finalbody: list[stmt]
655
- if sys.version_info >= (3, 13):
656
- def __init__(
657
- self,
658
- body: list[stmt] = ...,
659
- handlers: list[ExceptHandler] = ...,
660
- orelse: list[stmt] = ...,
661
- finalbody: list[stmt] = ...,
662
- **kwargs: Unpack[_Attributes],
663
- ) -> None: ...
664
- else:
665
- def __init__(
666
- self,
667
- body: list[stmt],
668
- handlers: list[ExceptHandler],
669
- orelse: list[stmt],
670
- finalbody: list[stmt],
671
- **kwargs: Unpack[_Attributes],
672
- ) -> None: ...
673
-
674
- if sys.version_info >= (3, 14):
675
- def __replace__(
676
- self,
677
- *,
678
- body: list[stmt] = ...,
679
- handlers: list[ExceptHandler] = ...,
680
- orelse: list[stmt] = ...,
681
- finalbody: list[stmt] = ...,
682
- **kwargs: Unpack[_Attributes],
683
- ) -> Self: ...
684
-
685
- class Assert(stmt):
686
- if sys.version_info >= (3, 10):
687
- __match_args__ = ("test", "msg")
688
- test: expr
689
- msg: expr | None
690
- def __init__(self, test: expr, msg: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
691
-
692
- if sys.version_info >= (3, 14):
693
- def __replace__(self, *, test: expr, msg: expr | None, **kwargs: Unpack[_Attributes]) -> Self: ...
694
-
695
- class Import(stmt):
696
- if sys.version_info >= (3, 10):
697
- __match_args__ = ("names",)
698
- names: list[alias]
699
- if sys.version_info >= (3, 13):
700
- def __init__(self, names: list[alias] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
701
- else:
702
- def __init__(self, names: list[alias], **kwargs: Unpack[_Attributes]) -> None: ...
703
-
704
- if sys.version_info >= (3, 14):
705
- def __replace__(self, *, names: list[alias] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
706
-
707
- class ImportFrom(stmt):
708
- if sys.version_info >= (3, 10):
709
- __match_args__ = ("module", "names", "level")
710
- module: str | None
711
- names: list[alias]
712
- level: int
713
- if sys.version_info >= (3, 13):
714
- @overload
715
- def __init__(self, module: str | None, names: list[alias], level: int, **kwargs: Unpack[_Attributes]) -> None: ...
716
- @overload
717
- def __init__(
718
- self, module: str | None = None, names: list[alias] = ..., *, level: int, **kwargs: Unpack[_Attributes]
719
- ) -> None: ...
720
- else:
721
- @overload
722
- def __init__(self, module: str | None, names: list[alias], level: int, **kwargs: Unpack[_Attributes]) -> None: ...
723
- @overload
724
- def __init__(
725
- self, module: str | None = None, *, names: list[alias], level: int, **kwargs: Unpack[_Attributes]
726
- ) -> None: ...
727
-
728
- if sys.version_info >= (3, 14):
729
- def __replace__(
730
- self, *, module: str | None = ..., names: list[alias] = ..., level: int = ..., **kwargs: Unpack[_Attributes]
731
- ) -> Self: ...
732
-
733
- class Global(stmt):
734
- if sys.version_info >= (3, 10):
735
- __match_args__ = ("names",)
736
- names: list[_Identifier]
737
- if sys.version_info >= (3, 13):
738
- def __init__(self, names: list[_Identifier] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
739
- else:
740
- def __init__(self, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> None: ...
741
-
742
- if sys.version_info >= (3, 14):
743
- def __replace__(self, *, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> Self: ...
744
-
745
- class Nonlocal(stmt):
746
- if sys.version_info >= (3, 10):
747
- __match_args__ = ("names",)
748
- names: list[_Identifier]
749
- if sys.version_info >= (3, 13):
750
- def __init__(self, names: list[_Identifier] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
751
- else:
752
- def __init__(self, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> None: ...
753
-
754
- if sys.version_info >= (3, 14):
755
- def __replace__(self, *, names: list[_Identifier] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
756
-
757
- class Expr(stmt):
758
- if sys.version_info >= (3, 10):
759
- __match_args__ = ("value",)
760
- value: expr
761
- def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
762
-
763
- if sys.version_info >= (3, 14):
764
- def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
765
-
766
- class Pass(stmt): ...
767
- class Break(stmt): ...
768
- class Continue(stmt): ...
769
-
770
- class expr(AST):
771
- lineno: int
772
- col_offset: int
773
- end_lineno: int | None
774
- end_col_offset: int | None
775
- def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ...
776
-
777
- if sys.version_info >= (3, 14):
778
- def __replace__(self, **kwargs: Unpack[_Attributes]) -> Self: ...
779
-
780
- class BoolOp(expr):
781
- if sys.version_info >= (3, 10):
782
- __match_args__ = ("op", "values")
783
- op: boolop
784
- values: list[expr]
785
- if sys.version_info >= (3, 13):
786
- def __init__(self, op: boolop, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
787
- else:
788
- def __init__(self, op: boolop, values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
789
-
790
- if sys.version_info >= (3, 14):
791
- def __replace__(self, *, op: boolop = ..., values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
792
-
793
- class BinOp(expr):
794
- if sys.version_info >= (3, 10):
795
- __match_args__ = ("left", "op", "right")
796
- left: expr
797
- op: operator
798
- right: expr
799
- def __init__(self, left: expr, op: operator, right: expr, **kwargs: Unpack[_Attributes]) -> None: ...
800
-
801
- if sys.version_info >= (3, 14):
802
- def __replace__(
803
- self, *, left: expr = ..., op: operator = ..., right: expr = ..., **kwargs: Unpack[_Attributes]
804
- ) -> Self: ...
805
-
806
- class UnaryOp(expr):
807
- if sys.version_info >= (3, 10):
808
- __match_args__ = ("op", "operand")
809
- op: unaryop
810
- operand: expr
811
- def __init__(self, op: unaryop, operand: expr, **kwargs: Unpack[_Attributes]) -> None: ...
812
-
813
- if sys.version_info >= (3, 14):
814
- def __replace__(self, *, op: unaryop = ..., operand: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
815
-
816
- class Lambda(expr):
817
- if sys.version_info >= (3, 10):
818
- __match_args__ = ("args", "body")
819
- args: arguments
820
- body: expr
821
- def __init__(self, args: arguments, body: expr, **kwargs: Unpack[_Attributes]) -> None: ...
822
-
823
- if sys.version_info >= (3, 14):
824
- def __replace__(self, *, args: arguments = ..., body: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
825
-
826
- class IfExp(expr):
827
- if sys.version_info >= (3, 10):
828
- __match_args__ = ("test", "body", "orelse")
829
- test: expr
830
- body: expr
831
- orelse: expr
832
- def __init__(self, test: expr, body: expr, orelse: expr, **kwargs: Unpack[_Attributes]) -> None: ...
833
-
834
- if sys.version_info >= (3, 14):
835
- def __replace__(
836
- self, *, test: expr = ..., body: expr = ..., orelse: expr = ..., **kwargs: Unpack[_Attributes]
837
- ) -> Self: ...
838
-
839
- class Dict(expr):
840
- if sys.version_info >= (3, 10):
841
- __match_args__ = ("keys", "values")
842
- keys: list[expr | None]
843
- values: list[expr]
844
- if sys.version_info >= (3, 13):
845
- def __init__(self, keys: list[expr | None] = ..., values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
846
- else:
847
- def __init__(self, keys: list[expr | None], values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
848
-
849
- if sys.version_info >= (3, 14):
850
- def __replace__(
851
- self, *, keys: list[expr | None] = ..., values: list[expr] = ..., **kwargs: Unpack[_Attributes]
852
- ) -> Self: ...
853
-
854
- class Set(expr):
855
- if sys.version_info >= (3, 10):
856
- __match_args__ = ("elts",)
857
- elts: list[expr]
858
- if sys.version_info >= (3, 13):
859
- def __init__(self, elts: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
860
- else:
861
- def __init__(self, elts: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
862
-
863
- if sys.version_info >= (3, 14):
864
- def __replace__(self, *, elts: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
865
-
866
- class ListComp(expr):
867
- if sys.version_info >= (3, 10):
868
- __match_args__ = ("elt", "generators")
869
- elt: expr
870
- generators: list[comprehension]
871
- if sys.version_info >= (3, 13):
872
- def __init__(self, elt: expr, generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
873
- else:
874
- def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ...
875
-
876
- if sys.version_info >= (3, 14):
877
- def __replace__(
878
- self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]
879
- ) -> Self: ...
880
-
881
- class SetComp(expr):
882
- if sys.version_info >= (3, 10):
883
- __match_args__ = ("elt", "generators")
884
- elt: expr
885
- generators: list[comprehension]
886
- if sys.version_info >= (3, 13):
887
- def __init__(self, elt: expr, generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
888
- else:
889
- def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ...
890
-
891
- if sys.version_info >= (3, 14):
892
- def __replace__(
893
- self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]
894
- ) -> Self: ...
895
-
896
- class DictComp(expr):
897
- if sys.version_info >= (3, 10):
898
- __match_args__ = ("key", "value", "generators")
899
- key: expr
900
- value: expr
901
- generators: list[comprehension]
902
- if sys.version_info >= (3, 13):
903
- def __init__(
904
- self, key: expr, value: expr, generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]
905
- ) -> None: ...
906
- else:
907
- def __init__(self, key: expr, value: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ...
908
-
909
- if sys.version_info >= (3, 14):
910
- def __replace__(
911
- self, *, key: expr = ..., value: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]
912
- ) -> Self: ...
913
-
914
- class GeneratorExp(expr):
915
- if sys.version_info >= (3, 10):
916
- __match_args__ = ("elt", "generators")
917
- elt: expr
918
- generators: list[comprehension]
919
- if sys.version_info >= (3, 13):
920
- def __init__(self, elt: expr, generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
921
- else:
922
- def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ...
923
-
924
- if sys.version_info >= (3, 14):
925
- def __replace__(
926
- self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]
927
- ) -> Self: ...
928
-
929
- class Await(expr):
930
- if sys.version_info >= (3, 10):
931
- __match_args__ = ("value",)
932
- value: expr
933
- def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
934
-
935
- if sys.version_info >= (3, 14):
936
- def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
937
-
938
- class Yield(expr):
939
- if sys.version_info >= (3, 10):
940
- __match_args__ = ("value",)
941
- value: expr | None
942
- def __init__(self, value: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
943
-
944
- if sys.version_info >= (3, 14):
945
- def __replace__(self, *, value: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
946
-
947
- class YieldFrom(expr):
948
- if sys.version_info >= (3, 10):
949
- __match_args__ = ("value",)
950
- value: expr
951
- def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
952
-
953
- if sys.version_info >= (3, 14):
954
- def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
955
-
956
- class Compare(expr):
957
- if sys.version_info >= (3, 10):
958
- __match_args__ = ("left", "ops", "comparators")
959
- left: expr
960
- ops: list[cmpop]
961
- comparators: list[expr]
962
- if sys.version_info >= (3, 13):
963
- def __init__(
964
- self, left: expr, ops: list[cmpop] = ..., comparators: list[expr] = ..., **kwargs: Unpack[_Attributes]
965
- ) -> None: ...
966
- else:
967
- def __init__(self, left: expr, ops: list[cmpop], comparators: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
968
-
969
- if sys.version_info >= (3, 14):
970
- def __replace__(
971
- self, *, left: expr = ..., ops: list[cmpop] = ..., comparators: list[expr] = ..., **kwargs: Unpack[_Attributes]
972
- ) -> Self: ...
973
-
974
- class Call(expr):
975
- if sys.version_info >= (3, 10):
976
- __match_args__ = ("func", "args", "keywords")
977
- func: expr
978
- args: list[expr]
979
- keywords: list[keyword]
980
- if sys.version_info >= (3, 13):
981
- def __init__(
982
- self, func: expr, args: list[expr] = ..., keywords: list[keyword] = ..., **kwargs: Unpack[_Attributes]
983
- ) -> None: ...
984
- else:
985
- def __init__(self, func: expr, args: list[expr], keywords: list[keyword], **kwargs: Unpack[_Attributes]) -> None: ...
986
-
987
- if sys.version_info >= (3, 14):
988
- def __replace__(
989
- self, *, func: expr = ..., args: list[expr] = ..., keywords: list[keyword] = ..., **kwargs: Unpack[_Attributes]
990
- ) -> Self: ...
991
-
992
- class FormattedValue(expr):
993
- if sys.version_info >= (3, 10):
994
- __match_args__ = ("value", "conversion", "format_spec")
995
- value: expr
996
- conversion: int
997
- format_spec: expr | None
998
- def __init__(self, value: expr, conversion: int, format_spec: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
999
-
1000
- if sys.version_info >= (3, 14):
1001
- def __replace__(
1002
- self, *, value: expr = ..., conversion: int = ..., format_spec: expr | None = ..., **kwargs: Unpack[_Attributes]
1003
- ) -> Self: ...
1004
-
1005
- class JoinedStr(expr):
1006
- if sys.version_info >= (3, 10):
1007
- __match_args__ = ("values",)
1008
- values: list[expr]
1009
- if sys.version_info >= (3, 13):
1010
- def __init__(self, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1011
- else:
1012
- def __init__(self, values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
1013
-
1014
- if sys.version_info >= (3, 14):
1015
- def __replace__(self, *, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1016
-
1017
- class Constant(expr):
1018
- if sys.version_info >= (3, 10):
1019
- __match_args__ = ("value", "kind")
1020
- value: Any # None, str, bytes, bool, int, float, complex, Ellipsis
1021
- kind: str | None
1022
- if sys.version_info < (3, 14):
1023
- # Aliases for value, for backwards compatibility
1024
- s: Any
1025
- n: int | float | complex
1026
-
1027
- def __init__(self, value: Any, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
1028
-
1029
- if sys.version_info >= (3, 14):
1030
- def __replace__(self, *, value: Any = ..., kind: str | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1031
-
1032
- class NamedExpr(expr):
1033
- if sys.version_info >= (3, 10):
1034
- __match_args__ = ("target", "value")
1035
- target: Name
1036
- value: expr
1037
- def __init__(self, target: Name, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
1038
-
1039
- if sys.version_info >= (3, 14):
1040
- def __replace__(self, *, target: Name = ..., value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1041
-
1042
- class Attribute(expr):
1043
- if sys.version_info >= (3, 10):
1044
- __match_args__ = ("value", "attr", "ctx")
1045
- value: expr
1046
- attr: _Identifier
1047
- ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__`
1048
- def __init__(self, value: expr, attr: _Identifier, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1049
-
1050
- if sys.version_info >= (3, 14):
1051
- def __replace__(
1052
- self, *, value: expr = ..., attr: _Identifier = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]
1053
- ) -> Self: ...
1054
-
1055
- if sys.version_info >= (3, 9):
1056
- _Slice: typing_extensions.TypeAlias = expr
1057
- _SliceAttributes: typing_extensions.TypeAlias = _Attributes
1058
- else:
1059
- class slice(AST): ...
1060
- _Slice: typing_extensions.TypeAlias = slice
1061
-
1062
- class _SliceAttributes(TypedDict): ...
1063
-
1064
- class Slice(_Slice):
1065
- if sys.version_info >= (3, 10):
1066
- __match_args__ = ("lower", "upper", "step")
1067
- lower: expr | None
1068
- upper: expr | None
1069
- step: expr | None
1070
- def __init__(
1071
- self, lower: expr | None = None, upper: expr | None = None, step: expr | None = None, **kwargs: Unpack[_SliceAttributes]
1072
- ) -> None: ...
1073
-
1074
- if sys.version_info >= (3, 14):
1075
- def __replace__(
1076
- self,
1077
- *,
1078
- lower: expr | None = ...,
1079
- upper: expr | None = ...,
1080
- step: expr | None = ...,
1081
- **kwargs: Unpack[_SliceAttributes],
1082
- ) -> Self: ...
1083
-
1084
- if sys.version_info < (3, 9):
1085
- class ExtSlice(slice):
1086
- dims: list[slice]
1087
- def __init__(self, dims: list[slice], **kwargs: Unpack[_SliceAttributes]) -> None: ...
1088
-
1089
- class Index(slice):
1090
- value: expr
1091
- def __init__(self, value: expr, **kwargs: Unpack[_SliceAttributes]) -> None: ...
1092
-
1093
- class Subscript(expr):
1094
- if sys.version_info >= (3, 10):
1095
- __match_args__ = ("value", "slice", "ctx")
1096
- value: expr
1097
- slice: _Slice
1098
- ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__`
1099
- def __init__(self, value: expr, slice: _Slice, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1100
-
1101
- if sys.version_info >= (3, 14):
1102
- def __replace__(
1103
- self, *, value: expr = ..., slice: _Slice = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]
1104
- ) -> Self: ...
1105
-
1106
- class Starred(expr):
1107
- if sys.version_info >= (3, 10):
1108
- __match_args__ = ("value", "ctx")
1109
- value: expr
1110
- ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__`
1111
- def __init__(self, value: expr, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1112
-
1113
- if sys.version_info >= (3, 14):
1114
- def __replace__(self, *, value: expr = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1115
-
1116
- class Name(expr):
1117
- if sys.version_info >= (3, 10):
1118
- __match_args__ = ("id", "ctx")
1119
- id: _Identifier
1120
- ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__`
1121
- def __init__(self, id: _Identifier, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1122
-
1123
- if sys.version_info >= (3, 14):
1124
- def __replace__(self, *, id: _Identifier = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1125
-
1126
- class List(expr):
1127
- if sys.version_info >= (3, 10):
1128
- __match_args__ = ("elts", "ctx")
1129
- elts: list[expr]
1130
- ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__`
1131
- if sys.version_info >= (3, 13):
1132
- def __init__(self, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1133
- else:
1134
- def __init__(self, elts: list[expr], ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1135
-
1136
- if sys.version_info >= (3, 14):
1137
- def __replace__(self, *, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1138
-
1139
- class Tuple(expr):
1140
- if sys.version_info >= (3, 10):
1141
- __match_args__ = ("elts", "ctx")
1142
- elts: list[expr]
1143
- ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__`
1144
- if sys.version_info >= (3, 9):
1145
- dims: list[expr]
1146
- if sys.version_info >= (3, 13):
1147
- def __init__(self, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1148
- else:
1149
- def __init__(self, elts: list[expr], ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1150
-
1151
- if sys.version_info >= (3, 14):
1152
- def __replace__(self, *, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1153
-
1154
- class expr_context(AST): ...
1155
-
1156
- if sys.version_info < (3, 9):
1157
- class AugLoad(expr_context): ...
1158
- class AugStore(expr_context): ...
1159
- class Param(expr_context): ...
1160
-
1161
- class Suite(mod):
1162
- body: list[stmt]
1163
- def __init__(self, body: list[stmt]) -> None: ...
1164
-
1165
- class Del(expr_context): ...
1166
- class Load(expr_context): ...
1167
- class Store(expr_context): ...
1168
- class boolop(AST): ...
1169
- class And(boolop): ...
1170
- class Or(boolop): ...
1171
- class operator(AST): ...
1172
- class Add(operator): ...
1173
- class BitAnd(operator): ...
1174
- class BitOr(operator): ...
1175
- class BitXor(operator): ...
1176
- class Div(operator): ...
1177
- class FloorDiv(operator): ...
1178
- class LShift(operator): ...
1179
- class Mod(operator): ...
1180
- class Mult(operator): ...
1181
- class MatMult(operator): ...
1182
- class Pow(operator): ...
1183
- class RShift(operator): ...
1184
- class Sub(operator): ...
1185
- class unaryop(AST): ...
1186
- class Invert(unaryop): ...
1187
- class Not(unaryop): ...
1188
- class UAdd(unaryop): ...
1189
- class USub(unaryop): ...
1190
- class cmpop(AST): ...
1191
- class Eq(cmpop): ...
1192
- class Gt(cmpop): ...
1193
- class GtE(cmpop): ...
1194
- class In(cmpop): ...
1195
- class Is(cmpop): ...
1196
- class IsNot(cmpop): ...
1197
- class Lt(cmpop): ...
1198
- class LtE(cmpop): ...
1199
- class NotEq(cmpop): ...
1200
- class NotIn(cmpop): ...
1201
-
1202
- class comprehension(AST):
1203
- if sys.version_info >= (3, 10):
1204
- __match_args__ = ("target", "iter", "ifs", "is_async")
1205
- target: expr
1206
- iter: expr
1207
- ifs: list[expr]
1208
- is_async: int
1209
- if sys.version_info >= (3, 13):
1210
- @overload
1211
- def __init__(self, target: expr, iter: expr, ifs: list[expr], is_async: int) -> None: ...
1212
- @overload
1213
- def __init__(self, target: expr, iter: expr, ifs: list[expr] = ..., *, is_async: int) -> None: ...
1214
- else:
1215
- def __init__(self, target: expr, iter: expr, ifs: list[expr], is_async: int) -> None: ...
1216
-
1217
- if sys.version_info >= (3, 14):
1218
- def __replace__(self, *, target: expr = ..., iter: expr = ..., ifs: list[expr] = ..., is_async: int = ...) -> Self: ...
1219
-
1220
- class excepthandler(AST):
1221
- lineno: int
1222
- col_offset: int
1223
- end_lineno: int | None
1224
- end_col_offset: int | None
1225
- def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ...
1226
-
1227
- if sys.version_info >= (3, 14):
1228
- def __replace__(
1229
- self, *, lineno: int = ..., col_offset: int = ..., end_lineno: int | None = ..., end_col_offset: int | None = ...
1230
- ) -> Self: ...
1231
-
1232
- class ExceptHandler(excepthandler):
1233
- if sys.version_info >= (3, 10):
1234
- __match_args__ = ("type", "name", "body")
1235
- type: expr | None
1236
- name: _Identifier | None
1237
- body: list[stmt]
1238
- if sys.version_info >= (3, 13):
1239
- def __init__(
1240
- self, type: expr | None = None, name: _Identifier | None = None, body: list[stmt] = ..., **kwargs: Unpack[_Attributes]
1241
- ) -> None: ...
1242
- else:
1243
- @overload
1244
- def __init__(
1245
- self, type: expr | None, name: _Identifier | None, body: list[stmt], **kwargs: Unpack[_Attributes]
1246
- ) -> None: ...
1247
- @overload
1248
- def __init__(
1249
- self, type: expr | None = None, name: _Identifier | None = None, *, body: list[stmt], **kwargs: Unpack[_Attributes]
1250
- ) -> None: ...
1251
-
1252
- if sys.version_info >= (3, 14):
1253
- def __replace__(
1254
- self,
1255
- *,
1256
- type: expr | None = ...,
1257
- name: _Identifier | None = ...,
1258
- body: list[stmt] = ...,
1259
- **kwargs: Unpack[_Attributes],
1260
- ) -> Self: ...
1261
-
1262
- class arguments(AST):
1263
- if sys.version_info >= (3, 10):
1264
- __match_args__ = ("posonlyargs", "args", "vararg", "kwonlyargs", "kw_defaults", "kwarg", "defaults")
1265
- posonlyargs: list[arg]
1266
- args: list[arg]
1267
- vararg: arg | None
1268
- kwonlyargs: list[arg]
1269
- kw_defaults: list[expr | None]
1270
- kwarg: arg | None
1271
- defaults: list[expr]
1272
- if sys.version_info >= (3, 13):
1273
- def __init__(
1274
- self,
1275
- posonlyargs: list[arg] = ...,
1276
- args: list[arg] = ...,
1277
- vararg: arg | None = None,
1278
- kwonlyargs: list[arg] = ...,
1279
- kw_defaults: list[expr | None] = ...,
1280
- kwarg: arg | None = None,
1281
- defaults: list[expr] = ...,
1282
- ) -> None: ...
1283
- else:
1284
- @overload
1285
- def __init__(
1286
- self,
1287
- posonlyargs: list[arg],
1288
- args: list[arg],
1289
- vararg: arg | None,
1290
- kwonlyargs: list[arg],
1291
- kw_defaults: list[expr | None],
1292
- kwarg: arg | None,
1293
- defaults: list[expr],
1294
- ) -> None: ...
1295
- @overload
1296
- def __init__(
1297
- self,
1298
- posonlyargs: list[arg],
1299
- args: list[arg],
1300
- vararg: arg | None,
1301
- kwonlyargs: list[arg],
1302
- kw_defaults: list[expr | None],
1303
- kwarg: arg | None = None,
1304
- *,
1305
- defaults: list[expr],
1306
- ) -> None: ...
1307
- @overload
1308
- def __init__(
1309
- self,
1310
- posonlyargs: list[arg],
1311
- args: list[arg],
1312
- vararg: arg | None = None,
1313
- *,
1314
- kwonlyargs: list[arg],
1315
- kw_defaults: list[expr | None],
1316
- kwarg: arg | None = None,
1317
- defaults: list[expr],
1318
- ) -> None: ...
1319
-
1320
- if sys.version_info >= (3, 14):
1321
- def __replace__(
1322
- self,
1323
- *,
1324
- posonlyargs: list[arg] = ...,
1325
- args: list[arg] = ...,
1326
- vararg: arg | None = ...,
1327
- kwonlyargs: list[arg] = ...,
1328
- kw_defaults: list[expr | None] = ...,
1329
- kwarg: arg | None = ...,
1330
- defaults: list[expr] = ...,
1331
- ) -> Self: ...
1332
-
1333
- class arg(AST):
1334
- lineno: int
1335
- col_offset: int
1336
- end_lineno: int | None
1337
- end_col_offset: int | None
1338
- if sys.version_info >= (3, 10):
1339
- __match_args__ = ("arg", "annotation", "type_comment")
1340
- arg: _Identifier
1341
- annotation: expr | None
1342
- type_comment: str | None
1343
- def __init__(
1344
- self, arg: _Identifier, annotation: expr | None = None, type_comment: str | None = None, **kwargs: Unpack[_Attributes]
1345
- ) -> None: ...
1346
-
1347
- if sys.version_info >= (3, 14):
1348
- def __replace__(
1349
- self,
1350
- *,
1351
- arg: _Identifier = ...,
1352
- annotation: expr | None = ...,
1353
- type_comment: str | None = ...,
1354
- **kwargs: Unpack[_Attributes],
1355
- ) -> Self: ...
1356
-
1357
- class keyword(AST):
1358
- lineno: int
1359
- col_offset: int
1360
- end_lineno: int | None
1361
- end_col_offset: int | None
1362
- if sys.version_info >= (3, 10):
1363
- __match_args__ = ("arg", "value")
1364
- arg: _Identifier | None
1365
- value: expr
1366
- @overload
1367
- def __init__(self, arg: _Identifier | None, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
1368
- @overload
1369
- def __init__(self, arg: _Identifier | None = None, *, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
1370
-
1371
- if sys.version_info >= (3, 14):
1372
- def __replace__(self, *, arg: _Identifier | None = ..., value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1373
-
1374
- class alias(AST):
1375
- lineno: int
1376
- col_offset: int
1377
- end_lineno: int | None
1378
- end_col_offset: int | None
1379
- if sys.version_info >= (3, 10):
1380
- __match_args__ = ("name", "asname")
1381
- name: str
1382
- asname: _Identifier | None
1383
- def __init__(self, name: str, asname: _Identifier | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
1384
-
1385
- if sys.version_info >= (3, 14):
1386
- def __replace__(self, *, name: str = ..., asname: _Identifier | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1387
-
1388
- class withitem(AST):
1389
- if sys.version_info >= (3, 10):
1390
- __match_args__ = ("context_expr", "optional_vars")
1391
- context_expr: expr
1392
- optional_vars: expr | None
1393
- def __init__(self, context_expr: expr, optional_vars: expr | None = None) -> None: ...
1394
-
1395
- if sys.version_info >= (3, 14):
1396
- def __replace__(self, *, context_expr: expr = ..., optional_vars: expr | None = ...) -> Self: ...
117
+ from ast import TryStar as TryStar
1397
118
 
1398
119
  if sys.version_info >= (3, 10):
1399
- class Match(stmt):
1400
- __match_args__ = ("subject", "cases")
1401
- subject: expr
1402
- cases: list[match_case]
1403
- if sys.version_info >= (3, 13):
1404
- def __init__(self, subject: expr, cases: list[match_case] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
1405
- else:
1406
- def __init__(self, subject: expr, cases: list[match_case], **kwargs: Unpack[_Attributes]) -> None: ...
1407
-
1408
- if sys.version_info >= (3, 14):
1409
- def __replace__(
1410
- self, *, subject: expr = ..., cases: list[match_case] = ..., **kwargs: Unpack[_Attributes]
1411
- ) -> Self: ...
1412
-
1413
- class pattern(AST):
1414
- lineno: int
1415
- col_offset: int
1416
- end_lineno: int
1417
- end_col_offset: int
1418
- def __init__(self, **kwargs: Unpack[_Attributes[int]]) -> None: ...
1419
-
1420
- if sys.version_info >= (3, 14):
1421
- def __replace__(
1422
- self, *, lineno: int = ..., col_offset: int = ..., end_lineno: int = ..., end_col_offset: int = ...
1423
- ) -> Self: ...
1424
-
1425
- # Without the alias, Pyright complains variables named pattern are recursively defined
1426
- _Pattern: typing_extensions.TypeAlias = pattern
1427
-
1428
- class match_case(AST):
1429
- __match_args__ = ("pattern", "guard", "body")
1430
- pattern: _Pattern
1431
- guard: expr | None
1432
- body: list[stmt]
1433
- if sys.version_info >= (3, 13):
1434
- def __init__(self, pattern: _Pattern, guard: expr | None = None, body: list[stmt] = ...) -> None: ...
1435
- else:
1436
- @overload
1437
- def __init__(self, pattern: _Pattern, guard: expr | None, body: list[stmt]) -> None: ...
1438
- @overload
1439
- def __init__(self, pattern: _Pattern, guard: expr | None = None, *, body: list[stmt]) -> None: ...
1440
-
1441
- if sys.version_info >= (3, 14):
1442
- def __replace__(self, *, pattern: _Pattern = ..., guard: expr | None = ..., body: list[stmt] = ...) -> Self: ...
1443
-
1444
- class MatchValue(pattern):
1445
- __match_args__ = ("value",)
1446
- value: expr
1447
- def __init__(self, value: expr, **kwargs: Unpack[_Attributes[int]]) -> None: ...
1448
-
1449
- if sys.version_info >= (3, 14):
1450
- def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ...
1451
-
1452
- class MatchSingleton(pattern):
1453
- __match_args__ = ("value",)
1454
- value: Literal[True, False] | None
1455
- def __init__(self, value: Literal[True, False] | None, **kwargs: Unpack[_Attributes[int]]) -> None: ...
1456
-
1457
- if sys.version_info >= (3, 14):
1458
- def __replace__(self, *, value: Literal[True, False] | None = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ...
1459
-
1460
- class MatchSequence(pattern):
1461
- __match_args__ = ("patterns",)
1462
- patterns: list[pattern]
1463
- if sys.version_info >= (3, 13):
1464
- def __init__(self, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> None: ...
1465
- else:
1466
- def __init__(self, patterns: list[pattern], **kwargs: Unpack[_Attributes[int]]) -> None: ...
1467
-
1468
- if sys.version_info >= (3, 14):
1469
- def __replace__(self, *, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ...
1470
-
1471
- class MatchStar(pattern):
1472
- __match_args__ = ("name",)
1473
- name: _Identifier | None
1474
- def __init__(self, name: _Identifier | None, **kwargs: Unpack[_Attributes[int]]) -> None: ...
120
+ from ast import (
121
+ MatchAs as MatchAs,
122
+ MatchClass as MatchClass,
123
+ MatchMapping as MatchMapping,
124
+ MatchOr as MatchOr,
125
+ MatchSequence as MatchSequence,
126
+ MatchSingleton as MatchSingleton,
127
+ MatchStar as MatchStar,
128
+ MatchValue as MatchValue,
129
+ match_case as match_case,
130
+ pattern as pattern,
131
+ )
1475
132
 
1476
- if sys.version_info >= (3, 14):
1477
- def __replace__(self, *, name: _Identifier | None = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ...
1478
-
1479
- class MatchMapping(pattern):
1480
- __match_args__ = ("keys", "patterns", "rest")
1481
- keys: list[expr]
1482
- patterns: list[pattern]
1483
- rest: _Identifier | None
1484
- if sys.version_info >= (3, 13):
1485
- def __init__(
1486
- self,
1487
- keys: list[expr] = ...,
1488
- patterns: list[pattern] = ...,
1489
- rest: _Identifier | None = None,
1490
- **kwargs: Unpack[_Attributes[int]],
1491
- ) -> None: ...
1492
- else:
1493
- def __init__(
1494
- self,
1495
- keys: list[expr],
1496
- patterns: list[pattern],
1497
- rest: _Identifier | None = None,
1498
- **kwargs: Unpack[_Attributes[int]],
1499
- ) -> None: ...
1500
-
1501
- if sys.version_info >= (3, 14):
1502
- def __replace__(
1503
- self,
1504
- *,
1505
- keys: list[expr] = ...,
1506
- patterns: list[pattern] = ...,
1507
- rest: _Identifier | None = ...,
1508
- **kwargs: Unpack[_Attributes[int]],
1509
- ) -> Self: ...
1510
-
1511
- class MatchClass(pattern):
1512
- __match_args__ = ("cls", "patterns", "kwd_attrs", "kwd_patterns")
1513
- cls: expr
1514
- patterns: list[pattern]
1515
- kwd_attrs: list[_Identifier]
1516
- kwd_patterns: list[pattern]
1517
- if sys.version_info >= (3, 13):
1518
- def __init__(
1519
- self,
1520
- cls: expr,
1521
- patterns: list[pattern] = ...,
1522
- kwd_attrs: list[_Identifier] = ...,
1523
- kwd_patterns: list[pattern] = ...,
1524
- **kwargs: Unpack[_Attributes[int]],
1525
- ) -> None: ...
1526
- else:
1527
- def __init__(
1528
- self,
1529
- cls: expr,
1530
- patterns: list[pattern],
1531
- kwd_attrs: list[_Identifier],
1532
- kwd_patterns: list[pattern],
1533
- **kwargs: Unpack[_Attributes[int]],
1534
- ) -> None: ...
1535
-
1536
- if sys.version_info >= (3, 14):
1537
- def __replace__(
1538
- self,
1539
- *,
1540
- cls: expr = ...,
1541
- patterns: list[pattern] = ...,
1542
- kwd_attrs: list[_Identifier] = ...,
1543
- kwd_patterns: list[pattern] = ...,
1544
- **kwargs: Unpack[_Attributes[int]],
1545
- ) -> Self: ...
1546
-
1547
- class MatchAs(pattern):
1548
- __match_args__ = ("pattern", "name")
1549
- pattern: _Pattern | None
1550
- name: _Identifier | None
1551
- def __init__(
1552
- self, pattern: _Pattern | None = None, name: _Identifier | None = None, **kwargs: Unpack[_Attributes[int]]
1553
- ) -> None: ...
1554
-
1555
- if sys.version_info >= (3, 14):
1556
- def __replace__(
1557
- self, *, pattern: _Pattern | None = ..., name: _Identifier | None = ..., **kwargs: Unpack[_Attributes[int]]
1558
- ) -> Self: ...
1559
-
1560
- class MatchOr(pattern):
1561
- __match_args__ = ("patterns",)
1562
- patterns: list[pattern]
1563
- if sys.version_info >= (3, 13):
1564
- def __init__(self, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> None: ...
1565
- else:
1566
- def __init__(self, patterns: list[pattern], **kwargs: Unpack[_Attributes[int]]) -> None: ...
1567
-
1568
- if sys.version_info >= (3, 14):
1569
- def __replace__(self, *, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ...
1570
-
1571
- if sys.version_info >= (3, 12):
1572
- class type_param(AST):
1573
- lineno: int
1574
- col_offset: int
1575
- end_lineno: int
1576
- end_col_offset: int
1577
- def __init__(self, **kwargs: Unpack[_Attributes[int]]) -> None: ...
1578
-
1579
- if sys.version_info >= (3, 14):
1580
- def __replace__(self, **kwargs: Unpack[_Attributes[int]]) -> Self: ...
1581
-
1582
- class TypeVar(type_param):
1583
- if sys.version_info >= (3, 13):
1584
- __match_args__ = ("name", "bound", "default_value")
1585
- else:
1586
- __match_args__ = ("name", "bound")
1587
- name: _Identifier
1588
- bound: expr | None
1589
- if sys.version_info >= (3, 13):
1590
- default_value: expr | None
1591
- def __init__(
1592
- self,
1593
- name: _Identifier,
1594
- bound: expr | None = None,
1595
- default_value: expr | None = None,
1596
- **kwargs: Unpack[_Attributes[int]],
1597
- ) -> None: ...
1598
- else:
1599
- def __init__(self, name: _Identifier, bound: expr | None = None, **kwargs: Unpack[_Attributes[int]]) -> None: ...
1600
-
1601
- if sys.version_info >= (3, 14):
1602
- def __replace__(
1603
- self,
1604
- *,
1605
- name: _Identifier = ...,
1606
- bound: expr | None = ...,
1607
- default_value: expr | None = ...,
1608
- **kwargs: Unpack[_Attributes[int]],
1609
- ) -> Self: ...
1610
-
1611
- class ParamSpec(type_param):
1612
- if sys.version_info >= (3, 13):
1613
- __match_args__ = ("name", "default_value")
1614
- else:
1615
- __match_args__ = ("name",)
1616
- name: _Identifier
1617
- if sys.version_info >= (3, 13):
1618
- default_value: expr | None
1619
- def __init__(
1620
- self, name: _Identifier, default_value: expr | None = None, **kwargs: Unpack[_Attributes[int]]
1621
- ) -> None: ...
1622
- else:
1623
- def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ...
1624
-
1625
- if sys.version_info >= (3, 14):
1626
- def __replace__(
1627
- self, *, name: _Identifier = ..., default_value: expr | None = ..., **kwargs: Unpack[_Attributes[int]]
1628
- ) -> Self: ...
1629
-
1630
- class TypeVarTuple(type_param):
1631
- if sys.version_info >= (3, 13):
1632
- __match_args__ = ("name", "default_value")
1633
- else:
1634
- __match_args__ = ("name",)
1635
- name: _Identifier
1636
- if sys.version_info >= (3, 13):
1637
- default_value: expr | None
1638
- def __init__(
1639
- self, name: _Identifier, default_value: expr | None = None, **kwargs: Unpack[_Attributes[int]]
1640
- ) -> None: ...
1641
- else:
1642
- def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ...
1643
-
1644
- if sys.version_info >= (3, 14):
1645
- def __replace__(
1646
- self, *, name: _Identifier = ..., default_value: expr | None = ..., **kwargs: Unpack[_Attributes[int]]
1647
- ) -> Self: ...
133
+ if sys.version_info < (3, 9):
134
+ from ast import (
135
+ AugLoad as AugLoad,
136
+ AugStore as AugStore,
137
+ ExtSlice as ExtSlice,
138
+ Index as Index,
139
+ Param as Param,
140
+ Suite as Suite,
141
+ slice as slice,
142
+ )
1648
143
 
1649
- class TypeAlias(stmt):
1650
- __match_args__ = ("name", "type_params", "value")
1651
- name: Name
1652
- type_params: list[type_param]
1653
- value: expr
1654
- if sys.version_info >= (3, 13):
1655
- @overload
1656
- def __init__(
1657
- self, name: Name, type_params: list[type_param], value: expr, **kwargs: Unpack[_Attributes[int]]
1658
- ) -> None: ...
1659
- @overload
1660
- def __init__(
1661
- self, name: Name, type_params: list[type_param] = ..., *, value: expr, **kwargs: Unpack[_Attributes[int]]
1662
- ) -> None: ...
1663
- else:
1664
- def __init__(
1665
- self, name: Name, type_params: list[type_param], value: expr, **kwargs: Unpack[_Attributes[int]]
1666
- ) -> None: ...
144
+ PyCF_ALLOW_TOP_LEVEL_AWAIT: Literal[8192]
145
+ PyCF_ONLY_AST: Literal[1024]
146
+ PyCF_TYPE_COMMENTS: Literal[4096]
1667
147
 
1668
- if sys.version_info >= (3, 14):
1669
- def __replace__(
1670
- self,
1671
- *,
1672
- name: Name = ...,
1673
- type_params: list[type_param] = ...,
1674
- value: expr = ...,
1675
- **kwargs: Unpack[_Attributes[int]],
1676
- ) -> Self: ...
148
+ if sys.version_info >= (3, 13):
149
+ PyCF_OPTIMIZED_AST: Literal[33792]