@djlint/linux-s390x-gnu 0.0.0-stage → 1.54.0

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 (1598) hide show
  1. package/LICENSE +675 -0
  2. package/README.md +4 -2
  3. package/package.json +23 -4
  4. package/python/bin/python3 +0 -0
  5. package/python/lib/python3.14/LICENSE.txt +277 -0
  6. package/python/lib/python3.14/__future__.py +147 -0
  7. package/python/lib/python3.14/__hello__.py +16 -0
  8. package/python/lib/python3.14/__phello__/__init__.py +7 -0
  9. package/python/lib/python3.14/__phello__/__pycache__/__init__.cpython-314.pyc +0 -0
  10. package/python/lib/python3.14/__phello__/__pycache__/spam.cpython-314.pyc +0 -0
  11. package/python/lib/python3.14/__phello__/spam.py +7 -0
  12. package/python/lib/python3.14/__pycache__/__future__.cpython-314.pyc +0 -0
  13. package/python/lib/python3.14/__pycache__/__hello__.cpython-314.pyc +0 -0
  14. package/python/lib/python3.14/__pycache__/_aix_support.cpython-314.pyc +0 -0
  15. package/python/lib/python3.14/__pycache__/_android_support.cpython-314.pyc +0 -0
  16. package/python/lib/python3.14/__pycache__/_apple_support.cpython-314.pyc +0 -0
  17. package/python/lib/python3.14/__pycache__/_ast_unparse.cpython-314.pyc +0 -0
  18. package/python/lib/python3.14/__pycache__/_collections_abc.cpython-314.pyc +0 -0
  19. package/python/lib/python3.14/__pycache__/_colorize.cpython-314.pyc +0 -0
  20. package/python/lib/python3.14/__pycache__/_compat_pickle.cpython-314.pyc +0 -0
  21. package/python/lib/python3.14/__pycache__/_ios_support.cpython-314.pyc +0 -0
  22. package/python/lib/python3.14/__pycache__/_markupbase.cpython-314.pyc +0 -0
  23. package/python/lib/python3.14/__pycache__/_opcode_metadata.cpython-314.pyc +0 -0
  24. package/python/lib/python3.14/__pycache__/_osx_support.cpython-314.pyc +0 -0
  25. package/python/lib/python3.14/__pycache__/_py_abc.cpython-314.pyc +0 -0
  26. package/python/lib/python3.14/__pycache__/_py_warnings.cpython-314.pyc +0 -0
  27. package/python/lib/python3.14/__pycache__/_pydatetime.cpython-314.pyc +0 -0
  28. package/python/lib/python3.14/__pycache__/_pydecimal.cpython-314.pyc +0 -0
  29. package/python/lib/python3.14/__pycache__/_pyio.cpython-314.pyc +0 -0
  30. package/python/lib/python3.14/__pycache__/_pylong.cpython-314.pyc +0 -0
  31. package/python/lib/python3.14/__pycache__/_sitebuiltins.cpython-314.pyc +0 -0
  32. package/python/lib/python3.14/__pycache__/_strptime.cpython-314.pyc +0 -0
  33. package/python/lib/python3.14/__pycache__/_sysconfigdata__linux_s390x-linux-gnu.cpython-314.pyc +0 -0
  34. package/python/lib/python3.14/__pycache__/_threading_local.cpython-314.pyc +0 -0
  35. package/python/lib/python3.14/__pycache__/_weakrefset.cpython-314.pyc +0 -0
  36. package/python/lib/python3.14/__pycache__/abc.cpython-314.pyc +0 -0
  37. package/python/lib/python3.14/__pycache__/annotationlib.cpython-314.pyc +0 -0
  38. package/python/lib/python3.14/__pycache__/antigravity.cpython-314.pyc +0 -0
  39. package/python/lib/python3.14/__pycache__/argparse.cpython-314.pyc +0 -0
  40. package/python/lib/python3.14/__pycache__/ast.cpython-314.pyc +0 -0
  41. package/python/lib/python3.14/__pycache__/base64.cpython-314.pyc +0 -0
  42. package/python/lib/python3.14/__pycache__/bdb.cpython-314.pyc +0 -0
  43. package/python/lib/python3.14/__pycache__/bisect.cpython-314.pyc +0 -0
  44. package/python/lib/python3.14/__pycache__/bz2.cpython-314.pyc +0 -0
  45. package/python/lib/python3.14/__pycache__/cProfile.cpython-314.pyc +0 -0
  46. package/python/lib/python3.14/__pycache__/calendar.cpython-314.pyc +0 -0
  47. package/python/lib/python3.14/__pycache__/cmd.cpython-314.pyc +0 -0
  48. package/python/lib/python3.14/__pycache__/code.cpython-314.pyc +0 -0
  49. package/python/lib/python3.14/__pycache__/codecs.cpython-314.pyc +0 -0
  50. package/python/lib/python3.14/__pycache__/codeop.cpython-314.pyc +0 -0
  51. package/python/lib/python3.14/__pycache__/colorsys.cpython-314.pyc +0 -0
  52. package/python/lib/python3.14/__pycache__/compileall.cpython-314.pyc +0 -0
  53. package/python/lib/python3.14/__pycache__/configparser.cpython-314.pyc +0 -0
  54. package/python/lib/python3.14/__pycache__/contextlib.cpython-314.pyc +0 -0
  55. package/python/lib/python3.14/__pycache__/contextvars.cpython-314.pyc +0 -0
  56. package/python/lib/python3.14/__pycache__/copy.cpython-314.pyc +0 -0
  57. package/python/lib/python3.14/__pycache__/copyreg.cpython-314.pyc +0 -0
  58. package/python/lib/python3.14/__pycache__/csv.cpython-314.pyc +0 -0
  59. package/python/lib/python3.14/__pycache__/dataclasses.cpython-314.pyc +0 -0
  60. package/python/lib/python3.14/__pycache__/datetime.cpython-314.pyc +0 -0
  61. package/python/lib/python3.14/__pycache__/decimal.cpython-314.pyc +0 -0
  62. package/python/lib/python3.14/__pycache__/difflib.cpython-314.pyc +0 -0
  63. package/python/lib/python3.14/__pycache__/dis.cpython-314.pyc +0 -0
  64. package/python/lib/python3.14/__pycache__/doctest.cpython-314.pyc +0 -0
  65. package/python/lib/python3.14/__pycache__/enum.cpython-314.pyc +0 -0
  66. package/python/lib/python3.14/__pycache__/filecmp.cpython-314.pyc +0 -0
  67. package/python/lib/python3.14/__pycache__/fileinput.cpython-314.pyc +0 -0
  68. package/python/lib/python3.14/__pycache__/fnmatch.cpython-314.pyc +0 -0
  69. package/python/lib/python3.14/__pycache__/fractions.cpython-314.pyc +0 -0
  70. package/python/lib/python3.14/__pycache__/ftplib.cpython-314.pyc +0 -0
  71. package/python/lib/python3.14/__pycache__/functools.cpython-314.pyc +0 -0
  72. package/python/lib/python3.14/__pycache__/genericpath.cpython-314.pyc +0 -0
  73. package/python/lib/python3.14/__pycache__/getopt.cpython-314.pyc +0 -0
  74. package/python/lib/python3.14/__pycache__/getpass.cpython-314.pyc +0 -0
  75. package/python/lib/python3.14/__pycache__/gettext.cpython-314.pyc +0 -0
  76. package/python/lib/python3.14/__pycache__/glob.cpython-314.pyc +0 -0
  77. package/python/lib/python3.14/__pycache__/graphlib.cpython-314.pyc +0 -0
  78. package/python/lib/python3.14/__pycache__/gzip.cpython-314.pyc +0 -0
  79. package/python/lib/python3.14/__pycache__/hashlib.cpython-314.pyc +0 -0
  80. package/python/lib/python3.14/__pycache__/heapq.cpython-314.pyc +0 -0
  81. package/python/lib/python3.14/__pycache__/hmac.cpython-314.pyc +0 -0
  82. package/python/lib/python3.14/__pycache__/imaplib.cpython-314.pyc +0 -0
  83. package/python/lib/python3.14/__pycache__/inspect.cpython-314.pyc +0 -0
  84. package/python/lib/python3.14/__pycache__/io.cpython-314.pyc +0 -0
  85. package/python/lib/python3.14/__pycache__/ipaddress.cpython-314.pyc +0 -0
  86. package/python/lib/python3.14/__pycache__/keyword.cpython-314.pyc +0 -0
  87. package/python/lib/python3.14/__pycache__/linecache.cpython-314.pyc +0 -0
  88. package/python/lib/python3.14/__pycache__/locale.cpython-314.pyc +0 -0
  89. package/python/lib/python3.14/__pycache__/lzma.cpython-314.pyc +0 -0
  90. package/python/lib/python3.14/__pycache__/mailbox.cpython-314.pyc +0 -0
  91. package/python/lib/python3.14/__pycache__/mimetypes.cpython-314.pyc +0 -0
  92. package/python/lib/python3.14/__pycache__/modulefinder.cpython-314.pyc +0 -0
  93. package/python/lib/python3.14/__pycache__/netrc.cpython-314.pyc +0 -0
  94. package/python/lib/python3.14/__pycache__/ntpath.cpython-314.pyc +0 -0
  95. package/python/lib/python3.14/__pycache__/nturl2path.cpython-314.pyc +0 -0
  96. package/python/lib/python3.14/__pycache__/numbers.cpython-314.pyc +0 -0
  97. package/python/lib/python3.14/__pycache__/opcode.cpython-314.pyc +0 -0
  98. package/python/lib/python3.14/__pycache__/operator.cpython-314.pyc +0 -0
  99. package/python/lib/python3.14/__pycache__/optparse.cpython-314.pyc +0 -0
  100. package/python/lib/python3.14/__pycache__/os.cpython-314.pyc +0 -0
  101. package/python/lib/python3.14/__pycache__/pdb.cpython-314.pyc +0 -0
  102. package/python/lib/python3.14/__pycache__/pickle.cpython-314.pyc +0 -0
  103. package/python/lib/python3.14/__pycache__/pickletools.cpython-314.pyc +0 -0
  104. package/python/lib/python3.14/__pycache__/pkgutil.cpython-314.pyc +0 -0
  105. package/python/lib/python3.14/__pycache__/platform.cpython-314.pyc +0 -0
  106. package/python/lib/python3.14/__pycache__/plistlib.cpython-314.pyc +0 -0
  107. package/python/lib/python3.14/__pycache__/poplib.cpython-314.pyc +0 -0
  108. package/python/lib/python3.14/__pycache__/posixpath.cpython-314.pyc +0 -0
  109. package/python/lib/python3.14/__pycache__/pprint.cpython-314.pyc +0 -0
  110. package/python/lib/python3.14/__pycache__/profile.cpython-314.pyc +0 -0
  111. package/python/lib/python3.14/__pycache__/pstats.cpython-314.pyc +0 -0
  112. package/python/lib/python3.14/__pycache__/pty.cpython-314.pyc +0 -0
  113. package/python/lib/python3.14/__pycache__/py_compile.cpython-314.pyc +0 -0
  114. package/python/lib/python3.14/__pycache__/pyclbr.cpython-314.pyc +0 -0
  115. package/python/lib/python3.14/__pycache__/pydoc.cpython-314.pyc +0 -0
  116. package/python/lib/python3.14/__pycache__/queue.cpython-314.pyc +0 -0
  117. package/python/lib/python3.14/__pycache__/quopri.cpython-314.pyc +0 -0
  118. package/python/lib/python3.14/__pycache__/random.cpython-314.pyc +0 -0
  119. package/python/lib/python3.14/__pycache__/reprlib.cpython-314.pyc +0 -0
  120. package/python/lib/python3.14/__pycache__/rlcompleter.cpython-314.pyc +0 -0
  121. package/python/lib/python3.14/__pycache__/runpy.cpython-314.pyc +0 -0
  122. package/python/lib/python3.14/__pycache__/sched.cpython-314.pyc +0 -0
  123. package/python/lib/python3.14/__pycache__/secrets.cpython-314.pyc +0 -0
  124. package/python/lib/python3.14/__pycache__/selectors.cpython-314.pyc +0 -0
  125. package/python/lib/python3.14/__pycache__/shelve.cpython-314.pyc +0 -0
  126. package/python/lib/python3.14/__pycache__/shlex.cpython-314.pyc +0 -0
  127. package/python/lib/python3.14/__pycache__/shutil.cpython-314.pyc +0 -0
  128. package/python/lib/python3.14/__pycache__/signal.cpython-314.pyc +0 -0
  129. package/python/lib/python3.14/__pycache__/site.cpython-314.pyc +0 -0
  130. package/python/lib/python3.14/__pycache__/smtplib.cpython-314.pyc +0 -0
  131. package/python/lib/python3.14/__pycache__/socket.cpython-314.pyc +0 -0
  132. package/python/lib/python3.14/__pycache__/socketserver.cpython-314.pyc +0 -0
  133. package/python/lib/python3.14/__pycache__/sre_compile.cpython-314.pyc +0 -0
  134. package/python/lib/python3.14/__pycache__/sre_constants.cpython-314.pyc +0 -0
  135. package/python/lib/python3.14/__pycache__/sre_parse.cpython-314.pyc +0 -0
  136. package/python/lib/python3.14/__pycache__/ssl.cpython-314.pyc +0 -0
  137. package/python/lib/python3.14/__pycache__/stat.cpython-314.pyc +0 -0
  138. package/python/lib/python3.14/__pycache__/statistics.cpython-314.pyc +0 -0
  139. package/python/lib/python3.14/__pycache__/stringprep.cpython-314.pyc +0 -0
  140. package/python/lib/python3.14/__pycache__/struct.cpython-314.pyc +0 -0
  141. package/python/lib/python3.14/__pycache__/subprocess.cpython-314.pyc +0 -0
  142. package/python/lib/python3.14/__pycache__/symtable.cpython-314.pyc +0 -0
  143. package/python/lib/python3.14/__pycache__/tabnanny.cpython-314.pyc +0 -0
  144. package/python/lib/python3.14/__pycache__/tarfile.cpython-314.pyc +0 -0
  145. package/python/lib/python3.14/__pycache__/tempfile.cpython-314.pyc +0 -0
  146. package/python/lib/python3.14/__pycache__/textwrap.cpython-314.pyc +0 -0
  147. package/python/lib/python3.14/__pycache__/this.cpython-314.pyc +0 -0
  148. package/python/lib/python3.14/__pycache__/threading.cpython-314.pyc +0 -0
  149. package/python/lib/python3.14/__pycache__/timeit.cpython-314.pyc +0 -0
  150. package/python/lib/python3.14/__pycache__/token.cpython-314.pyc +0 -0
  151. package/python/lib/python3.14/__pycache__/tokenize.cpython-314.pyc +0 -0
  152. package/python/lib/python3.14/__pycache__/trace.cpython-314.pyc +0 -0
  153. package/python/lib/python3.14/__pycache__/traceback.cpython-314.pyc +0 -0
  154. package/python/lib/python3.14/__pycache__/tracemalloc.cpython-314.pyc +0 -0
  155. package/python/lib/python3.14/__pycache__/tty.cpython-314.pyc +0 -0
  156. package/python/lib/python3.14/__pycache__/types.cpython-314.pyc +0 -0
  157. package/python/lib/python3.14/__pycache__/typing.cpython-314.pyc +0 -0
  158. package/python/lib/python3.14/__pycache__/uuid.cpython-314.pyc +0 -0
  159. package/python/lib/python3.14/__pycache__/warnings.cpython-314.pyc +0 -0
  160. package/python/lib/python3.14/__pycache__/wave.cpython-314.pyc +0 -0
  161. package/python/lib/python3.14/__pycache__/weakref.cpython-314.pyc +0 -0
  162. package/python/lib/python3.14/__pycache__/webbrowser.cpython-314.pyc +0 -0
  163. package/python/lib/python3.14/__pycache__/zipapp.cpython-314.pyc +0 -0
  164. package/python/lib/python3.14/__pycache__/zipimport.cpython-314.pyc +0 -0
  165. package/python/lib/python3.14/_aix_support.py +108 -0
  166. package/python/lib/python3.14/_android_support.py +192 -0
  167. package/python/lib/python3.14/_apple_support.py +66 -0
  168. package/python/lib/python3.14/_ast_unparse.py +1161 -0
  169. package/python/lib/python3.14/_collections_abc.py +1172 -0
  170. package/python/lib/python3.14/_colorize.py +355 -0
  171. package/python/lib/python3.14/_compat_pickle.py +251 -0
  172. package/python/lib/python3.14/_ios_support.py +74 -0
  173. package/python/lib/python3.14/_markupbase.py +396 -0
  174. package/python/lib/python3.14/_opcode_metadata.py +371 -0
  175. package/python/lib/python3.14/_osx_support.py +579 -0
  176. package/python/lib/python3.14/_py_abc.py +152 -0
  177. package/python/lib/python3.14/_py_warnings.py +869 -0
  178. package/python/lib/python3.14/_pydatetime.py +2734 -0
  179. package/python/lib/python3.14/_pydecimal.py +6503 -0
  180. package/python/lib/python3.14/_pyio.py +2764 -0
  181. package/python/lib/python3.14/_pylong.py +729 -0
  182. package/python/lib/python3.14/_pyrepl/__init__.py +19 -0
  183. package/python/lib/python3.14/_pyrepl/__main__.py +10 -0
  184. package/python/lib/python3.14/_pyrepl/__pycache__/__init__.cpython-314.pyc +0 -0
  185. package/python/lib/python3.14/_pyrepl/__pycache__/__main__.cpython-314.pyc +0 -0
  186. package/python/lib/python3.14/_pyrepl/__pycache__/_module_completer.cpython-314.pyc +0 -0
  187. package/python/lib/python3.14/_pyrepl/__pycache__/_threading_handler.cpython-314.pyc +0 -0
  188. package/python/lib/python3.14/_pyrepl/__pycache__/base_eventqueue.cpython-314.pyc +0 -0
  189. package/python/lib/python3.14/_pyrepl/__pycache__/commands.cpython-314.pyc +0 -0
  190. package/python/lib/python3.14/_pyrepl/__pycache__/completing_reader.cpython-314.pyc +0 -0
  191. package/python/lib/python3.14/_pyrepl/__pycache__/console.cpython-314.pyc +0 -0
  192. package/python/lib/python3.14/_pyrepl/__pycache__/fancy_termios.cpython-314.pyc +0 -0
  193. package/python/lib/python3.14/_pyrepl/__pycache__/historical_reader.cpython-314.pyc +0 -0
  194. package/python/lib/python3.14/_pyrepl/__pycache__/input.cpython-314.pyc +0 -0
  195. package/python/lib/python3.14/_pyrepl/__pycache__/keymap.cpython-314.pyc +0 -0
  196. package/python/lib/python3.14/_pyrepl/__pycache__/main.cpython-314.pyc +0 -0
  197. package/python/lib/python3.14/_pyrepl/__pycache__/pager.cpython-314.pyc +0 -0
  198. package/python/lib/python3.14/_pyrepl/__pycache__/reader.cpython-314.pyc +0 -0
  199. package/python/lib/python3.14/_pyrepl/__pycache__/readline.cpython-314.pyc +0 -0
  200. package/python/lib/python3.14/_pyrepl/__pycache__/simple_interact.cpython-314.pyc +0 -0
  201. package/python/lib/python3.14/_pyrepl/__pycache__/terminfo.cpython-314.pyc +0 -0
  202. package/python/lib/python3.14/_pyrepl/__pycache__/trace.cpython-314.pyc +0 -0
  203. package/python/lib/python3.14/_pyrepl/__pycache__/types.cpython-314.pyc +0 -0
  204. package/python/lib/python3.14/_pyrepl/__pycache__/unix_console.cpython-314.pyc +0 -0
  205. package/python/lib/python3.14/_pyrepl/__pycache__/unix_eventqueue.cpython-314.pyc +0 -0
  206. package/python/lib/python3.14/_pyrepl/__pycache__/utils.cpython-314.pyc +0 -0
  207. package/python/lib/python3.14/_pyrepl/__pycache__/windows_console.cpython-314.pyc +0 -0
  208. package/python/lib/python3.14/_pyrepl/__pycache__/windows_eventqueue.cpython-314.pyc +0 -0
  209. package/python/lib/python3.14/_pyrepl/_module_completer.py +426 -0
  210. package/python/lib/python3.14/_pyrepl/_threading_handler.py +74 -0
  211. package/python/lib/python3.14/_pyrepl/base_eventqueue.py +110 -0
  212. package/python/lib/python3.14/_pyrepl/commands.py +505 -0
  213. package/python/lib/python3.14/_pyrepl/completing_reader.py +299 -0
  214. package/python/lib/python3.14/_pyrepl/console.py +229 -0
  215. package/python/lib/python3.14/_pyrepl/fancy_termios.py +82 -0
  216. package/python/lib/python3.14/_pyrepl/historical_reader.py +424 -0
  217. package/python/lib/python3.14/_pyrepl/input.py +114 -0
  218. package/python/lib/python3.14/_pyrepl/keymap.py +213 -0
  219. package/python/lib/python3.14/_pyrepl/main.py +58 -0
  220. package/python/lib/python3.14/_pyrepl/mypy.ini +25 -0
  221. package/python/lib/python3.14/_pyrepl/pager.py +175 -0
  222. package/python/lib/python3.14/_pyrepl/reader.py +773 -0
  223. package/python/lib/python3.14/_pyrepl/readline.py +621 -0
  224. package/python/lib/python3.14/_pyrepl/simple_interact.py +186 -0
  225. package/python/lib/python3.14/_pyrepl/terminfo.py +488 -0
  226. package/python/lib/python3.14/_pyrepl/trace.py +34 -0
  227. package/python/lib/python3.14/_pyrepl/types.py +10 -0
  228. package/python/lib/python3.14/_pyrepl/unix_console.py +860 -0
  229. package/python/lib/python3.14/_pyrepl/unix_eventqueue.py +77 -0
  230. package/python/lib/python3.14/_pyrepl/utils.py +391 -0
  231. package/python/lib/python3.14/_pyrepl/windows_console.py +735 -0
  232. package/python/lib/python3.14/_pyrepl/windows_eventqueue.py +42 -0
  233. package/python/lib/python3.14/_sitebuiltins.py +91 -0
  234. package/python/lib/python3.14/_strptime.py +822 -0
  235. package/python/lib/python3.14/_sysconfig_vars__linux_s390x-linux-gnu.json +1166 -0
  236. package/python/lib/python3.14/_sysconfigdata__linux_s390x-linux-gnu.py +1152 -0
  237. package/python/lib/python3.14/_threading_local.py +120 -0
  238. package/python/lib/python3.14/_weakrefset.py +147 -0
  239. package/python/lib/python3.14/abc.py +188 -0
  240. package/python/lib/python3.14/annotationlib.py +1205 -0
  241. package/python/lib/python3.14/antigravity.py +17 -0
  242. package/python/lib/python3.14/argparse.py +2789 -0
  243. package/python/lib/python3.14/ast.py +680 -0
  244. package/python/lib/python3.14/asyncio/__init__.py +74 -0
  245. package/python/lib/python3.14/asyncio/__main__.py +248 -0
  246. package/python/lib/python3.14/asyncio/__pycache__/__init__.cpython-314.pyc +0 -0
  247. package/python/lib/python3.14/asyncio/__pycache__/__main__.cpython-314.pyc +0 -0
  248. package/python/lib/python3.14/asyncio/__pycache__/base_events.cpython-314.pyc +0 -0
  249. package/python/lib/python3.14/asyncio/__pycache__/base_futures.cpython-314.pyc +0 -0
  250. package/python/lib/python3.14/asyncio/__pycache__/base_subprocess.cpython-314.pyc +0 -0
  251. package/python/lib/python3.14/asyncio/__pycache__/base_tasks.cpython-314.pyc +0 -0
  252. package/python/lib/python3.14/asyncio/__pycache__/constants.cpython-314.pyc +0 -0
  253. package/python/lib/python3.14/asyncio/__pycache__/coroutines.cpython-314.pyc +0 -0
  254. package/python/lib/python3.14/asyncio/__pycache__/events.cpython-314.pyc +0 -0
  255. package/python/lib/python3.14/asyncio/__pycache__/exceptions.cpython-314.pyc +0 -0
  256. package/python/lib/python3.14/asyncio/__pycache__/format_helpers.cpython-314.pyc +0 -0
  257. package/python/lib/python3.14/asyncio/__pycache__/futures.cpython-314.pyc +0 -0
  258. package/python/lib/python3.14/asyncio/__pycache__/graph.cpython-314.pyc +0 -0
  259. package/python/lib/python3.14/asyncio/__pycache__/locks.cpython-314.pyc +0 -0
  260. package/python/lib/python3.14/asyncio/__pycache__/log.cpython-314.pyc +0 -0
  261. package/python/lib/python3.14/asyncio/__pycache__/mixins.cpython-314.pyc +0 -0
  262. package/python/lib/python3.14/asyncio/__pycache__/proactor_events.cpython-314.pyc +0 -0
  263. package/python/lib/python3.14/asyncio/__pycache__/protocols.cpython-314.pyc +0 -0
  264. package/python/lib/python3.14/asyncio/__pycache__/queues.cpython-314.pyc +0 -0
  265. package/python/lib/python3.14/asyncio/__pycache__/runners.cpython-314.pyc +0 -0
  266. package/python/lib/python3.14/asyncio/__pycache__/selector_events.cpython-314.pyc +0 -0
  267. package/python/lib/python3.14/asyncio/__pycache__/sslproto.cpython-314.pyc +0 -0
  268. package/python/lib/python3.14/asyncio/__pycache__/staggered.cpython-314.pyc +0 -0
  269. package/python/lib/python3.14/asyncio/__pycache__/streams.cpython-314.pyc +0 -0
  270. package/python/lib/python3.14/asyncio/__pycache__/subprocess.cpython-314.pyc +0 -0
  271. package/python/lib/python3.14/asyncio/__pycache__/taskgroups.cpython-314.pyc +0 -0
  272. package/python/lib/python3.14/asyncio/__pycache__/tasks.cpython-314.pyc +0 -0
  273. package/python/lib/python3.14/asyncio/__pycache__/threads.cpython-314.pyc +0 -0
  274. package/python/lib/python3.14/asyncio/__pycache__/timeouts.cpython-314.pyc +0 -0
  275. package/python/lib/python3.14/asyncio/__pycache__/tools.cpython-314.pyc +0 -0
  276. package/python/lib/python3.14/asyncio/__pycache__/transports.cpython-314.pyc +0 -0
  277. package/python/lib/python3.14/asyncio/__pycache__/trsock.cpython-314.pyc +0 -0
  278. package/python/lib/python3.14/asyncio/__pycache__/unix_events.cpython-314.pyc +0 -0
  279. package/python/lib/python3.14/asyncio/__pycache__/windows_events.cpython-314.pyc +0 -0
  280. package/python/lib/python3.14/asyncio/__pycache__/windows_utils.cpython-314.pyc +0 -0
  281. package/python/lib/python3.14/asyncio/base_events.py +2089 -0
  282. package/python/lib/python3.14/asyncio/base_futures.py +67 -0
  283. package/python/lib/python3.14/asyncio/base_subprocess.py +327 -0
  284. package/python/lib/python3.14/asyncio/base_tasks.py +94 -0
  285. package/python/lib/python3.14/asyncio/constants.py +41 -0
  286. package/python/lib/python3.14/asyncio/coroutines.py +118 -0
  287. package/python/lib/python3.14/asyncio/events.py +881 -0
  288. package/python/lib/python3.14/asyncio/exceptions.py +62 -0
  289. package/python/lib/python3.14/asyncio/format_helpers.py +84 -0
  290. package/python/lib/python3.14/asyncio/futures.py +481 -0
  291. package/python/lib/python3.14/asyncio/graph.py +279 -0
  292. package/python/lib/python3.14/asyncio/locks.py +617 -0
  293. package/python/lib/python3.14/asyncio/log.py +7 -0
  294. package/python/lib/python3.14/asyncio/mixins.py +21 -0
  295. package/python/lib/python3.14/asyncio/proactor_events.py +923 -0
  296. package/python/lib/python3.14/asyncio/protocols.py +216 -0
  297. package/python/lib/python3.14/asyncio/queues.py +309 -0
  298. package/python/lib/python3.14/asyncio/runners.py +226 -0
  299. package/python/lib/python3.14/asyncio/selector_events.py +1337 -0
  300. package/python/lib/python3.14/asyncio/sslproto.py +937 -0
  301. package/python/lib/python3.14/asyncio/staggered.py +179 -0
  302. package/python/lib/python3.14/asyncio/streams.py +804 -0
  303. package/python/lib/python3.14/asyncio/subprocess.py +229 -0
  304. package/python/lib/python3.14/asyncio/taskgroups.py +280 -0
  305. package/python/lib/python3.14/asyncio/tasks.py +1145 -0
  306. package/python/lib/python3.14/asyncio/threads.py +26 -0
  307. package/python/lib/python3.14/asyncio/timeouts.py +183 -0
  308. package/python/lib/python3.14/asyncio/tools.py +278 -0
  309. package/python/lib/python3.14/asyncio/transports.py +337 -0
  310. package/python/lib/python3.14/asyncio/trsock.py +98 -0
  311. package/python/lib/python3.14/asyncio/unix_events.py +1031 -0
  312. package/python/lib/python3.14/asyncio/windows_events.py +906 -0
  313. package/python/lib/python3.14/asyncio/windows_utils.py +181 -0
  314. package/python/lib/python3.14/base64.py +625 -0
  315. package/python/lib/python3.14/bdb.py +1214 -0
  316. package/python/lib/python3.14/bisect.py +118 -0
  317. package/python/lib/python3.14/build-details.json +58 -0
  318. package/python/lib/python3.14/bz2.py +352 -0
  319. package/python/lib/python3.14/cProfile.py +207 -0
  320. package/python/lib/python3.14/calendar.py +926 -0
  321. package/python/lib/python3.14/cmd.py +414 -0
  322. package/python/lib/python3.14/code.py +396 -0
  323. package/python/lib/python3.14/codecs.py +1125 -0
  324. package/python/lib/python3.14/codeop.py +154 -0
  325. package/python/lib/python3.14/collections/__init__.py +1612 -0
  326. package/python/lib/python3.14/collections/__pycache__/__init__.cpython-314.pyc +0 -0
  327. package/python/lib/python3.14/colorsys.py +166 -0
  328. package/python/lib/python3.14/compileall.py +472 -0
  329. package/python/lib/python3.14/compression/__init__.py +0 -0
  330. package/python/lib/python3.14/compression/__pycache__/__init__.cpython-314.pyc +0 -0
  331. package/python/lib/python3.14/compression/__pycache__/bz2.cpython-314.pyc +0 -0
  332. package/python/lib/python3.14/compression/__pycache__/gzip.cpython-314.pyc +0 -0
  333. package/python/lib/python3.14/compression/__pycache__/lzma.cpython-314.pyc +0 -0
  334. package/python/lib/python3.14/compression/__pycache__/zlib.cpython-314.pyc +0 -0
  335. package/python/lib/python3.14/compression/_common/__init__.py +0 -0
  336. package/python/lib/python3.14/compression/_common/__pycache__/__init__.cpython-314.pyc +0 -0
  337. package/python/lib/python3.14/compression/_common/__pycache__/_streams.cpython-314.pyc +0 -0
  338. package/python/lib/python3.14/compression/_common/_streams.py +162 -0
  339. package/python/lib/python3.14/compression/bz2.py +5 -0
  340. package/python/lib/python3.14/compression/gzip.py +5 -0
  341. package/python/lib/python3.14/compression/lzma.py +5 -0
  342. package/python/lib/python3.14/compression/zlib.py +5 -0
  343. package/python/lib/python3.14/compression/zstd/__init__.py +244 -0
  344. package/python/lib/python3.14/compression/zstd/__pycache__/__init__.cpython-314.pyc +0 -0
  345. package/python/lib/python3.14/compression/zstd/__pycache__/_zstdfile.cpython-314.pyc +0 -0
  346. package/python/lib/python3.14/compression/zstd/_zstdfile.py +347 -0
  347. package/python/lib/python3.14/concurrent/__init__.py +1 -0
  348. package/python/lib/python3.14/concurrent/__pycache__/__init__.cpython-314.pyc +0 -0
  349. package/python/lib/python3.14/concurrent/futures/__init__.py +65 -0
  350. package/python/lib/python3.14/concurrent/futures/__pycache__/__init__.cpython-314.pyc +0 -0
  351. package/python/lib/python3.14/concurrent/futures/__pycache__/_base.cpython-314.pyc +0 -0
  352. package/python/lib/python3.14/concurrent/futures/__pycache__/interpreter.cpython-314.pyc +0 -0
  353. package/python/lib/python3.14/concurrent/futures/__pycache__/process.cpython-314.pyc +0 -0
  354. package/python/lib/python3.14/concurrent/futures/__pycache__/thread.cpython-314.pyc +0 -0
  355. package/python/lib/python3.14/concurrent/futures/_base.py +680 -0
  356. package/python/lib/python3.14/concurrent/futures/interpreter.py +123 -0
  357. package/python/lib/python3.14/concurrent/futures/process.py +1047 -0
  358. package/python/lib/python3.14/concurrent/futures/thread.py +274 -0
  359. package/python/lib/python3.14/concurrent/interpreters/__init__.py +253 -0
  360. package/python/lib/python3.14/concurrent/interpreters/__pycache__/__init__.cpython-314.pyc +0 -0
  361. package/python/lib/python3.14/concurrent/interpreters/__pycache__/_crossinterp.cpython-314.pyc +0 -0
  362. package/python/lib/python3.14/concurrent/interpreters/__pycache__/_queues.cpython-314.pyc +0 -0
  363. package/python/lib/python3.14/concurrent/interpreters/_crossinterp.py +107 -0
  364. package/python/lib/python3.14/concurrent/interpreters/_queues.py +290 -0
  365. package/python/lib/python3.14/configparser.py +1426 -0
  366. package/python/lib/python3.14/contextlib.py +814 -0
  367. package/python/lib/python3.14/contextvars.py +8 -0
  368. package/python/lib/python3.14/copy.py +286 -0
  369. package/python/lib/python3.14/copyreg.py +222 -0
  370. package/python/lib/python3.14/csv.py +527 -0
  371. package/python/lib/python3.14/ctypes/__init__.py +686 -0
  372. package/python/lib/python3.14/ctypes/__pycache__/__init__.cpython-314.pyc +0 -0
  373. package/python/lib/python3.14/ctypes/__pycache__/_aix.cpython-314.pyc +0 -0
  374. package/python/lib/python3.14/ctypes/__pycache__/_endian.cpython-314.pyc +0 -0
  375. package/python/lib/python3.14/ctypes/__pycache__/_layout.cpython-314.pyc +0 -0
  376. package/python/lib/python3.14/ctypes/__pycache__/util.cpython-314.pyc +0 -0
  377. package/python/lib/python3.14/ctypes/__pycache__/wintypes.cpython-314.pyc +0 -0
  378. package/python/lib/python3.14/ctypes/_aix.py +327 -0
  379. package/python/lib/python3.14/ctypes/_endian.py +78 -0
  380. package/python/lib/python3.14/ctypes/_layout.py +330 -0
  381. package/python/lib/python3.14/ctypes/macholib/README.ctypes +7 -0
  382. package/python/lib/python3.14/ctypes/macholib/__init__.py +9 -0
  383. package/python/lib/python3.14/ctypes/macholib/__pycache__/__init__.cpython-314.pyc +0 -0
  384. package/python/lib/python3.14/ctypes/macholib/__pycache__/dyld.cpython-314.pyc +0 -0
  385. package/python/lib/python3.14/ctypes/macholib/__pycache__/dylib.cpython-314.pyc +0 -0
  386. package/python/lib/python3.14/ctypes/macholib/__pycache__/framework.cpython-314.pyc +0 -0
  387. package/python/lib/python3.14/ctypes/macholib/dyld.py +165 -0
  388. package/python/lib/python3.14/ctypes/macholib/dylib.py +42 -0
  389. package/python/lib/python3.14/ctypes/macholib/fetch_macholib +2 -0
  390. package/python/lib/python3.14/ctypes/macholib/fetch_macholib.bat +1 -0
  391. package/python/lib/python3.14/ctypes/macholib/framework.py +42 -0
  392. package/python/lib/python3.14/ctypes/util.py +502 -0
  393. package/python/lib/python3.14/ctypes/wintypes.py +210 -0
  394. package/python/lib/python3.14/curses/__init__.py +101 -0
  395. package/python/lib/python3.14/curses/__pycache__/__init__.cpython-314.pyc +0 -0
  396. package/python/lib/python3.14/curses/__pycache__/ascii.cpython-314.pyc +0 -0
  397. package/python/lib/python3.14/curses/__pycache__/has_key.cpython-314.pyc +0 -0
  398. package/python/lib/python3.14/curses/__pycache__/panel.cpython-314.pyc +0 -0
  399. package/python/lib/python3.14/curses/__pycache__/textpad.cpython-314.pyc +0 -0
  400. package/python/lib/python3.14/curses/ascii.py +99 -0
  401. package/python/lib/python3.14/curses/has_key.py +192 -0
  402. package/python/lib/python3.14/curses/panel.py +6 -0
  403. package/python/lib/python3.14/curses/textpad.py +236 -0
  404. package/python/lib/python3.14/dataclasses.py +1813 -0
  405. package/python/lib/python3.14/datetime.py +13 -0
  406. package/python/lib/python3.14/dbm/__init__.py +194 -0
  407. package/python/lib/python3.14/dbm/__pycache__/__init__.cpython-314.pyc +0 -0
  408. package/python/lib/python3.14/dbm/__pycache__/dumb.cpython-314.pyc +0 -0
  409. package/python/lib/python3.14/dbm/__pycache__/gnu.cpython-314.pyc +0 -0
  410. package/python/lib/python3.14/dbm/__pycache__/ndbm.cpython-314.pyc +0 -0
  411. package/python/lib/python3.14/dbm/__pycache__/sqlite3.cpython-314.pyc +0 -0
  412. package/python/lib/python3.14/dbm/dumb.py +319 -0
  413. package/python/lib/python3.14/dbm/gnu.py +3 -0
  414. package/python/lib/python3.14/dbm/ndbm.py +3 -0
  415. package/python/lib/python3.14/dbm/sqlite3.py +144 -0
  416. package/python/lib/python3.14/decimal.py +109 -0
  417. package/python/lib/python3.14/difflib.py +2066 -0
  418. package/python/lib/python3.14/dis.py +1157 -0
  419. package/python/lib/python3.14/doctest.py +2922 -0
  420. package/python/lib/python3.14/email/__init__.py +61 -0
  421. package/python/lib/python3.14/email/__pycache__/__init__.cpython-314.pyc +0 -0
  422. package/python/lib/python3.14/email/__pycache__/_encoded_words.cpython-314.pyc +0 -0
  423. package/python/lib/python3.14/email/__pycache__/_header_value_parser.cpython-314.pyc +0 -0
  424. package/python/lib/python3.14/email/__pycache__/_parseaddr.cpython-314.pyc +0 -0
  425. package/python/lib/python3.14/email/__pycache__/_policybase.cpython-314.pyc +0 -0
  426. package/python/lib/python3.14/email/__pycache__/base64mime.cpython-314.pyc +0 -0
  427. package/python/lib/python3.14/email/__pycache__/charset.cpython-314.pyc +0 -0
  428. package/python/lib/python3.14/email/__pycache__/contentmanager.cpython-314.pyc +0 -0
  429. package/python/lib/python3.14/email/__pycache__/encoders.cpython-314.pyc +0 -0
  430. package/python/lib/python3.14/email/__pycache__/errors.cpython-314.pyc +0 -0
  431. package/python/lib/python3.14/email/__pycache__/feedparser.cpython-314.pyc +0 -0
  432. package/python/lib/python3.14/email/__pycache__/generator.cpython-314.pyc +0 -0
  433. package/python/lib/python3.14/email/__pycache__/header.cpython-314.pyc +0 -0
  434. package/python/lib/python3.14/email/__pycache__/headerregistry.cpython-314.pyc +0 -0
  435. package/python/lib/python3.14/email/__pycache__/iterators.cpython-314.pyc +0 -0
  436. package/python/lib/python3.14/email/__pycache__/message.cpython-314.pyc +0 -0
  437. package/python/lib/python3.14/email/__pycache__/parser.cpython-314.pyc +0 -0
  438. package/python/lib/python3.14/email/__pycache__/policy.cpython-314.pyc +0 -0
  439. package/python/lib/python3.14/email/__pycache__/quoprimime.cpython-314.pyc +0 -0
  440. package/python/lib/python3.14/email/__pycache__/utils.cpython-314.pyc +0 -0
  441. package/python/lib/python3.14/email/_encoded_words.py +233 -0
  442. package/python/lib/python3.14/email/_header_value_parser.py +3164 -0
  443. package/python/lib/python3.14/email/_parseaddr.py +563 -0
  444. package/python/lib/python3.14/email/_policybase.py +392 -0
  445. package/python/lib/python3.14/email/architecture.rst +216 -0
  446. package/python/lib/python3.14/email/base64mime.py +115 -0
  447. package/python/lib/python3.14/email/charset.py +396 -0
  448. package/python/lib/python3.14/email/contentmanager.py +254 -0
  449. package/python/lib/python3.14/email/encoders.py +65 -0
  450. package/python/lib/python3.14/email/errors.py +117 -0
  451. package/python/lib/python3.14/email/feedparser.py +536 -0
  452. package/python/lib/python3.14/email/generator.py +530 -0
  453. package/python/lib/python3.14/email/header.py +582 -0
  454. package/python/lib/python3.14/email/headerregistry.py +618 -0
  455. package/python/lib/python3.14/email/iterators.py +68 -0
  456. package/python/lib/python3.14/email/message.py +1217 -0
  457. package/python/lib/python3.14/email/mime/__init__.py +0 -0
  458. package/python/lib/python3.14/email/mime/__pycache__/__init__.cpython-314.pyc +0 -0
  459. package/python/lib/python3.14/email/mime/__pycache__/application.cpython-314.pyc +0 -0
  460. package/python/lib/python3.14/email/mime/__pycache__/audio.cpython-314.pyc +0 -0
  461. package/python/lib/python3.14/email/mime/__pycache__/base.cpython-314.pyc +0 -0
  462. package/python/lib/python3.14/email/mime/__pycache__/image.cpython-314.pyc +0 -0
  463. package/python/lib/python3.14/email/mime/__pycache__/message.cpython-314.pyc +0 -0
  464. package/python/lib/python3.14/email/mime/__pycache__/multipart.cpython-314.pyc +0 -0
  465. package/python/lib/python3.14/email/mime/__pycache__/nonmultipart.cpython-314.pyc +0 -0
  466. package/python/lib/python3.14/email/mime/__pycache__/text.cpython-314.pyc +0 -0
  467. package/python/lib/python3.14/email/mime/application.py +37 -0
  468. package/python/lib/python3.14/email/mime/audio.py +97 -0
  469. package/python/lib/python3.14/email/mime/base.py +29 -0
  470. package/python/lib/python3.14/email/mime/image.py +152 -0
  471. package/python/lib/python3.14/email/mime/message.py +33 -0
  472. package/python/lib/python3.14/email/mime/multipart.py +47 -0
  473. package/python/lib/python3.14/email/mime/nonmultipart.py +21 -0
  474. package/python/lib/python3.14/email/mime/text.py +40 -0
  475. package/python/lib/python3.14/email/parser.py +127 -0
  476. package/python/lib/python3.14/email/policy.py +239 -0
  477. package/python/lib/python3.14/email/quoprimime.py +300 -0
  478. package/python/lib/python3.14/email/utils.py +489 -0
  479. package/python/lib/python3.14/encodings/__init__.py +182 -0
  480. package/python/lib/python3.14/encodings/__pycache__/__init__.cpython-314.pyc +0 -0
  481. package/python/lib/python3.14/encodings/__pycache__/_win_cp_codecs.cpython-314.pyc +0 -0
  482. package/python/lib/python3.14/encodings/__pycache__/aliases.cpython-314.pyc +0 -0
  483. package/python/lib/python3.14/encodings/__pycache__/ascii.cpython-314.pyc +0 -0
  484. package/python/lib/python3.14/encodings/__pycache__/base64_codec.cpython-314.pyc +0 -0
  485. package/python/lib/python3.14/encodings/__pycache__/big5.cpython-314.pyc +0 -0
  486. package/python/lib/python3.14/encodings/__pycache__/big5hkscs.cpython-314.pyc +0 -0
  487. package/python/lib/python3.14/encodings/__pycache__/bz2_codec.cpython-314.pyc +0 -0
  488. package/python/lib/python3.14/encodings/__pycache__/charmap.cpython-314.pyc +0 -0
  489. package/python/lib/python3.14/encodings/__pycache__/cp037.cpython-314.pyc +0 -0
  490. package/python/lib/python3.14/encodings/__pycache__/cp1006.cpython-314.pyc +0 -0
  491. package/python/lib/python3.14/encodings/__pycache__/cp1026.cpython-314.pyc +0 -0
  492. package/python/lib/python3.14/encodings/__pycache__/cp1125.cpython-314.pyc +0 -0
  493. package/python/lib/python3.14/encodings/__pycache__/cp1140.cpython-314.pyc +0 -0
  494. package/python/lib/python3.14/encodings/__pycache__/cp1250.cpython-314.pyc +0 -0
  495. package/python/lib/python3.14/encodings/__pycache__/cp1251.cpython-314.pyc +0 -0
  496. package/python/lib/python3.14/encodings/__pycache__/cp1252.cpython-314.pyc +0 -0
  497. package/python/lib/python3.14/encodings/__pycache__/cp1253.cpython-314.pyc +0 -0
  498. package/python/lib/python3.14/encodings/__pycache__/cp1254.cpython-314.pyc +0 -0
  499. package/python/lib/python3.14/encodings/__pycache__/cp1255.cpython-314.pyc +0 -0
  500. package/python/lib/python3.14/encodings/__pycache__/cp1256.cpython-314.pyc +0 -0
  501. package/python/lib/python3.14/encodings/__pycache__/cp1257.cpython-314.pyc +0 -0
  502. package/python/lib/python3.14/encodings/__pycache__/cp1258.cpython-314.pyc +0 -0
  503. package/python/lib/python3.14/encodings/__pycache__/cp273.cpython-314.pyc +0 -0
  504. package/python/lib/python3.14/encodings/__pycache__/cp424.cpython-314.pyc +0 -0
  505. package/python/lib/python3.14/encodings/__pycache__/cp437.cpython-314.pyc +0 -0
  506. package/python/lib/python3.14/encodings/__pycache__/cp500.cpython-314.pyc +0 -0
  507. package/python/lib/python3.14/encodings/__pycache__/cp720.cpython-314.pyc +0 -0
  508. package/python/lib/python3.14/encodings/__pycache__/cp737.cpython-314.pyc +0 -0
  509. package/python/lib/python3.14/encodings/__pycache__/cp775.cpython-314.pyc +0 -0
  510. package/python/lib/python3.14/encodings/__pycache__/cp850.cpython-314.pyc +0 -0
  511. package/python/lib/python3.14/encodings/__pycache__/cp852.cpython-314.pyc +0 -0
  512. package/python/lib/python3.14/encodings/__pycache__/cp855.cpython-314.pyc +0 -0
  513. package/python/lib/python3.14/encodings/__pycache__/cp856.cpython-314.pyc +0 -0
  514. package/python/lib/python3.14/encodings/__pycache__/cp857.cpython-314.pyc +0 -0
  515. package/python/lib/python3.14/encodings/__pycache__/cp858.cpython-314.pyc +0 -0
  516. package/python/lib/python3.14/encodings/__pycache__/cp860.cpython-314.pyc +0 -0
  517. package/python/lib/python3.14/encodings/__pycache__/cp861.cpython-314.pyc +0 -0
  518. package/python/lib/python3.14/encodings/__pycache__/cp862.cpython-314.pyc +0 -0
  519. package/python/lib/python3.14/encodings/__pycache__/cp863.cpython-314.pyc +0 -0
  520. package/python/lib/python3.14/encodings/__pycache__/cp864.cpython-314.pyc +0 -0
  521. package/python/lib/python3.14/encodings/__pycache__/cp865.cpython-314.pyc +0 -0
  522. package/python/lib/python3.14/encodings/__pycache__/cp866.cpython-314.pyc +0 -0
  523. package/python/lib/python3.14/encodings/__pycache__/cp869.cpython-314.pyc +0 -0
  524. package/python/lib/python3.14/encodings/__pycache__/cp874.cpython-314.pyc +0 -0
  525. package/python/lib/python3.14/encodings/__pycache__/cp875.cpython-314.pyc +0 -0
  526. package/python/lib/python3.14/encodings/__pycache__/cp932.cpython-314.pyc +0 -0
  527. package/python/lib/python3.14/encodings/__pycache__/cp949.cpython-314.pyc +0 -0
  528. package/python/lib/python3.14/encodings/__pycache__/cp950.cpython-314.pyc +0 -0
  529. package/python/lib/python3.14/encodings/__pycache__/euc_jis_2004.cpython-314.pyc +0 -0
  530. package/python/lib/python3.14/encodings/__pycache__/euc_jisx0213.cpython-314.pyc +0 -0
  531. package/python/lib/python3.14/encodings/__pycache__/euc_jp.cpython-314.pyc +0 -0
  532. package/python/lib/python3.14/encodings/__pycache__/euc_kr.cpython-314.pyc +0 -0
  533. package/python/lib/python3.14/encodings/__pycache__/gb18030.cpython-314.pyc +0 -0
  534. package/python/lib/python3.14/encodings/__pycache__/gb2312.cpython-314.pyc +0 -0
  535. package/python/lib/python3.14/encodings/__pycache__/gbk.cpython-314.pyc +0 -0
  536. package/python/lib/python3.14/encodings/__pycache__/hex_codec.cpython-314.pyc +0 -0
  537. package/python/lib/python3.14/encodings/__pycache__/hp_roman8.cpython-314.pyc +0 -0
  538. package/python/lib/python3.14/encodings/__pycache__/hz.cpython-314.pyc +0 -0
  539. package/python/lib/python3.14/encodings/__pycache__/idna.cpython-314.pyc +0 -0
  540. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp.cpython-314.pyc +0 -0
  541. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_1.cpython-314.pyc +0 -0
  542. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_2.cpython-314.pyc +0 -0
  543. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_2004.cpython-314.pyc +0 -0
  544. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_3.cpython-314.pyc +0 -0
  545. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_ext.cpython-314.pyc +0 -0
  546. package/python/lib/python3.14/encodings/__pycache__/iso2022_kr.cpython-314.pyc +0 -0
  547. package/python/lib/python3.14/encodings/__pycache__/iso8859_1.cpython-314.pyc +0 -0
  548. package/python/lib/python3.14/encodings/__pycache__/iso8859_10.cpython-314.pyc +0 -0
  549. package/python/lib/python3.14/encodings/__pycache__/iso8859_11.cpython-314.pyc +0 -0
  550. package/python/lib/python3.14/encodings/__pycache__/iso8859_13.cpython-314.pyc +0 -0
  551. package/python/lib/python3.14/encodings/__pycache__/iso8859_14.cpython-314.pyc +0 -0
  552. package/python/lib/python3.14/encodings/__pycache__/iso8859_15.cpython-314.pyc +0 -0
  553. package/python/lib/python3.14/encodings/__pycache__/iso8859_16.cpython-314.pyc +0 -0
  554. package/python/lib/python3.14/encodings/__pycache__/iso8859_2.cpython-314.pyc +0 -0
  555. package/python/lib/python3.14/encodings/__pycache__/iso8859_3.cpython-314.pyc +0 -0
  556. package/python/lib/python3.14/encodings/__pycache__/iso8859_4.cpython-314.pyc +0 -0
  557. package/python/lib/python3.14/encodings/__pycache__/iso8859_5.cpython-314.pyc +0 -0
  558. package/python/lib/python3.14/encodings/__pycache__/iso8859_6.cpython-314.pyc +0 -0
  559. package/python/lib/python3.14/encodings/__pycache__/iso8859_7.cpython-314.pyc +0 -0
  560. package/python/lib/python3.14/encodings/__pycache__/iso8859_8.cpython-314.pyc +0 -0
  561. package/python/lib/python3.14/encodings/__pycache__/iso8859_9.cpython-314.pyc +0 -0
  562. package/python/lib/python3.14/encodings/__pycache__/johab.cpython-314.pyc +0 -0
  563. package/python/lib/python3.14/encodings/__pycache__/koi8_r.cpython-314.pyc +0 -0
  564. package/python/lib/python3.14/encodings/__pycache__/koi8_t.cpython-314.pyc +0 -0
  565. package/python/lib/python3.14/encodings/__pycache__/koi8_u.cpython-314.pyc +0 -0
  566. package/python/lib/python3.14/encodings/__pycache__/kz1048.cpython-314.pyc +0 -0
  567. package/python/lib/python3.14/encodings/__pycache__/latin_1.cpython-314.pyc +0 -0
  568. package/python/lib/python3.14/encodings/__pycache__/mac_arabic.cpython-314.pyc +0 -0
  569. package/python/lib/python3.14/encodings/__pycache__/mac_croatian.cpython-314.pyc +0 -0
  570. package/python/lib/python3.14/encodings/__pycache__/mac_cyrillic.cpython-314.pyc +0 -0
  571. package/python/lib/python3.14/encodings/__pycache__/mac_farsi.cpython-314.pyc +0 -0
  572. package/python/lib/python3.14/encodings/__pycache__/mac_greek.cpython-314.pyc +0 -0
  573. package/python/lib/python3.14/encodings/__pycache__/mac_iceland.cpython-314.pyc +0 -0
  574. package/python/lib/python3.14/encodings/__pycache__/mac_latin2.cpython-314.pyc +0 -0
  575. package/python/lib/python3.14/encodings/__pycache__/mac_roman.cpython-314.pyc +0 -0
  576. package/python/lib/python3.14/encodings/__pycache__/mac_romanian.cpython-314.pyc +0 -0
  577. package/python/lib/python3.14/encodings/__pycache__/mac_turkish.cpython-314.pyc +0 -0
  578. package/python/lib/python3.14/encodings/__pycache__/mbcs.cpython-314.pyc +0 -0
  579. package/python/lib/python3.14/encodings/__pycache__/oem.cpython-314.pyc +0 -0
  580. package/python/lib/python3.14/encodings/__pycache__/palmos.cpython-314.pyc +0 -0
  581. package/python/lib/python3.14/encodings/__pycache__/ptcp154.cpython-314.pyc +0 -0
  582. package/python/lib/python3.14/encodings/__pycache__/punycode.cpython-314.pyc +0 -0
  583. package/python/lib/python3.14/encodings/__pycache__/quopri_codec.cpython-314.pyc +0 -0
  584. package/python/lib/python3.14/encodings/__pycache__/raw_unicode_escape.cpython-314.pyc +0 -0
  585. package/python/lib/python3.14/encodings/__pycache__/rot_13.cpython-314.pyc +0 -0
  586. package/python/lib/python3.14/encodings/__pycache__/shift_jis.cpython-314.pyc +0 -0
  587. package/python/lib/python3.14/encodings/__pycache__/shift_jis_2004.cpython-314.pyc +0 -0
  588. package/python/lib/python3.14/encodings/__pycache__/shift_jisx0213.cpython-314.pyc +0 -0
  589. package/python/lib/python3.14/encodings/__pycache__/tis_620.cpython-314.pyc +0 -0
  590. package/python/lib/python3.14/encodings/__pycache__/undefined.cpython-314.pyc +0 -0
  591. package/python/lib/python3.14/encodings/__pycache__/unicode_escape.cpython-314.pyc +0 -0
  592. package/python/lib/python3.14/encodings/__pycache__/utf_16.cpython-314.pyc +0 -0
  593. package/python/lib/python3.14/encodings/__pycache__/utf_16_be.cpython-314.pyc +0 -0
  594. package/python/lib/python3.14/encodings/__pycache__/utf_16_le.cpython-314.pyc +0 -0
  595. package/python/lib/python3.14/encodings/__pycache__/utf_32.cpython-314.pyc +0 -0
  596. package/python/lib/python3.14/encodings/__pycache__/utf_32_be.cpython-314.pyc +0 -0
  597. package/python/lib/python3.14/encodings/__pycache__/utf_32_le.cpython-314.pyc +0 -0
  598. package/python/lib/python3.14/encodings/__pycache__/utf_7.cpython-314.pyc +0 -0
  599. package/python/lib/python3.14/encodings/__pycache__/utf_8.cpython-314.pyc +0 -0
  600. package/python/lib/python3.14/encodings/__pycache__/utf_8_sig.cpython-314.pyc +0 -0
  601. package/python/lib/python3.14/encodings/__pycache__/uu_codec.cpython-314.pyc +0 -0
  602. package/python/lib/python3.14/encodings/__pycache__/zlib_codec.cpython-314.pyc +0 -0
  603. package/python/lib/python3.14/encodings/_win_cp_codecs.py +36 -0
  604. package/python/lib/python3.14/encodings/aliases.py +568 -0
  605. package/python/lib/python3.14/encodings/ascii.py +50 -0
  606. package/python/lib/python3.14/encodings/base64_codec.py +55 -0
  607. package/python/lib/python3.14/encodings/big5.py +39 -0
  608. package/python/lib/python3.14/encodings/big5hkscs.py +39 -0
  609. package/python/lib/python3.14/encodings/bz2_codec.py +78 -0
  610. package/python/lib/python3.14/encodings/charmap.py +69 -0
  611. package/python/lib/python3.14/encodings/cp037.py +307 -0
  612. package/python/lib/python3.14/encodings/cp1006.py +307 -0
  613. package/python/lib/python3.14/encodings/cp1026.py +307 -0
  614. package/python/lib/python3.14/encodings/cp1125.py +698 -0
  615. package/python/lib/python3.14/encodings/cp1140.py +307 -0
  616. package/python/lib/python3.14/encodings/cp1250.py +307 -0
  617. package/python/lib/python3.14/encodings/cp1251.py +307 -0
  618. package/python/lib/python3.14/encodings/cp1252.py +307 -0
  619. package/python/lib/python3.14/encodings/cp1253.py +307 -0
  620. package/python/lib/python3.14/encodings/cp1254.py +307 -0
  621. package/python/lib/python3.14/encodings/cp1255.py +307 -0
  622. package/python/lib/python3.14/encodings/cp1256.py +307 -0
  623. package/python/lib/python3.14/encodings/cp1257.py +307 -0
  624. package/python/lib/python3.14/encodings/cp1258.py +307 -0
  625. package/python/lib/python3.14/encodings/cp273.py +307 -0
  626. package/python/lib/python3.14/encodings/cp424.py +307 -0
  627. package/python/lib/python3.14/encodings/cp437.py +698 -0
  628. package/python/lib/python3.14/encodings/cp500.py +307 -0
  629. package/python/lib/python3.14/encodings/cp720.py +309 -0
  630. package/python/lib/python3.14/encodings/cp737.py +698 -0
  631. package/python/lib/python3.14/encodings/cp775.py +697 -0
  632. package/python/lib/python3.14/encodings/cp850.py +698 -0
  633. package/python/lib/python3.14/encodings/cp852.py +698 -0
  634. package/python/lib/python3.14/encodings/cp855.py +698 -0
  635. package/python/lib/python3.14/encodings/cp856.py +307 -0
  636. package/python/lib/python3.14/encodings/cp857.py +694 -0
  637. package/python/lib/python3.14/encodings/cp858.py +698 -0
  638. package/python/lib/python3.14/encodings/cp860.py +698 -0
  639. package/python/lib/python3.14/encodings/cp861.py +698 -0
  640. package/python/lib/python3.14/encodings/cp862.py +698 -0
  641. package/python/lib/python3.14/encodings/cp863.py +698 -0
  642. package/python/lib/python3.14/encodings/cp864.py +690 -0
  643. package/python/lib/python3.14/encodings/cp865.py +698 -0
  644. package/python/lib/python3.14/encodings/cp866.py +698 -0
  645. package/python/lib/python3.14/encodings/cp869.py +689 -0
  646. package/python/lib/python3.14/encodings/cp874.py +307 -0
  647. package/python/lib/python3.14/encodings/cp875.py +307 -0
  648. package/python/lib/python3.14/encodings/cp932.py +39 -0
  649. package/python/lib/python3.14/encodings/cp949.py +39 -0
  650. package/python/lib/python3.14/encodings/cp950.py +39 -0
  651. package/python/lib/python3.14/encodings/euc_jis_2004.py +39 -0
  652. package/python/lib/python3.14/encodings/euc_jisx0213.py +39 -0
  653. package/python/lib/python3.14/encodings/euc_jp.py +39 -0
  654. package/python/lib/python3.14/encodings/euc_kr.py +39 -0
  655. package/python/lib/python3.14/encodings/gb18030.py +39 -0
  656. package/python/lib/python3.14/encodings/gb2312.py +39 -0
  657. package/python/lib/python3.14/encodings/gbk.py +39 -0
  658. package/python/lib/python3.14/encodings/hex_codec.py +55 -0
  659. package/python/lib/python3.14/encodings/hp_roman8.py +314 -0
  660. package/python/lib/python3.14/encodings/hz.py +39 -0
  661. package/python/lib/python3.14/encodings/idna.py +387 -0
  662. package/python/lib/python3.14/encodings/iso2022_jp.py +39 -0
  663. package/python/lib/python3.14/encodings/iso2022_jp_1.py +39 -0
  664. package/python/lib/python3.14/encodings/iso2022_jp_2.py +39 -0
  665. package/python/lib/python3.14/encodings/iso2022_jp_2004.py +39 -0
  666. package/python/lib/python3.14/encodings/iso2022_jp_3.py +39 -0
  667. package/python/lib/python3.14/encodings/iso2022_jp_ext.py +39 -0
  668. package/python/lib/python3.14/encodings/iso2022_kr.py +39 -0
  669. package/python/lib/python3.14/encodings/iso8859_1.py +307 -0
  670. package/python/lib/python3.14/encodings/iso8859_10.py +307 -0
  671. package/python/lib/python3.14/encodings/iso8859_11.py +307 -0
  672. package/python/lib/python3.14/encodings/iso8859_13.py +307 -0
  673. package/python/lib/python3.14/encodings/iso8859_14.py +307 -0
  674. package/python/lib/python3.14/encodings/iso8859_15.py +307 -0
  675. package/python/lib/python3.14/encodings/iso8859_16.py +307 -0
  676. package/python/lib/python3.14/encodings/iso8859_2.py +307 -0
  677. package/python/lib/python3.14/encodings/iso8859_3.py +307 -0
  678. package/python/lib/python3.14/encodings/iso8859_4.py +307 -0
  679. package/python/lib/python3.14/encodings/iso8859_5.py +307 -0
  680. package/python/lib/python3.14/encodings/iso8859_6.py +307 -0
  681. package/python/lib/python3.14/encodings/iso8859_7.py +307 -0
  682. package/python/lib/python3.14/encodings/iso8859_8.py +307 -0
  683. package/python/lib/python3.14/encodings/iso8859_9.py +307 -0
  684. package/python/lib/python3.14/encodings/johab.py +39 -0
  685. package/python/lib/python3.14/encodings/koi8_r.py +307 -0
  686. package/python/lib/python3.14/encodings/koi8_t.py +308 -0
  687. package/python/lib/python3.14/encodings/koi8_u.py +307 -0
  688. package/python/lib/python3.14/encodings/kz1048.py +307 -0
  689. package/python/lib/python3.14/encodings/latin_1.py +50 -0
  690. package/python/lib/python3.14/encodings/mac_arabic.py +698 -0
  691. package/python/lib/python3.14/encodings/mac_croatian.py +307 -0
  692. package/python/lib/python3.14/encodings/mac_cyrillic.py +307 -0
  693. package/python/lib/python3.14/encodings/mac_farsi.py +307 -0
  694. package/python/lib/python3.14/encodings/mac_greek.py +307 -0
  695. package/python/lib/python3.14/encodings/mac_iceland.py +307 -0
  696. package/python/lib/python3.14/encodings/mac_latin2.py +312 -0
  697. package/python/lib/python3.14/encodings/mac_roman.py +307 -0
  698. package/python/lib/python3.14/encodings/mac_romanian.py +307 -0
  699. package/python/lib/python3.14/encodings/mac_turkish.py +307 -0
  700. package/python/lib/python3.14/encodings/mbcs.py +47 -0
  701. package/python/lib/python3.14/encodings/oem.py +41 -0
  702. package/python/lib/python3.14/encodings/palmos.py +308 -0
  703. package/python/lib/python3.14/encodings/ptcp154.py +312 -0
  704. package/python/lib/python3.14/encodings/punycode.py +253 -0
  705. package/python/lib/python3.14/encodings/quopri_codec.py +56 -0
  706. package/python/lib/python3.14/encodings/raw_unicode_escape.py +46 -0
  707. package/python/lib/python3.14/encodings/rot_13.py +113 -0
  708. package/python/lib/python3.14/encodings/shift_jis.py +39 -0
  709. package/python/lib/python3.14/encodings/shift_jis_2004.py +39 -0
  710. package/python/lib/python3.14/encodings/shift_jisx0213.py +39 -0
  711. package/python/lib/python3.14/encodings/tis_620.py +307 -0
  712. package/python/lib/python3.14/encodings/undefined.py +49 -0
  713. package/python/lib/python3.14/encodings/unicode_escape.py +46 -0
  714. package/python/lib/python3.14/encodings/utf_16.py +155 -0
  715. package/python/lib/python3.14/encodings/utf_16_be.py +42 -0
  716. package/python/lib/python3.14/encodings/utf_16_le.py +42 -0
  717. package/python/lib/python3.14/encodings/utf_32.py +150 -0
  718. package/python/lib/python3.14/encodings/utf_32_be.py +37 -0
  719. package/python/lib/python3.14/encodings/utf_32_le.py +37 -0
  720. package/python/lib/python3.14/encodings/utf_7.py +38 -0
  721. package/python/lib/python3.14/encodings/utf_8.py +42 -0
  722. package/python/lib/python3.14/encodings/utf_8_sig.py +130 -0
  723. package/python/lib/python3.14/encodings/uu_codec.py +103 -0
  724. package/python/lib/python3.14/encodings/zlib_codec.py +77 -0
  725. package/python/lib/python3.14/enum.py +2169 -0
  726. package/python/lib/python3.14/filecmp.py +320 -0
  727. package/python/lib/python3.14/fileinput.py +442 -0
  728. package/python/lib/python3.14/fnmatch.py +209 -0
  729. package/python/lib/python3.14/fractions.py +1078 -0
  730. package/python/lib/python3.14/ftplib.py +975 -0
  731. package/python/lib/python3.14/functools.py +1165 -0
  732. package/python/lib/python3.14/genericpath.py +200 -0
  733. package/python/lib/python3.14/getopt.py +232 -0
  734. package/python/lib/python3.14/getpass.py +256 -0
  735. package/python/lib/python3.14/gettext.py +660 -0
  736. package/python/lib/python3.14/glob.py +574 -0
  737. package/python/lib/python3.14/graphlib.py +254 -0
  738. package/python/lib/python3.14/gzip.py +724 -0
  739. package/python/lib/python3.14/hashlib.py +255 -0
  740. package/python/lib/python3.14/heapq.py +611 -0
  741. package/python/lib/python3.14/hmac.py +279 -0
  742. package/python/lib/python3.14/html/__init__.py +132 -0
  743. package/python/lib/python3.14/html/__pycache__/__init__.cpython-314.pyc +0 -0
  744. package/python/lib/python3.14/html/__pycache__/entities.cpython-314.pyc +0 -0
  745. package/python/lib/python3.14/html/__pycache__/parser.cpython-314.pyc +0 -0
  746. package/python/lib/python3.14/html/entities.py +2513 -0
  747. package/python/lib/python3.14/html/parser.py +583 -0
  748. package/python/lib/python3.14/http/__init__.py +213 -0
  749. package/python/lib/python3.14/http/__pycache__/__init__.cpython-314.pyc +0 -0
  750. package/python/lib/python3.14/http/__pycache__/client.cpython-314.pyc +0 -0
  751. package/python/lib/python3.14/http/__pycache__/cookiejar.cpython-314.pyc +0 -0
  752. package/python/lib/python3.14/http/__pycache__/cookies.cpython-314.pyc +0 -0
  753. package/python/lib/python3.14/http/__pycache__/server.cpython-314.pyc +0 -0
  754. package/python/lib/python3.14/http/client.py +1598 -0
  755. package/python/lib/python3.14/http/cookiejar.py +2135 -0
  756. package/python/lib/python3.14/http/cookies.py +637 -0
  757. package/python/lib/python3.14/http/server.py +1445 -0
  758. package/python/lib/python3.14/imaplib.py +2090 -0
  759. package/python/lib/python3.14/importlib/__init__.py +136 -0
  760. package/python/lib/python3.14/importlib/__pycache__/__init__.cpython-314.pyc +0 -0
  761. package/python/lib/python3.14/importlib/__pycache__/_abc.cpython-314.pyc +0 -0
  762. package/python/lib/python3.14/importlib/__pycache__/_bootstrap.cpython-314.pyc +0 -0
  763. package/python/lib/python3.14/importlib/__pycache__/_bootstrap_external.cpython-314.pyc +0 -0
  764. package/python/lib/python3.14/importlib/__pycache__/abc.cpython-314.pyc +0 -0
  765. package/python/lib/python3.14/importlib/__pycache__/machinery.cpython-314.pyc +0 -0
  766. package/python/lib/python3.14/importlib/__pycache__/readers.cpython-314.pyc +0 -0
  767. package/python/lib/python3.14/importlib/__pycache__/simple.cpython-314.pyc +0 -0
  768. package/python/lib/python3.14/importlib/__pycache__/util.cpython-314.pyc +0 -0
  769. package/python/lib/python3.14/importlib/_abc.py +39 -0
  770. package/python/lib/python3.14/importlib/_bootstrap.py +1570 -0
  771. package/python/lib/python3.14/importlib/_bootstrap_external.py +1566 -0
  772. package/python/lib/python3.14/importlib/abc.py +234 -0
  773. package/python/lib/python3.14/importlib/machinery.py +50 -0
  774. package/python/lib/python3.14/importlib/metadata/__init__.py +1093 -0
  775. package/python/lib/python3.14/importlib/metadata/__pycache__/__init__.cpython-314.pyc +0 -0
  776. package/python/lib/python3.14/importlib/metadata/__pycache__/_adapters.cpython-314.pyc +0 -0
  777. package/python/lib/python3.14/importlib/metadata/__pycache__/_collections.cpython-314.pyc +0 -0
  778. package/python/lib/python3.14/importlib/metadata/__pycache__/_functools.cpython-314.pyc +0 -0
  779. package/python/lib/python3.14/importlib/metadata/__pycache__/_itertools.cpython-314.pyc +0 -0
  780. package/python/lib/python3.14/importlib/metadata/__pycache__/_meta.cpython-314.pyc +0 -0
  781. package/python/lib/python3.14/importlib/metadata/__pycache__/_text.cpython-314.pyc +0 -0
  782. package/python/lib/python3.14/importlib/metadata/__pycache__/diagnose.cpython-314.pyc +0 -0
  783. package/python/lib/python3.14/importlib/metadata/_adapters.py +89 -0
  784. package/python/lib/python3.14/importlib/metadata/_collections.py +30 -0
  785. package/python/lib/python3.14/importlib/metadata/_functools.py +104 -0
  786. package/python/lib/python3.14/importlib/metadata/_itertools.py +73 -0
  787. package/python/lib/python3.14/importlib/metadata/_meta.py +67 -0
  788. package/python/lib/python3.14/importlib/metadata/_text.py +99 -0
  789. package/python/lib/python3.14/importlib/metadata/diagnose.py +21 -0
  790. package/python/lib/python3.14/importlib/readers.py +12 -0
  791. package/python/lib/python3.14/importlib/resources/__init__.py +43 -0
  792. package/python/lib/python3.14/importlib/resources/__pycache__/__init__.cpython-314.pyc +0 -0
  793. package/python/lib/python3.14/importlib/resources/__pycache__/_adapters.cpython-314.pyc +0 -0
  794. package/python/lib/python3.14/importlib/resources/__pycache__/_common.cpython-314.pyc +0 -0
  795. package/python/lib/python3.14/importlib/resources/__pycache__/_functional.cpython-314.pyc +0 -0
  796. package/python/lib/python3.14/importlib/resources/__pycache__/_itertools.cpython-314.pyc +0 -0
  797. package/python/lib/python3.14/importlib/resources/__pycache__/abc.cpython-314.pyc +0 -0
  798. package/python/lib/python3.14/importlib/resources/__pycache__/readers.cpython-314.pyc +0 -0
  799. package/python/lib/python3.14/importlib/resources/__pycache__/simple.cpython-314.pyc +0 -0
  800. package/python/lib/python3.14/importlib/resources/_adapters.py +168 -0
  801. package/python/lib/python3.14/importlib/resources/_common.py +211 -0
  802. package/python/lib/python3.14/importlib/resources/_functional.py +81 -0
  803. package/python/lib/python3.14/importlib/resources/_itertools.py +38 -0
  804. package/python/lib/python3.14/importlib/resources/abc.py +173 -0
  805. package/python/lib/python3.14/importlib/resources/readers.py +203 -0
  806. package/python/lib/python3.14/importlib/resources/simple.py +106 -0
  807. package/python/lib/python3.14/importlib/simple.py +14 -0
  808. package/python/lib/python3.14/importlib/util.py +279 -0
  809. package/python/lib/python3.14/inspect.py +3425 -0
  810. package/python/lib/python3.14/io.py +150 -0
  811. package/python/lib/python3.14/ipaddress.py +2421 -0
  812. package/python/lib/python3.14/json/__init__.py +365 -0
  813. package/python/lib/python3.14/json/__main__.py +20 -0
  814. package/python/lib/python3.14/json/__pycache__/__init__.cpython-314.pyc +0 -0
  815. package/python/lib/python3.14/json/__pycache__/__main__.cpython-314.pyc +0 -0
  816. package/python/lib/python3.14/json/__pycache__/decoder.cpython-314.pyc +0 -0
  817. package/python/lib/python3.14/json/__pycache__/encoder.cpython-314.pyc +0 -0
  818. package/python/lib/python3.14/json/__pycache__/scanner.cpython-314.pyc +0 -0
  819. package/python/lib/python3.14/json/__pycache__/tool.cpython-314.pyc +0 -0
  820. package/python/lib/python3.14/json/decoder.py +364 -0
  821. package/python/lib/python3.14/json/encoder.py +461 -0
  822. package/python/lib/python3.14/json/scanner.py +73 -0
  823. package/python/lib/python3.14/json/tool.py +122 -0
  824. package/python/lib/python3.14/keyword.py +64 -0
  825. package/python/lib/python3.14/lib-dynload/.empty +0 -0
  826. package/python/lib/python3.14/lib-dynload/_dbm.cpython-314-s390x-linux-gnu.so +0 -0
  827. package/python/lib/python3.14/linecache.py +302 -0
  828. package/python/lib/python3.14/locale.py +1992 -0
  829. package/python/lib/python3.14/logging/__init__.py +2335 -0
  830. package/python/lib/python3.14/logging/__pycache__/__init__.cpython-314.pyc +0 -0
  831. package/python/lib/python3.14/logging/__pycache__/config.cpython-314.pyc +0 -0
  832. package/python/lib/python3.14/logging/__pycache__/handlers.cpython-314.pyc +0 -0
  833. package/python/lib/python3.14/logging/config.py +1093 -0
  834. package/python/lib/python3.14/logging/handlers.py +1654 -0
  835. package/python/lib/python3.14/lzma.py +364 -0
  836. package/python/lib/python3.14/mailbox.py +2220 -0
  837. package/python/lib/python3.14/mimetypes.py +755 -0
  838. package/python/lib/python3.14/modulefinder.py +671 -0
  839. package/python/lib/python3.14/multiprocessing/__init__.py +37 -0
  840. package/python/lib/python3.14/multiprocessing/__pycache__/__init__.cpython-314.pyc +0 -0
  841. package/python/lib/python3.14/multiprocessing/__pycache__/connection.cpython-314.pyc +0 -0
  842. package/python/lib/python3.14/multiprocessing/__pycache__/context.cpython-314.pyc +0 -0
  843. package/python/lib/python3.14/multiprocessing/__pycache__/forkserver.cpython-314.pyc +0 -0
  844. package/python/lib/python3.14/multiprocessing/__pycache__/heap.cpython-314.pyc +0 -0
  845. package/python/lib/python3.14/multiprocessing/__pycache__/managers.cpython-314.pyc +0 -0
  846. package/python/lib/python3.14/multiprocessing/__pycache__/pool.cpython-314.pyc +0 -0
  847. package/python/lib/python3.14/multiprocessing/__pycache__/popen_fork.cpython-314.pyc +0 -0
  848. package/python/lib/python3.14/multiprocessing/__pycache__/popen_forkserver.cpython-314.pyc +0 -0
  849. package/python/lib/python3.14/multiprocessing/__pycache__/popen_spawn_posix.cpython-314.pyc +0 -0
  850. package/python/lib/python3.14/multiprocessing/__pycache__/popen_spawn_win32.cpython-314.pyc +0 -0
  851. package/python/lib/python3.14/multiprocessing/__pycache__/process.cpython-314.pyc +0 -0
  852. package/python/lib/python3.14/multiprocessing/__pycache__/queues.cpython-314.pyc +0 -0
  853. package/python/lib/python3.14/multiprocessing/__pycache__/reduction.cpython-314.pyc +0 -0
  854. package/python/lib/python3.14/multiprocessing/__pycache__/resource_sharer.cpython-314.pyc +0 -0
  855. package/python/lib/python3.14/multiprocessing/__pycache__/resource_tracker.cpython-314.pyc +0 -0
  856. package/python/lib/python3.14/multiprocessing/__pycache__/shared_memory.cpython-314.pyc +0 -0
  857. package/python/lib/python3.14/multiprocessing/__pycache__/sharedctypes.cpython-314.pyc +0 -0
  858. package/python/lib/python3.14/multiprocessing/__pycache__/spawn.cpython-314.pyc +0 -0
  859. package/python/lib/python3.14/multiprocessing/__pycache__/synchronize.cpython-314.pyc +0 -0
  860. package/python/lib/python3.14/multiprocessing/__pycache__/util.cpython-314.pyc +0 -0
  861. package/python/lib/python3.14/multiprocessing/connection.py +1233 -0
  862. package/python/lib/python3.14/multiprocessing/context.py +405 -0
  863. package/python/lib/python3.14/multiprocessing/dummy/__init__.py +126 -0
  864. package/python/lib/python3.14/multiprocessing/dummy/__pycache__/__init__.cpython-314.pyc +0 -0
  865. package/python/lib/python3.14/multiprocessing/dummy/__pycache__/connection.cpython-314.pyc +0 -0
  866. package/python/lib/python3.14/multiprocessing/dummy/connection.py +75 -0
  867. package/python/lib/python3.14/multiprocessing/forkserver.py +429 -0
  868. package/python/lib/python3.14/multiprocessing/heap.py +337 -0
  869. package/python/lib/python3.14/multiprocessing/managers.py +1438 -0
  870. package/python/lib/python3.14/multiprocessing/pool.py +957 -0
  871. package/python/lib/python3.14/multiprocessing/popen_fork.py +100 -0
  872. package/python/lib/python3.14/multiprocessing/popen_forkserver.py +74 -0
  873. package/python/lib/python3.14/multiprocessing/popen_spawn_posix.py +76 -0
  874. package/python/lib/python3.14/multiprocessing/popen_spawn_win32.py +147 -0
  875. package/python/lib/python3.14/multiprocessing/process.py +443 -0
  876. package/python/lib/python3.14/multiprocessing/queues.py +399 -0
  877. package/python/lib/python3.14/multiprocessing/reduction.py +281 -0
  878. package/python/lib/python3.14/multiprocessing/resource_sharer.py +154 -0
  879. package/python/lib/python3.14/multiprocessing/resource_tracker.py +495 -0
  880. package/python/lib/python3.14/multiprocessing/shared_memory.py +544 -0
  881. package/python/lib/python3.14/multiprocessing/sharedctypes.py +240 -0
  882. package/python/lib/python3.14/multiprocessing/spawn.py +307 -0
  883. package/python/lib/python3.14/multiprocessing/synchronize.py +411 -0
  884. package/python/lib/python3.14/multiprocessing/util.py +619 -0
  885. package/python/lib/python3.14/netrc.py +200 -0
  886. package/python/lib/python3.14/ntpath.py +889 -0
  887. package/python/lib/python3.14/nturl2path.py +82 -0
  888. package/python/lib/python3.14/numbers.py +427 -0
  889. package/python/lib/python3.14/opcode.py +122 -0
  890. package/python/lib/python3.14/operator.py +475 -0
  891. package/python/lib/python3.14/optparse.py +1664 -0
  892. package/python/lib/python3.14/os.py +1191 -0
  893. package/python/lib/python3.14/pathlib/__init__.py +1307 -0
  894. package/python/lib/python3.14/pathlib/__pycache__/__init__.cpython-314.pyc +0 -0
  895. package/python/lib/python3.14/pathlib/__pycache__/_local.cpython-314.pyc +0 -0
  896. package/python/lib/python3.14/pathlib/__pycache__/_os.cpython-314.pyc +0 -0
  897. package/python/lib/python3.14/pathlib/__pycache__/types.cpython-314.pyc +0 -0
  898. package/python/lib/python3.14/pathlib/_local.py +12 -0
  899. package/python/lib/python3.14/pathlib/_os.py +530 -0
  900. package/python/lib/python3.14/pathlib/types.py +430 -0
  901. package/python/lib/python3.14/pdb.py +3682 -0
  902. package/python/lib/python3.14/pickle.py +1925 -0
  903. package/python/lib/python3.14/pickletools.py +2887 -0
  904. package/python/lib/python3.14/pkgutil.py +474 -0
  905. package/python/lib/python3.14/platform.py +1515 -0
  906. package/python/lib/python3.14/plistlib.py +956 -0
  907. package/python/lib/python3.14/poplib.py +477 -0
  908. package/python/lib/python3.14/posixpath.py +592 -0
  909. package/python/lib/python3.14/pprint.py +675 -0
  910. package/python/lib/python3.14/profile.py +615 -0
  911. package/python/lib/python3.14/pstats.py +777 -0
  912. package/python/lib/python3.14/pty.py +182 -0
  913. package/python/lib/python3.14/py_compile.py +212 -0
  914. package/python/lib/python3.14/pyclbr.py +314 -0
  915. package/python/lib/python3.14/pydoc.py +2890 -0
  916. package/python/lib/python3.14/queue.py +385 -0
  917. package/python/lib/python3.14/quopri.py +235 -0
  918. package/python/lib/python3.14/random.py +1087 -0
  919. package/python/lib/python3.14/re/__init__.py +428 -0
  920. package/python/lib/python3.14/re/__pycache__/__init__.cpython-314.pyc +0 -0
  921. package/python/lib/python3.14/re/__pycache__/_casefix.cpython-314.pyc +0 -0
  922. package/python/lib/python3.14/re/__pycache__/_compiler.cpython-314.pyc +0 -0
  923. package/python/lib/python3.14/re/__pycache__/_constants.cpython-314.pyc +0 -0
  924. package/python/lib/python3.14/re/__pycache__/_parser.cpython-314.pyc +0 -0
  925. package/python/lib/python3.14/re/_casefix.py +106 -0
  926. package/python/lib/python3.14/re/_compiler.py +782 -0
  927. package/python/lib/python3.14/re/_constants.py +224 -0
  928. package/python/lib/python3.14/re/_parser.py +1066 -0
  929. package/python/lib/python3.14/reprlib.py +230 -0
  930. package/python/lib/python3.14/rlcompleter.py +222 -0
  931. package/python/lib/python3.14/runpy.py +326 -0
  932. package/python/lib/python3.14/sched.py +167 -0
  933. package/python/lib/python3.14/secrets.py +71 -0
  934. package/python/lib/python3.14/selectors.py +603 -0
  935. package/python/lib/python3.14/shelve.py +250 -0
  936. package/python/lib/python3.14/shlex.py +351 -0
  937. package/python/lib/python3.14/shutil.py +1660 -0
  938. package/python/lib/python3.14/signal.py +94 -0
  939. package/python/lib/python3.14/site-packages/_yaml/__init__.py +33 -0
  940. package/python/lib/python3.14/site-packages/_yaml/__pycache__/__init__.cpython-314.pyc +0 -0
  941. package/python/lib/python3.14/site-packages/click/__init__.py +144 -0
  942. package/python/lib/python3.14/site-packages/click/__pycache__/__init__.cpython-314.pyc +0 -0
  943. package/python/lib/python3.14/site-packages/click/__pycache__/_compat.cpython-314.pyc +0 -0
  944. package/python/lib/python3.14/site-packages/click/__pycache__/_termui_impl.cpython-314.pyc +0 -0
  945. package/python/lib/python3.14/site-packages/click/__pycache__/_textwrap.cpython-314.pyc +0 -0
  946. package/python/lib/python3.14/site-packages/click/__pycache__/_utils.cpython-314.pyc +0 -0
  947. package/python/lib/python3.14/site-packages/click/__pycache__/_winconsole.cpython-314.pyc +0 -0
  948. package/python/lib/python3.14/site-packages/click/__pycache__/core.cpython-314.pyc +0 -0
  949. package/python/lib/python3.14/site-packages/click/__pycache__/decorators.cpython-314.pyc +0 -0
  950. package/python/lib/python3.14/site-packages/click/__pycache__/exceptions.cpython-314.pyc +0 -0
  951. package/python/lib/python3.14/site-packages/click/__pycache__/formatting.cpython-314.pyc +0 -0
  952. package/python/lib/python3.14/site-packages/click/__pycache__/globals.cpython-314.pyc +0 -0
  953. package/python/lib/python3.14/site-packages/click/__pycache__/parser.cpython-314.pyc +0 -0
  954. package/python/lib/python3.14/site-packages/click/__pycache__/shell_completion.cpython-314.pyc +0 -0
  955. package/python/lib/python3.14/site-packages/click/__pycache__/termui.cpython-314.pyc +0 -0
  956. package/python/lib/python3.14/site-packages/click/__pycache__/testing.cpython-314.pyc +0 -0
  957. package/python/lib/python3.14/site-packages/click/__pycache__/types.cpython-314.pyc +0 -0
  958. package/python/lib/python3.14/site-packages/click/__pycache__/utils.cpython-314.pyc +0 -0
  959. package/python/lib/python3.14/site-packages/click/_compat.py +590 -0
  960. package/python/lib/python3.14/site-packages/click/_termui_impl.py +970 -0
  961. package/python/lib/python3.14/site-packages/click/_textwrap.py +188 -0
  962. package/python/lib/python3.14/site-packages/click/_utils.py +45 -0
  963. package/python/lib/python3.14/site-packages/click/_winconsole.py +292 -0
  964. package/python/lib/python3.14/site-packages/click/core.py +3825 -0
  965. package/python/lib/python3.14/site-packages/click/decorators.py +625 -0
  966. package/python/lib/python3.14/site-packages/click/exceptions.py +378 -0
  967. package/python/lib/python3.14/site-packages/click/formatting.py +320 -0
  968. package/python/lib/python3.14/site-packages/click/globals.py +67 -0
  969. package/python/lib/python3.14/site-packages/click/parser.py +533 -0
  970. package/python/lib/python3.14/site-packages/click/py.typed +0 -0
  971. package/python/lib/python3.14/site-packages/click/shell_completion.py +796 -0
  972. package/python/lib/python3.14/site-packages/click/termui.py +1024 -0
  973. package/python/lib/python3.14/site-packages/click/testing.py +796 -0
  974. package/python/lib/python3.14/site-packages/click/types.py +1437 -0
  975. package/python/lib/python3.14/site-packages/click/utils.py +676 -0
  976. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/INSTALLER +1 -0
  977. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/METADATA +83 -0
  978. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/RECORD +24 -0
  979. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/REQUESTED +0 -0
  980. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/WHEEL +4 -0
  981. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/licenses/LICENSE.txt +28 -0
  982. package/python/lib/python3.14/site-packages/cssbeautifier/__init__.py +51 -0
  983. package/python/lib/python3.14/site-packages/cssbeautifier/__pycache__/__init__.cpython-314.pyc +0 -0
  984. package/python/lib/python3.14/site-packages/cssbeautifier/__pycache__/__version__.cpython-314.pyc +0 -0
  985. package/python/lib/python3.14/site-packages/cssbeautifier/__pycache__/_main.cpython-314.pyc +0 -0
  986. package/python/lib/python3.14/site-packages/cssbeautifier/__version__.py +1 -0
  987. package/python/lib/python3.14/site-packages/cssbeautifier/_main.py +208 -0
  988. package/python/lib/python3.14/site-packages/cssbeautifier/css/__init__.py +1 -0
  989. package/python/lib/python3.14/site-packages/cssbeautifier/css/__pycache__/__init__.cpython-314.pyc +0 -0
  990. package/python/lib/python3.14/site-packages/cssbeautifier/css/__pycache__/beautifier.cpython-314.pyc +0 -0
  991. package/python/lib/python3.14/site-packages/cssbeautifier/css/__pycache__/options.cpython-314.pyc +0 -0
  992. package/python/lib/python3.14/site-packages/cssbeautifier/css/beautifier.py +559 -0
  993. package/python/lib/python3.14/site-packages/cssbeautifier/css/options.py +60 -0
  994. package/python/lib/python3.14/site-packages/cssbeautifier/tests/__init__.py +1 -0
  995. package/python/lib/python3.14/site-packages/cssbeautifier/tests/__pycache__/__init__.cpython-314.pyc +0 -0
  996. package/python/lib/python3.14/site-packages/cssbeautifier/tests/generated/__init__.py +1 -0
  997. package/python/lib/python3.14/site-packages/cssbeautifier/tests/generated/__pycache__/__init__.cpython-314.pyc +0 -0
  998. package/python/lib/python3.14/site-packages/cssbeautifier/tests/generated/__pycache__/tests.cpython-314.pyc +0 -0
  999. package/python/lib/python3.14/site-packages/cssbeautifier/tests/generated/tests.py +11333 -0
  1000. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/INSTALLER +1 -0
  1001. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/METADATA +19 -0
  1002. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/RECORD +51 -0
  1003. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/REQUESTED +0 -0
  1004. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/WHEEL +5 -0
  1005. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/entry_points.txt +2 -0
  1006. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/top_level.txt +1 -0
  1007. package/python/lib/python3.14/site-packages/djlint/__init__.py +27 -0
  1008. package/python/lib/python3.14/site-packages/djlint/__main__.py +8 -0
  1009. package/python/lib/python3.14/site-packages/djlint/__pycache__/__init__.cpython-314.pyc +0 -0
  1010. package/python/lib/python3.14/site-packages/djlint/__pycache__/__main__.cpython-314.pyc +0 -0
  1011. package/python/lib/python3.14/site-packages/djlint/__pycache__/_cli.cpython-314.pyc +0 -0
  1012. package/python/lib/python3.14/site-packages/djlint/__pycache__/api.cpython-314.pyc +0 -0
  1013. package/python/lib/python3.14/site-packages/djlint/__pycache__/const.cpython-314.pyc +0 -0
  1014. package/python/lib/python3.14/site-packages/djlint/__pycache__/github_output.cpython-314.pyc +0 -0
  1015. package/python/lib/python3.14/site-packages/djlint/__pycache__/helpers.cpython-314.pyc +0 -0
  1016. package/python/lib/python3.14/site-packages/djlint/__pycache__/lint.cpython-314.pyc +0 -0
  1017. package/python/lib/python3.14/site-packages/djlint/__pycache__/output.cpython-314.pyc +0 -0
  1018. package/python/lib/python3.14/site-packages/djlint/__pycache__/reformat.cpython-314.pyc +0 -0
  1019. package/python/lib/python3.14/site-packages/djlint/__pycache__/sarif_output.cpython-314.pyc +0 -0
  1020. package/python/lib/python3.14/site-packages/djlint/__pycache__/server.cpython-314.pyc +0 -0
  1021. package/python/lib/python3.14/site-packages/djlint/__pycache__/settings.cpython-314.pyc +0 -0
  1022. package/python/lib/python3.14/site-packages/djlint/__pycache__/src.cpython-314.pyc +0 -0
  1023. package/python/lib/python3.14/site-packages/djlint/_cli.py +1006 -0
  1024. package/python/lib/python3.14/site-packages/djlint/api.py +106 -0
  1025. package/python/lib/python3.14/site-packages/djlint/const.py +506 -0
  1026. package/python/lib/python3.14/site-packages/djlint/formatter/__init__.py +0 -0
  1027. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/__init__.cpython-314.pyc +0 -0
  1028. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/attribute_values.cpython-314.pyc +0 -0
  1029. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/attributes.cpython-314.pyc +0 -0
  1030. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/beautifier.cpython-314.pyc +0 -0
  1031. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/class_attributes.cpython-314.pyc +0 -0
  1032. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/compress.cpython-314.pyc +0 -0
  1033. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/condense.cpython-314.pyc +0 -0
  1034. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/css.cpython-314.pyc +0 -0
  1035. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/endblocks.cpython-314.pyc +0 -0
  1036. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/entities.cpython-314.pyc +0 -0
  1037. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/expand.cpython-314.pyc +0 -0
  1038. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/indent.cpython-314.pyc +0 -0
  1039. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/js.cpython-314.pyc +0 -0
  1040. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/load_tags.cpython-314.pyc +0 -0
  1041. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/mako.cpython-314.pyc +0 -0
  1042. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/tokenizer.cpython-314.pyc +0 -0
  1043. package/python/lib/python3.14/site-packages/djlint/formatter/attribute_values.py +152 -0
  1044. package/python/lib/python3.14/site-packages/djlint/formatter/attributes.py +580 -0
  1045. package/python/lib/python3.14/site-packages/djlint/formatter/beautifier.py +144 -0
  1046. package/python/lib/python3.14/site-packages/djlint/formatter/class_attributes.py +318 -0
  1047. package/python/lib/python3.14/site-packages/djlint/formatter/compress.py +158 -0
  1048. package/python/lib/python3.14/site-packages/djlint/formatter/condense.py +503 -0
  1049. package/python/lib/python3.14/site-packages/djlint/formatter/css.py +28 -0
  1050. package/python/lib/python3.14/site-packages/djlint/formatter/endblocks.py +68 -0
  1051. package/python/lib/python3.14/site-packages/djlint/formatter/entities.py +39 -0
  1052. package/python/lib/python3.14/site-packages/djlint/formatter/expand.py +576 -0
  1053. package/python/lib/python3.14/site-packages/djlint/formatter/indent.py +1239 -0
  1054. package/python/lib/python3.14/site-packages/djlint/formatter/js.py +82 -0
  1055. package/python/lib/python3.14/site-packages/djlint/formatter/load_tags.py +60 -0
  1056. package/python/lib/python3.14/site-packages/djlint/formatter/mako.py +501 -0
  1057. package/python/lib/python3.14/site-packages/djlint/formatter/tokenizer.py +359 -0
  1058. package/python/lib/python3.14/site-packages/djlint/github_output.py +117 -0
  1059. package/python/lib/python3.14/site-packages/djlint/helpers.py +979 -0
  1060. package/python/lib/python3.14/site-packages/djlint/lint.py +246 -0
  1061. package/python/lib/python3.14/site-packages/djlint/output.py +250 -0
  1062. package/python/lib/python3.14/site-packages/djlint/py.typed +0 -0
  1063. package/python/lib/python3.14/site-packages/djlint/reformat.py +130 -0
  1064. package/python/lib/python3.14/site-packages/djlint/rules/D058.py +78 -0
  1065. package/python/lib/python3.14/site-packages/djlint/rules/D059.py +139 -0
  1066. package/python/lib/python3.14/site-packages/djlint/rules/H009.py +54 -0
  1067. package/python/lib/python3.14/site-packages/djlint/rules/H012.py +240 -0
  1068. package/python/lib/python3.14/site-packages/djlint/rules/H014.py +68 -0
  1069. package/python/lib/python3.14/site-packages/djlint/rules/H016.py +83 -0
  1070. package/python/lib/python3.14/site-packages/djlint/rules/H022.py +161 -0
  1071. package/python/lib/python3.14/site-packages/djlint/rules/H025.py +141 -0
  1072. package/python/lib/python3.14/site-packages/djlint/rules/H036.py +183 -0
  1073. package/python/lib/python3.14/site-packages/djlint/rules/H037.py +138 -0
  1074. package/python/lib/python3.14/site-packages/djlint/rules/H041.py +113 -0
  1075. package/python/lib/python3.14/site-packages/djlint/rules/H042.py +199 -0
  1076. package/python/lib/python3.14/site-packages/djlint/rules/H044.py +119 -0
  1077. package/python/lib/python3.14/site-packages/djlint/rules/H047.py +118 -0
  1078. package/python/lib/python3.14/site-packages/djlint/rules/H048.py +82 -0
  1079. package/python/lib/python3.14/site-packages/djlint/rules/H051.py +98 -0
  1080. package/python/lib/python3.14/site-packages/djlint/rules/H053.py +361 -0
  1081. package/python/lib/python3.14/site-packages/djlint/rules/H054.py +264 -0
  1082. package/python/lib/python3.14/site-packages/djlint/rules/H057.py +235 -0
  1083. package/python/lib/python3.14/site-packages/djlint/rules/T001.py +103 -0
  1084. package/python/lib/python3.14/site-packages/djlint/rules/T002.py +75 -0
  1085. package/python/lib/python3.14/site-packages/djlint/rules/T003.py +93 -0
  1086. package/python/lib/python3.14/site-packages/djlint/rules/T027.py +183 -0
  1087. package/python/lib/python3.14/site-packages/djlint/rules/T038.py +152 -0
  1088. package/python/lib/python3.14/site-packages/djlint/rules/T039.py +167 -0
  1089. package/python/lib/python3.14/site-packages/djlint/rules/T041.py +307 -0
  1090. package/python/lib/python3.14/site-packages/djlint/rules/T042.py +219 -0
  1091. package/python/lib/python3.14/site-packages/djlint/rules/T043.py +154 -0
  1092. package/python/lib/python3.14/site-packages/djlint/rules/T044.py +189 -0
  1093. package/python/lib/python3.14/site-packages/djlint/rules/T045.py +281 -0
  1094. package/python/lib/python3.14/site-packages/djlint/rules/__init__.py +0 -0
  1095. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/D058.cpython-314.pyc +0 -0
  1096. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/D059.cpython-314.pyc +0 -0
  1097. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H009.cpython-314.pyc +0 -0
  1098. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H012.cpython-314.pyc +0 -0
  1099. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H014.cpython-314.pyc +0 -0
  1100. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H016.cpython-314.pyc +0 -0
  1101. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H022.cpython-314.pyc +0 -0
  1102. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H025.cpython-314.pyc +0 -0
  1103. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H036.cpython-314.pyc +0 -0
  1104. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H037.cpython-314.pyc +0 -0
  1105. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H041.cpython-314.pyc +0 -0
  1106. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H042.cpython-314.pyc +0 -0
  1107. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H044.cpython-314.pyc +0 -0
  1108. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H047.cpython-314.pyc +0 -0
  1109. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H048.cpython-314.pyc +0 -0
  1110. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H051.cpython-314.pyc +0 -0
  1111. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H053.cpython-314.pyc +0 -0
  1112. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H054.cpython-314.pyc +0 -0
  1113. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H057.cpython-314.pyc +0 -0
  1114. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T001.cpython-314.pyc +0 -0
  1115. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T002.cpython-314.pyc +0 -0
  1116. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T003.cpython-314.pyc +0 -0
  1117. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T027.cpython-314.pyc +0 -0
  1118. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T038.cpython-314.pyc +0 -0
  1119. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T039.cpython-314.pyc +0 -0
  1120. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T041.cpython-314.pyc +0 -0
  1121. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T042.cpython-314.pyc +0 -0
  1122. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T043.cpython-314.pyc +0 -0
  1123. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T044.cpython-314.pyc +0 -0
  1124. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T045.cpython-314.pyc +0 -0
  1125. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/__init__.cpython-314.pyc +0 -0
  1126. package/python/lib/python3.14/site-packages/djlint/rules.yaml +482 -0
  1127. package/python/lib/python3.14/site-packages/djlint/sarif_output.py +171 -0
  1128. package/python/lib/python3.14/site-packages/djlint/server.py +983 -0
  1129. package/python/lib/python3.14/site-packages/djlint/settings.py +2381 -0
  1130. package/python/lib/python3.14/site-packages/djlint/src.py +192 -0
  1131. package/python/lib/python3.14/site-packages/djlint/types.pyi +20 -0
  1132. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/INSTALLER +1 -0
  1133. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/METADATA +236 -0
  1134. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/RECORD +73 -0
  1135. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/REQUESTED +0 -0
  1136. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/WHEEL +4 -0
  1137. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/entry_points.txt +2 -0
  1138. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/licenses/LICENSE +675 -0
  1139. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/licenses/LICENSE-THIRD-PARTY +271 -0
  1140. package/python/lib/python3.14/site-packages/editorconfig/__init__.py +20 -0
  1141. package/python/lib/python3.14/site-packages/editorconfig/__main__.py +83 -0
  1142. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/__init__.cpython-314.pyc +0 -0
  1143. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/__main__.cpython-314.pyc +0 -0
  1144. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/exceptions.cpython-314.pyc +0 -0
  1145. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/fnmatch.cpython-314.pyc +0 -0
  1146. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/handler.cpython-314.pyc +0 -0
  1147. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/ini.cpython-314.pyc +0 -0
  1148. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/version.cpython-314.pyc +0 -0
  1149. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/versiontools.cpython-314.pyc +0 -0
  1150. package/python/lib/python3.14/site-packages/editorconfig/exceptions.py +24 -0
  1151. package/python/lib/python3.14/site-packages/editorconfig/fnmatch.py +224 -0
  1152. package/python/lib/python3.14/site-packages/editorconfig/handler.py +128 -0
  1153. package/python/lib/python3.14/site-packages/editorconfig/ini.py +173 -0
  1154. package/python/lib/python3.14/site-packages/editorconfig/py.typed +0 -0
  1155. package/python/lib/python3.14/site-packages/editorconfig/version.py +1 -0
  1156. package/python/lib/python3.14/site-packages/editorconfig/versiontools.py +36 -0
  1157. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/INSTALLER +1 -0
  1158. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/METADATA +116 -0
  1159. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/RECORD +20 -0
  1160. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/REQUESTED +0 -0
  1161. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/WHEEL +5 -0
  1162. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/entry_points.txt +2 -0
  1163. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/licenses/COPYING +11 -0
  1164. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/licenses/LICENSE.BSD +22 -0
  1165. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/licenses/LICENSE.PSF +192 -0
  1166. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/top_level.txt +1 -0
  1167. package/python/lib/python3.14/site-packages/jsbeautifier/__init__.py +309 -0
  1168. package/python/lib/python3.14/site-packages/jsbeautifier/__pycache__/__init__.cpython-314.pyc +0 -0
  1169. package/python/lib/python3.14/site-packages/jsbeautifier/__pycache__/__version__.cpython-314.pyc +0 -0
  1170. package/python/lib/python3.14/site-packages/jsbeautifier/__version__.py +1 -0
  1171. package/python/lib/python3.14/site-packages/jsbeautifier/cli/__init__.py +210 -0
  1172. package/python/lib/python3.14/site-packages/jsbeautifier/cli/__pycache__/__init__.cpython-314.pyc +0 -0
  1173. package/python/lib/python3.14/site-packages/jsbeautifier/core/__init__.py +1 -0
  1174. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/__init__.cpython-314.pyc +0 -0
  1175. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/directives.cpython-314.pyc +0 -0
  1176. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/inputscanner.cpython-314.pyc +0 -0
  1177. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/options.cpython-314.pyc +0 -0
  1178. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/output.cpython-314.pyc +0 -0
  1179. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/pattern.cpython-314.pyc +0 -0
  1180. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/templatablepattern.cpython-314.pyc +0 -0
  1181. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/token.cpython-314.pyc +0 -0
  1182. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/tokenizer.cpython-314.pyc +0 -0
  1183. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/tokenstream.cpython-314.pyc +0 -0
  1184. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/whitespacepattern.cpython-314.pyc +0 -0
  1185. package/python/lib/python3.14/site-packages/jsbeautifier/core/directives.py +55 -0
  1186. package/python/lib/python3.14/site-packages/jsbeautifier/core/inputscanner.py +139 -0
  1187. package/python/lib/python3.14/site-packages/jsbeautifier/core/options.py +230 -0
  1188. package/python/lib/python3.14/site-packages/jsbeautifier/core/output.py +352 -0
  1189. package/python/lib/python3.14/site-packages/jsbeautifier/core/pattern.py +83 -0
  1190. package/python/lib/python3.14/site-packages/jsbeautifier/core/templatablepattern.py +192 -0
  1191. package/python/lib/python3.14/site-packages/jsbeautifier/core/token.py +38 -0
  1192. package/python/lib/python3.14/site-packages/jsbeautifier/core/tokenizer.py +138 -0
  1193. package/python/lib/python3.14/site-packages/jsbeautifier/core/tokenstream.py +74 -0
  1194. package/python/lib/python3.14/site-packages/jsbeautifier/core/whitespacepattern.py +73 -0
  1195. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__init__.py +1 -0
  1196. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/__init__.cpython-314.pyc +0 -0
  1197. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/acorn.cpython-314.pyc +0 -0
  1198. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/beautifier.cpython-314.pyc +0 -0
  1199. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/options.cpython-314.pyc +0 -0
  1200. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/tokenizer.cpython-314.pyc +0 -0
  1201. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/acorn.py +81 -0
  1202. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/beautifier.py +1647 -0
  1203. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/options.py +102 -0
  1204. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/tokenizer.py +628 -0
  1205. package/python/lib/python3.14/site-packages/jsbeautifier/tests/__init__.py +1 -0
  1206. package/python/lib/python3.14/site-packages/jsbeautifier/tests/__pycache__/__init__.cpython-314.pyc +0 -0
  1207. package/python/lib/python3.14/site-packages/jsbeautifier/tests/__pycache__/testindentation.cpython-314.pyc +0 -0
  1208. package/python/lib/python3.14/site-packages/jsbeautifier/tests/generated/__init__.py +1 -0
  1209. package/python/lib/python3.14/site-packages/jsbeautifier/tests/generated/__pycache__/__init__.cpython-314.pyc +0 -0
  1210. package/python/lib/python3.14/site-packages/jsbeautifier/tests/generated/__pycache__/tests.cpython-314.pyc +0 -0
  1211. package/python/lib/python3.14/site-packages/jsbeautifier/tests/generated/tests.py +10470 -0
  1212. package/python/lib/python3.14/site-packages/jsbeautifier/tests/testindentation.py +49 -0
  1213. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__init__.py +73 -0
  1214. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/__init__.cpython-314.pyc +0 -0
  1215. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/evalbased.cpython-314.pyc +0 -0
  1216. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/javascriptobfuscator.cpython-314.pyc +0 -0
  1217. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/myobfuscate.cpython-314.pyc +0 -0
  1218. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/packer.cpython-314.pyc +0 -0
  1219. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/urlencode.cpython-314.pyc +0 -0
  1220. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/evalbased.py +44 -0
  1221. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/javascriptobfuscator.py +61 -0
  1222. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/myobfuscate.py +83 -0
  1223. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/packer.py +158 -0
  1224. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__init__.py +2 -0
  1225. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/__init__.cpython-314.pyc +0 -0
  1226. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/testjavascriptobfuscator.cpython-314.pyc +0 -0
  1227. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/testmyobfuscate.cpython-314.pyc +0 -0
  1228. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/testpacker.cpython-314.pyc +0 -0
  1229. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/testurlencode.cpython-314.pyc +0 -0
  1230. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/testjavascriptobfuscator.py +59 -0
  1231. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/testmyobfuscate.py +48 -0
  1232. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/testpacker.py +72 -0
  1233. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/testurlencode.py +46 -0
  1234. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/urlencode.py +32 -0
  1235. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/INSTALLER +1 -0
  1236. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/METADATA +18 -0
  1237. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/RECORD +42 -0
  1238. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/REQUESTED +0 -0
  1239. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/WHEEL +5 -0
  1240. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/entry_points.txt +2 -0
  1241. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/top_level.txt +1 -0
  1242. package/python/lib/python3.14/site-packages/json5/__init__.py +30 -0
  1243. package/python/lib/python3.14/site-packages/json5/__main__.py +22 -0
  1244. package/python/lib/python3.14/site-packages/json5/__pycache__/__init__.cpython-314.pyc +0 -0
  1245. package/python/lib/python3.14/site-packages/json5/__pycache__/__main__.cpython-314.pyc +0 -0
  1246. package/python/lib/python3.14/site-packages/json5/__pycache__/host.cpython-314.pyc +0 -0
  1247. package/python/lib/python3.14/site-packages/json5/__pycache__/lib.cpython-314.pyc +0 -0
  1248. package/python/lib/python3.14/site-packages/json5/__pycache__/parser.cpython-314.pyc +0 -0
  1249. package/python/lib/python3.14/site-packages/json5/__pycache__/tool.cpython-314.pyc +0 -0
  1250. package/python/lib/python3.14/site-packages/json5/__pycache__/version.cpython-314.pyc +0 -0
  1251. package/python/lib/python3.14/site-packages/json5/host.py +53 -0
  1252. package/python/lib/python3.14/site-packages/json5/lib.py +1007 -0
  1253. package/python/lib/python3.14/site-packages/json5/parser.py +1376 -0
  1254. package/python/lib/python3.14/site-packages/json5/py.typed +0 -0
  1255. package/python/lib/python3.14/site-packages/json5/tool.py +198 -0
  1256. package/python/lib/python3.14/site-packages/json5/version.py +18 -0
  1257. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/INSTALLER +1 -0
  1258. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/METADATA +585 -0
  1259. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/RECORD +17 -0
  1260. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/REQUESTED +0 -0
  1261. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/WHEEL +5 -0
  1262. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/entry_points.txt +2 -0
  1263. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/licenses/LICENSE +281 -0
  1264. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/top_level.txt +1 -0
  1265. package/python/lib/python3.14/site-packages/pathspec/__init__.py +68 -0
  1266. package/python/lib/python3.14/site-packages/pathspec/__pycache__/__init__.cpython-314.pyc +0 -0
  1267. package/python/lib/python3.14/site-packages/pathspec/__pycache__/_meta.cpython-314.pyc +0 -0
  1268. package/python/lib/python3.14/site-packages/pathspec/__pycache__/_typing.cpython-314.pyc +0 -0
  1269. package/python/lib/python3.14/site-packages/pathspec/__pycache__/_version.cpython-314.pyc +0 -0
  1270. package/python/lib/python3.14/site-packages/pathspec/__pycache__/backend.cpython-314.pyc +0 -0
  1271. package/python/lib/python3.14/site-packages/pathspec/__pycache__/gitignore.cpython-314.pyc +0 -0
  1272. package/python/lib/python3.14/site-packages/pathspec/__pycache__/pathspec.cpython-314.pyc +0 -0
  1273. package/python/lib/python3.14/site-packages/pathspec/__pycache__/pattern.cpython-314.pyc +0 -0
  1274. package/python/lib/python3.14/site-packages/pathspec/__pycache__/util.cpython-314.pyc +0 -0
  1275. package/python/lib/python3.14/site-packages/pathspec/_backends/__init__.py +4 -0
  1276. package/python/lib/python3.14/site-packages/pathspec/_backends/__pycache__/__init__.cpython-314.pyc +0 -0
  1277. package/python/lib/python3.14/site-packages/pathspec/_backends/__pycache__/_utils.cpython-314.pyc +0 -0
  1278. package/python/lib/python3.14/site-packages/pathspec/_backends/__pycache__/agg.cpython-314.pyc +0 -0
  1279. package/python/lib/python3.14/site-packages/pathspec/_backends/_utils.py +45 -0
  1280. package/python/lib/python3.14/site-packages/pathspec/_backends/agg.py +104 -0
  1281. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__init__.py +0 -0
  1282. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/__init__.cpython-314.pyc +0 -0
  1283. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/_base.cpython-314.pyc +0 -0
  1284. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/base.cpython-314.pyc +0 -0
  1285. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/gitignore.cpython-314.pyc +0 -0
  1286. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/pathspec.cpython-314.pyc +0 -0
  1287. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/_base.py +78 -0
  1288. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/base.py +24 -0
  1289. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/gitignore.py +250 -0
  1290. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/pathspec.py +257 -0
  1291. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__init__.py +0 -0
  1292. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/__init__.cpython-314.pyc +0 -0
  1293. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/_base.cpython-314.pyc +0 -0
  1294. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/base.cpython-314.pyc +0 -0
  1295. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/gitignore.cpython-314.pyc +0 -0
  1296. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/pathspec.cpython-314.pyc +0 -0
  1297. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/_base.py +95 -0
  1298. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/base.py +18 -0
  1299. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/gitignore.py +180 -0
  1300. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/pathspec.py +189 -0
  1301. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/__init__.py +0 -0
  1302. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/__pycache__/__init__.cpython-314.pyc +0 -0
  1303. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/__pycache__/gitignore.cpython-314.pyc +0 -0
  1304. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/__pycache__/pathspec.cpython-314.pyc +0 -0
  1305. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/gitignore.py +104 -0
  1306. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/pathspec.py +76 -0
  1307. package/python/lib/python3.14/site-packages/pathspec/_meta.py +70 -0
  1308. package/python/lib/python3.14/site-packages/pathspec/_typing.py +64 -0
  1309. package/python/lib/python3.14/site-packages/pathspec/_version.py +5 -0
  1310. package/python/lib/python3.14/site-packages/pathspec/backend.py +51 -0
  1311. package/python/lib/python3.14/site-packages/pathspec/gitignore.py +172 -0
  1312. package/python/lib/python3.14/site-packages/pathspec/pathspec.py +527 -0
  1313. package/python/lib/python3.14/site-packages/pathspec/pattern.py +259 -0
  1314. package/python/lib/python3.14/site-packages/pathspec/patterns/__init__.py +12 -0
  1315. package/python/lib/python3.14/site-packages/pathspec/patterns/__pycache__/__init__.cpython-314.pyc +0 -0
  1316. package/python/lib/python3.14/site-packages/pathspec/patterns/__pycache__/gitwildmatch.cpython-314.pyc +0 -0
  1317. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__init__.py +17 -0
  1318. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__pycache__/__init__.cpython-314.pyc +0 -0
  1319. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__pycache__/base.cpython-314.pyc +0 -0
  1320. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__pycache__/basic.cpython-314.pyc +0 -0
  1321. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__pycache__/spec.cpython-314.pyc +0 -0
  1322. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/base.py +210 -0
  1323. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/basic.py +320 -0
  1324. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/spec.py +344 -0
  1325. package/python/lib/python3.14/site-packages/pathspec/patterns/gitwildmatch.py +52 -0
  1326. package/python/lib/python3.14/site-packages/pathspec/py.typed +1 -0
  1327. package/python/lib/python3.14/site-packages/pathspec/util.py +864 -0
  1328. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/INSTALLER +1 -0
  1329. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/METADATA +392 -0
  1330. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/RECORD +38 -0
  1331. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/REQUESTED +0 -0
  1332. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/WHEEL +4 -0
  1333. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/licenses/LICENSE +373 -0
  1334. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/INSTALLER +1 -0
  1335. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/METADATA +59 -0
  1336. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/RECORD +26 -0
  1337. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/REQUESTED +0 -0
  1338. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/WHEEL +7 -0
  1339. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE +20 -0
  1340. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/top_level.txt +2 -0
  1341. package/python/lib/python3.14/site-packages/regex/__init__.py +3 -0
  1342. package/python/lib/python3.14/site-packages/regex/__pycache__/__init__.cpython-314.pyc +0 -0
  1343. package/python/lib/python3.14/site-packages/regex/__pycache__/_main.cpython-314.pyc +0 -0
  1344. package/python/lib/python3.14/site-packages/regex/__pycache__/_regex_core.cpython-314.pyc +0 -0
  1345. package/python/lib/python3.14/site-packages/regex/_main.py +759 -0
  1346. package/python/lib/python3.14/site-packages/regex/_regex.cpython-314-s390x-linux-gnu.so +0 -0
  1347. package/python/lib/python3.14/site-packages/regex/_regex_core.py +4689 -0
  1348. package/python/lib/python3.14/site-packages/regex/tests/__pycache__/test_regex.cpython-314.pyc +0 -0
  1349. package/python/lib/python3.14/site-packages/regex/tests/test_regex.py +4557 -0
  1350. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/INSTALLER +1 -0
  1351. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/METADATA +1060 -0
  1352. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/RECORD +12 -0
  1353. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/REQUESTED +0 -0
  1354. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/WHEEL +7 -0
  1355. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/licenses/LICENSE.txt +208 -0
  1356. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/top_level.txt +1 -0
  1357. package/python/lib/python3.14/site-packages/yaml/__init__.py +390 -0
  1358. package/python/lib/python3.14/site-packages/yaml/__pycache__/__init__.cpython-314.pyc +0 -0
  1359. package/python/lib/python3.14/site-packages/yaml/__pycache__/composer.cpython-314.pyc +0 -0
  1360. package/python/lib/python3.14/site-packages/yaml/__pycache__/constructor.cpython-314.pyc +0 -0
  1361. package/python/lib/python3.14/site-packages/yaml/__pycache__/cyaml.cpython-314.pyc +0 -0
  1362. package/python/lib/python3.14/site-packages/yaml/__pycache__/dumper.cpython-314.pyc +0 -0
  1363. package/python/lib/python3.14/site-packages/yaml/__pycache__/emitter.cpython-314.pyc +0 -0
  1364. package/python/lib/python3.14/site-packages/yaml/__pycache__/error.cpython-314.pyc +0 -0
  1365. package/python/lib/python3.14/site-packages/yaml/__pycache__/events.cpython-314.pyc +0 -0
  1366. package/python/lib/python3.14/site-packages/yaml/__pycache__/loader.cpython-314.pyc +0 -0
  1367. package/python/lib/python3.14/site-packages/yaml/__pycache__/nodes.cpython-314.pyc +0 -0
  1368. package/python/lib/python3.14/site-packages/yaml/__pycache__/parser.cpython-314.pyc +0 -0
  1369. package/python/lib/python3.14/site-packages/yaml/__pycache__/reader.cpython-314.pyc +0 -0
  1370. package/python/lib/python3.14/site-packages/yaml/__pycache__/representer.cpython-314.pyc +0 -0
  1371. package/python/lib/python3.14/site-packages/yaml/__pycache__/resolver.cpython-314.pyc +0 -0
  1372. package/python/lib/python3.14/site-packages/yaml/__pycache__/scanner.cpython-314.pyc +0 -0
  1373. package/python/lib/python3.14/site-packages/yaml/__pycache__/serializer.cpython-314.pyc +0 -0
  1374. package/python/lib/python3.14/site-packages/yaml/__pycache__/tokens.cpython-314.pyc +0 -0
  1375. package/python/lib/python3.14/site-packages/yaml/_yaml.cpython-314-s390x-linux-gnu.so +0 -0
  1376. package/python/lib/python3.14/site-packages/yaml/composer.py +139 -0
  1377. package/python/lib/python3.14/site-packages/yaml/constructor.py +748 -0
  1378. package/python/lib/python3.14/site-packages/yaml/cyaml.py +101 -0
  1379. package/python/lib/python3.14/site-packages/yaml/dumper.py +62 -0
  1380. package/python/lib/python3.14/site-packages/yaml/emitter.py +1137 -0
  1381. package/python/lib/python3.14/site-packages/yaml/error.py +75 -0
  1382. package/python/lib/python3.14/site-packages/yaml/events.py +86 -0
  1383. package/python/lib/python3.14/site-packages/yaml/loader.py +63 -0
  1384. package/python/lib/python3.14/site-packages/yaml/nodes.py +49 -0
  1385. package/python/lib/python3.14/site-packages/yaml/parser.py +589 -0
  1386. package/python/lib/python3.14/site-packages/yaml/reader.py +185 -0
  1387. package/python/lib/python3.14/site-packages/yaml/representer.py +389 -0
  1388. package/python/lib/python3.14/site-packages/yaml/resolver.py +227 -0
  1389. package/python/lib/python3.14/site-packages/yaml/scanner.py +1435 -0
  1390. package/python/lib/python3.14/site-packages/yaml/serializer.py +111 -0
  1391. package/python/lib/python3.14/site-packages/yaml/tokens.py +104 -0
  1392. package/python/lib/python3.14/site.py +779 -0
  1393. package/python/lib/python3.14/smtplib.py +1121 -0
  1394. package/python/lib/python3.14/socket.py +994 -0
  1395. package/python/lib/python3.14/socketserver.py +863 -0
  1396. package/python/lib/python3.14/sqlite3/__init__.py +57 -0
  1397. package/python/lib/python3.14/sqlite3/__main__.py +139 -0
  1398. package/python/lib/python3.14/sqlite3/__pycache__/__init__.cpython-314.pyc +0 -0
  1399. package/python/lib/python3.14/sqlite3/__pycache__/__main__.cpython-314.pyc +0 -0
  1400. package/python/lib/python3.14/sqlite3/__pycache__/dbapi2.cpython-314.pyc +0 -0
  1401. package/python/lib/python3.14/sqlite3/__pycache__/dump.cpython-314.pyc +0 -0
  1402. package/python/lib/python3.14/sqlite3/dbapi2.py +96 -0
  1403. package/python/lib/python3.14/sqlite3/dump.py +118 -0
  1404. package/python/lib/python3.14/sre_compile.py +7 -0
  1405. package/python/lib/python3.14/sre_constants.py +7 -0
  1406. package/python/lib/python3.14/sre_parse.py +7 -0
  1407. package/python/lib/python3.14/ssl.py +1552 -0
  1408. package/python/lib/python3.14/stat.py +212 -0
  1409. package/python/lib/python3.14/statistics.py +1879 -0
  1410. package/python/lib/python3.14/string/__init__.py +332 -0
  1411. package/python/lib/python3.14/string/__pycache__/__init__.cpython-314.pyc +0 -0
  1412. package/python/lib/python3.14/string/__pycache__/templatelib.cpython-314.pyc +0 -0
  1413. package/python/lib/python3.14/string/templatelib.py +33 -0
  1414. package/python/lib/python3.14/stringprep.py +456 -0
  1415. package/python/lib/python3.14/struct.py +15 -0
  1416. package/python/lib/python3.14/subprocess.py +2257 -0
  1417. package/python/lib/python3.14/symtable.py +451 -0
  1418. package/python/lib/python3.14/sysconfig/__init__.py +798 -0
  1419. package/python/lib/python3.14/sysconfig/__main__.py +276 -0
  1420. package/python/lib/python3.14/sysconfig/__pycache__/__init__.cpython-314.pyc +0 -0
  1421. package/python/lib/python3.14/sysconfig/__pycache__/__main__.cpython-314.pyc +0 -0
  1422. package/python/lib/python3.14/tabnanny.py +338 -0
  1423. package/python/lib/python3.14/tarfile.py +3228 -0
  1424. package/python/lib/python3.14/tempfile.py +1057 -0
  1425. package/python/lib/python3.14/textwrap.py +475 -0
  1426. package/python/lib/python3.14/this.py +28 -0
  1427. package/python/lib/python3.14/threading.py +1643 -0
  1428. package/python/lib/python3.14/timeit.py +378 -0
  1429. package/python/lib/python3.14/token.py +144 -0
  1430. package/python/lib/python3.14/tokenize.py +598 -0
  1431. package/python/lib/python3.14/tomllib/__init__.py +10 -0
  1432. package/python/lib/python3.14/tomllib/__pycache__/__init__.cpython-314.pyc +0 -0
  1433. package/python/lib/python3.14/tomllib/__pycache__/_parser.cpython-314.pyc +0 -0
  1434. package/python/lib/python3.14/tomllib/__pycache__/_re.cpython-314.pyc +0 -0
  1435. package/python/lib/python3.14/tomllib/__pycache__/_types.cpython-314.pyc +0 -0
  1436. package/python/lib/python3.14/tomllib/_parser.py +765 -0
  1437. package/python/lib/python3.14/tomllib/_re.py +113 -0
  1438. package/python/lib/python3.14/tomllib/_types.py +10 -0
  1439. package/python/lib/python3.14/tomllib/mypy.ini +15 -0
  1440. package/python/lib/python3.14/trace.py +751 -0
  1441. package/python/lib/python3.14/traceback.py +1751 -0
  1442. package/python/lib/python3.14/tracemalloc.py +560 -0
  1443. package/python/lib/python3.14/tty.py +73 -0
  1444. package/python/lib/python3.14/types.py +345 -0
  1445. package/python/lib/python3.14/typing.py +3866 -0
  1446. package/python/lib/python3.14/unittest/__init__.py +80 -0
  1447. package/python/lib/python3.14/unittest/__main__.py +18 -0
  1448. package/python/lib/python3.14/unittest/__pycache__/__init__.cpython-314.pyc +0 -0
  1449. package/python/lib/python3.14/unittest/__pycache__/__main__.cpython-314.pyc +0 -0
  1450. package/python/lib/python3.14/unittest/__pycache__/_log.cpython-314.pyc +0 -0
  1451. package/python/lib/python3.14/unittest/__pycache__/async_case.cpython-314.pyc +0 -0
  1452. package/python/lib/python3.14/unittest/__pycache__/case.cpython-314.pyc +0 -0
  1453. package/python/lib/python3.14/unittest/__pycache__/loader.cpython-314.pyc +0 -0
  1454. package/python/lib/python3.14/unittest/__pycache__/main.cpython-314.pyc +0 -0
  1455. package/python/lib/python3.14/unittest/__pycache__/mock.cpython-314.pyc +0 -0
  1456. package/python/lib/python3.14/unittest/__pycache__/result.cpython-314.pyc +0 -0
  1457. package/python/lib/python3.14/unittest/__pycache__/runner.cpython-314.pyc +0 -0
  1458. package/python/lib/python3.14/unittest/__pycache__/signals.cpython-314.pyc +0 -0
  1459. package/python/lib/python3.14/unittest/__pycache__/suite.cpython-314.pyc +0 -0
  1460. package/python/lib/python3.14/unittest/__pycache__/util.cpython-314.pyc +0 -0
  1461. package/python/lib/python3.14/unittest/_log.py +86 -0
  1462. package/python/lib/python3.14/unittest/async_case.py +158 -0
  1463. package/python/lib/python3.14/unittest/case.py +1628 -0
  1464. package/python/lib/python3.14/unittest/loader.py +491 -0
  1465. package/python/lib/python3.14/unittest/main.py +280 -0
  1466. package/python/lib/python3.14/unittest/mock.py +3208 -0
  1467. package/python/lib/python3.14/unittest/result.py +259 -0
  1468. package/python/lib/python3.14/unittest/runner.py +313 -0
  1469. package/python/lib/python3.14/unittest/signals.py +71 -0
  1470. package/python/lib/python3.14/unittest/suite.py +379 -0
  1471. package/python/lib/python3.14/unittest/util.py +170 -0
  1472. package/python/lib/python3.14/urllib/__init__.py +0 -0
  1473. package/python/lib/python3.14/urllib/__pycache__/__init__.cpython-314.pyc +0 -0
  1474. package/python/lib/python3.14/urllib/__pycache__/error.cpython-314.pyc +0 -0
  1475. package/python/lib/python3.14/urllib/__pycache__/parse.cpython-314.pyc +0 -0
  1476. package/python/lib/python3.14/urllib/__pycache__/request.cpython-314.pyc +0 -0
  1477. package/python/lib/python3.14/urllib/__pycache__/response.cpython-314.pyc +0 -0
  1478. package/python/lib/python3.14/urllib/__pycache__/robotparser.cpython-314.pyc +0 -0
  1479. package/python/lib/python3.14/urllib/error.py +74 -0
  1480. package/python/lib/python3.14/urllib/parse.py +1289 -0
  1481. package/python/lib/python3.14/urllib/request.py +2175 -0
  1482. package/python/lib/python3.14/urllib/response.py +84 -0
  1483. package/python/lib/python3.14/urllib/robotparser.py +363 -0
  1484. package/python/lib/python3.14/uuid.py +1013 -0
  1485. package/python/lib/python3.14/venv/__init__.py +700 -0
  1486. package/python/lib/python3.14/venv/__main__.py +10 -0
  1487. package/python/lib/python3.14/venv/__pycache__/__init__.cpython-314.pyc +0 -0
  1488. package/python/lib/python3.14/venv/__pycache__/__main__.cpython-314.pyc +0 -0
  1489. package/python/lib/python3.14/venv/scripts/common/Activate.ps1 +248 -0
  1490. package/python/lib/python3.14/venv/scripts/common/activate +76 -0
  1491. package/python/lib/python3.14/venv/scripts/common/activate.fish +69 -0
  1492. package/python/lib/python3.14/venv/scripts/posix/activate.csh +29 -0
  1493. package/python/lib/python3.14/warnings.py +99 -0
  1494. package/python/lib/python3.14/wave.py +665 -0
  1495. package/python/lib/python3.14/weakref.py +574 -0
  1496. package/python/lib/python3.14/webbrowser.py +763 -0
  1497. package/python/lib/python3.14/wsgiref/__init__.py +25 -0
  1498. package/python/lib/python3.14/wsgiref/__pycache__/__init__.cpython-314.pyc +0 -0
  1499. package/python/lib/python3.14/wsgiref/__pycache__/handlers.cpython-314.pyc +0 -0
  1500. package/python/lib/python3.14/wsgiref/__pycache__/headers.cpython-314.pyc +0 -0
  1501. package/python/lib/python3.14/wsgiref/__pycache__/simple_server.cpython-314.pyc +0 -0
  1502. package/python/lib/python3.14/wsgiref/__pycache__/types.cpython-314.pyc +0 -0
  1503. package/python/lib/python3.14/wsgiref/__pycache__/util.cpython-314.pyc +0 -0
  1504. package/python/lib/python3.14/wsgiref/__pycache__/validate.cpython-314.pyc +0 -0
  1505. package/python/lib/python3.14/wsgiref/handlers.py +575 -0
  1506. package/python/lib/python3.14/wsgiref/headers.py +192 -0
  1507. package/python/lib/python3.14/wsgiref/simple_server.py +161 -0
  1508. package/python/lib/python3.14/wsgiref/types.py +54 -0
  1509. package/python/lib/python3.14/wsgiref/util.py +159 -0
  1510. package/python/lib/python3.14/wsgiref/validate.py +438 -0
  1511. package/python/lib/python3.14/xml/__init__.py +20 -0
  1512. package/python/lib/python3.14/xml/__pycache__/__init__.cpython-314.pyc +0 -0
  1513. package/python/lib/python3.14/xml/dom/NodeFilter.py +27 -0
  1514. package/python/lib/python3.14/xml/dom/__init__.py +140 -0
  1515. package/python/lib/python3.14/xml/dom/__pycache__/NodeFilter.cpython-314.pyc +0 -0
  1516. package/python/lib/python3.14/xml/dom/__pycache__/__init__.cpython-314.pyc +0 -0
  1517. package/python/lib/python3.14/xml/dom/__pycache__/domreg.cpython-314.pyc +0 -0
  1518. package/python/lib/python3.14/xml/dom/__pycache__/expatbuilder.cpython-314.pyc +0 -0
  1519. package/python/lib/python3.14/xml/dom/__pycache__/minicompat.cpython-314.pyc +0 -0
  1520. package/python/lib/python3.14/xml/dom/__pycache__/minidom.cpython-314.pyc +0 -0
  1521. package/python/lib/python3.14/xml/dom/__pycache__/pulldom.cpython-314.pyc +0 -0
  1522. package/python/lib/python3.14/xml/dom/__pycache__/xmlbuilder.cpython-314.pyc +0 -0
  1523. package/python/lib/python3.14/xml/dom/domreg.py +99 -0
  1524. package/python/lib/python3.14/xml/dom/expatbuilder.py +964 -0
  1525. package/python/lib/python3.14/xml/dom/minicompat.py +109 -0
  1526. package/python/lib/python3.14/xml/dom/minidom.py +2027 -0
  1527. package/python/lib/python3.14/xml/dom/pulldom.py +350 -0
  1528. package/python/lib/python3.14/xml/dom/xmlbuilder.py +389 -0
  1529. package/python/lib/python3.14/xml/etree/ElementInclude.py +186 -0
  1530. package/python/lib/python3.14/xml/etree/ElementPath.py +430 -0
  1531. package/python/lib/python3.14/xml/etree/ElementTree.py +2093 -0
  1532. package/python/lib/python3.14/xml/etree/__init__.py +33 -0
  1533. package/python/lib/python3.14/xml/etree/__pycache__/ElementInclude.cpython-314.pyc +0 -0
  1534. package/python/lib/python3.14/xml/etree/__pycache__/ElementPath.cpython-314.pyc +0 -0
  1535. package/python/lib/python3.14/xml/etree/__pycache__/ElementTree.cpython-314.pyc +0 -0
  1536. package/python/lib/python3.14/xml/etree/__pycache__/__init__.cpython-314.pyc +0 -0
  1537. package/python/lib/python3.14/xml/etree/__pycache__/cElementTree.cpython-314.pyc +0 -0
  1538. package/python/lib/python3.14/xml/etree/cElementTree.py +3 -0
  1539. package/python/lib/python3.14/xml/parsers/__init__.py +8 -0
  1540. package/python/lib/python3.14/xml/parsers/__pycache__/__init__.cpython-314.pyc +0 -0
  1541. package/python/lib/python3.14/xml/parsers/__pycache__/expat.cpython-314.pyc +0 -0
  1542. package/python/lib/python3.14/xml/parsers/expat.py +8 -0
  1543. package/python/lib/python3.14/xml/sax/__init__.py +109 -0
  1544. package/python/lib/python3.14/xml/sax/__pycache__/__init__.cpython-314.pyc +0 -0
  1545. package/python/lib/python3.14/xml/sax/__pycache__/_exceptions.cpython-314.pyc +0 -0
  1546. package/python/lib/python3.14/xml/sax/__pycache__/expatreader.cpython-314.pyc +0 -0
  1547. package/python/lib/python3.14/xml/sax/__pycache__/handler.cpython-314.pyc +0 -0
  1548. package/python/lib/python3.14/xml/sax/__pycache__/saxutils.cpython-314.pyc +0 -0
  1549. package/python/lib/python3.14/xml/sax/__pycache__/xmlreader.cpython-314.pyc +0 -0
  1550. package/python/lib/python3.14/xml/sax/_exceptions.py +127 -0
  1551. package/python/lib/python3.14/xml/sax/expatreader.py +454 -0
  1552. package/python/lib/python3.14/xml/sax/handler.py +387 -0
  1553. package/python/lib/python3.14/xml/sax/saxutils.py +370 -0
  1554. package/python/lib/python3.14/xml/sax/xmlreader.py +379 -0
  1555. package/python/lib/python3.14/xmlrpc/__init__.py +1 -0
  1556. package/python/lib/python3.14/xmlrpc/__pycache__/__init__.cpython-314.pyc +0 -0
  1557. package/python/lib/python3.14/xmlrpc/__pycache__/client.cpython-314.pyc +0 -0
  1558. package/python/lib/python3.14/xmlrpc/__pycache__/server.cpython-314.pyc +0 -0
  1559. package/python/lib/python3.14/xmlrpc/client.py +1503 -0
  1560. package/python/lib/python3.14/xmlrpc/server.py +1003 -0
  1561. package/python/lib/python3.14/zipapp.py +231 -0
  1562. package/python/lib/python3.14/zipfile/__init__.py +2488 -0
  1563. package/python/lib/python3.14/zipfile/__main__.py +4 -0
  1564. package/python/lib/python3.14/zipfile/__pycache__/__init__.cpython-314.pyc +0 -0
  1565. package/python/lib/python3.14/zipfile/__pycache__/__main__.cpython-314.pyc +0 -0
  1566. package/python/lib/python3.14/zipfile/_path/__init__.py +455 -0
  1567. package/python/lib/python3.14/zipfile/_path/__pycache__/__init__.cpython-314.pyc +0 -0
  1568. package/python/lib/python3.14/zipfile/_path/__pycache__/glob.cpython-314.pyc +0 -0
  1569. package/python/lib/python3.14/zipfile/_path/glob.py +113 -0
  1570. package/python/lib/python3.14/zipimport.py +827 -0
  1571. package/python/lib/python3.14/zoneinfo/__init__.py +34 -0
  1572. package/python/lib/python3.14/zoneinfo/__pycache__/__init__.cpython-314.pyc +0 -0
  1573. package/python/lib/python3.14/zoneinfo/__pycache__/_common.cpython-314.pyc +0 -0
  1574. package/python/lib/python3.14/zoneinfo/__pycache__/_tzpath.cpython-314.pyc +0 -0
  1575. package/python/lib/python3.14/zoneinfo/__pycache__/_zoneinfo.cpython-314.pyc +0 -0
  1576. package/python/lib/python3.14/zoneinfo/_common.py +172 -0
  1577. package/python/lib/python3.14/zoneinfo/_tzpath.py +189 -0
  1578. package/python/lib/python3.14/zoneinfo/_zoneinfo.py +779 -0
  1579. package/python/licenses/LICENSE.bdb.txt +126 -0
  1580. package/python/licenses/LICENSE.bzip2.txt +37 -0
  1581. package/python/licenses/LICENSE.cpython.txt +771 -0
  1582. package/python/licenses/LICENSE.expat.txt +21 -0
  1583. package/python/licenses/LICENSE.libX11.txt +942 -0
  1584. package/python/licenses/LICENSE.libXau.txt +21 -0
  1585. package/python/licenses/LICENSE.libedit.txt +29 -0
  1586. package/python/licenses/LICENSE.libffi.txt +21 -0
  1587. package/python/licenses/LICENSE.liblzma.txt +13 -0
  1588. package/python/licenses/LICENSE.libuuid.txt +27 -0
  1589. package/python/licenses/LICENSE.libxcb.txt +30 -0
  1590. package/python/licenses/LICENSE.mpdecimal.txt +24 -0
  1591. package/python/licenses/LICENSE.ncurses.txt +29 -0
  1592. package/python/licenses/LICENSE.openssl-3.txt +177 -0
  1593. package/python/licenses/LICENSE.sqlite.txt +23 -0
  1594. package/python/licenses/LICENSE.tcl.txt +40 -0
  1595. package/python/licenses/LICENSE.tix.txt +54 -0
  1596. package/python/licenses/LICENSE.zlib-ng.txt +19 -0
  1597. package/python/licenses/LICENSE.zlib.txt +22 -0
  1598. package/python/licenses/LICENSE.zstd.txt +30 -0
@@ -0,0 +1,3866 @@
1
+ """
2
+ The typing module: Support for gradual typing as defined by PEP 484 and subsequent PEPs.
3
+
4
+ Among other things, the module includes the following:
5
+ * Generic, Protocol, and internal machinery to support generic aliases.
6
+ All subscripted types like X[int], Union[int, str] are generic aliases.
7
+ * Various "special forms" that have unique meanings in type annotations:
8
+ Any, Never, ClassVar, Self, Concatenate, Unpack, and others.
9
+ * Classes whose instances can be type arguments to generic classes and functions:
10
+ TypeVar, ParamSpec, TypeVarTuple.
11
+ * Public helper functions: get_type_hints, overload, cast, final, and others.
12
+ * Several protocols to support duck-typing:
13
+ SupportsFloat, SupportsIndex, SupportsAbs, and others.
14
+ * Special types: NewType, NamedTuple, TypedDict.
15
+ * Deprecated aliases for builtin types and collections.abc ABCs.
16
+
17
+ Any name not present in __all__ is an implementation detail
18
+ that may be changed without notice. Use at your own risk!
19
+ """
20
+
21
+ from abc import abstractmethod, ABCMeta
22
+ import collections
23
+ from collections import defaultdict
24
+ import collections.abc
25
+ import copyreg
26
+ import functools
27
+ import operator
28
+ import sys
29
+ import types
30
+ from types import GenericAlias
31
+
32
+ from _typing import (
33
+ _idfunc,
34
+ TypeVar,
35
+ ParamSpec,
36
+ TypeVarTuple,
37
+ ParamSpecArgs,
38
+ ParamSpecKwargs,
39
+ TypeAliasType,
40
+ Generic,
41
+ Union,
42
+ NoDefault,
43
+ )
44
+
45
+ # Please keep __all__ alphabetized within each category.
46
+ __all__ = [
47
+ # Super-special typing primitives.
48
+ 'Annotated',
49
+ 'Any',
50
+ 'Callable',
51
+ 'ClassVar',
52
+ 'Concatenate',
53
+ 'Final',
54
+ 'ForwardRef',
55
+ 'Generic',
56
+ 'Literal',
57
+ 'Optional',
58
+ 'ParamSpec',
59
+ 'Protocol',
60
+ 'Tuple',
61
+ 'Type',
62
+ 'TypeVar',
63
+ 'TypeVarTuple',
64
+ 'Union',
65
+
66
+ # ABCs (from collections.abc).
67
+ 'AbstractSet', # collections.abc.Set.
68
+ 'ByteString',
69
+ 'Container',
70
+ 'ContextManager',
71
+ 'Hashable',
72
+ 'ItemsView',
73
+ 'Iterable',
74
+ 'Iterator',
75
+ 'KeysView',
76
+ 'Mapping',
77
+ 'MappingView',
78
+ 'MutableMapping',
79
+ 'MutableSequence',
80
+ 'MutableSet',
81
+ 'Sequence',
82
+ 'Sized',
83
+ 'ValuesView',
84
+ 'Awaitable',
85
+ 'AsyncIterator',
86
+ 'AsyncIterable',
87
+ 'Coroutine',
88
+ 'Collection',
89
+ 'AsyncGenerator',
90
+ 'AsyncContextManager',
91
+
92
+ # Structural checks, a.k.a. protocols.
93
+ 'Reversible',
94
+ 'SupportsAbs',
95
+ 'SupportsBytes',
96
+ 'SupportsComplex',
97
+ 'SupportsFloat',
98
+ 'SupportsIndex',
99
+ 'SupportsInt',
100
+ 'SupportsRound',
101
+
102
+ # Concrete collection types.
103
+ 'ChainMap',
104
+ 'Counter',
105
+ 'Deque',
106
+ 'Dict',
107
+ 'DefaultDict',
108
+ 'List',
109
+ 'OrderedDict',
110
+ 'Set',
111
+ 'FrozenSet',
112
+ 'NamedTuple', # Not really a type.
113
+ 'TypedDict', # Not really a type.
114
+ 'Generator',
115
+
116
+ # Other concrete types.
117
+ 'BinaryIO',
118
+ 'IO',
119
+ 'Match',
120
+ 'Pattern',
121
+ 'TextIO',
122
+
123
+ # One-off things.
124
+ 'AnyStr',
125
+ 'assert_type',
126
+ 'assert_never',
127
+ 'cast',
128
+ 'clear_overloads',
129
+ 'dataclass_transform',
130
+ 'evaluate_forward_ref',
131
+ 'final',
132
+ 'get_args',
133
+ 'get_origin',
134
+ 'get_overloads',
135
+ 'get_protocol_members',
136
+ 'get_type_hints',
137
+ 'is_protocol',
138
+ 'is_typeddict',
139
+ 'LiteralString',
140
+ 'Never',
141
+ 'NewType',
142
+ 'no_type_check',
143
+ 'no_type_check_decorator',
144
+ 'NoDefault',
145
+ 'NoReturn',
146
+ 'NotRequired',
147
+ 'overload',
148
+ 'override',
149
+ 'ParamSpecArgs',
150
+ 'ParamSpecKwargs',
151
+ 'ReadOnly',
152
+ 'Required',
153
+ 'reveal_type',
154
+ 'runtime_checkable',
155
+ 'Self',
156
+ 'Text',
157
+ 'TYPE_CHECKING',
158
+ 'TypeAlias',
159
+ 'TypeGuard',
160
+ 'TypeIs',
161
+ 'TypeAliasType',
162
+ 'Unpack',
163
+ ]
164
+
165
+ class _LazyAnnotationLib:
166
+ def __getattr__(self, attr):
167
+ global _lazy_annotationlib
168
+ import annotationlib
169
+ _lazy_annotationlib = annotationlib
170
+ return getattr(annotationlib, attr)
171
+
172
+ _lazy_annotationlib = _LazyAnnotationLib()
173
+
174
+
175
+ def _type_convert(arg, module=None, *, allow_special_forms=False, owner=None):
176
+ """For converting None to type(None), and strings to ForwardRef."""
177
+ if arg is None:
178
+ return type(None)
179
+ if isinstance(arg, str):
180
+ return _make_forward_ref(arg, module=module, is_class=allow_special_forms, owner=owner)
181
+ return arg
182
+
183
+
184
+ def _type_check(arg, msg, is_argument=True, module=None, *, allow_special_forms=False, owner=None):
185
+ """Check that the argument is a type, and return it (internal helper).
186
+
187
+ As a special case, accept None and return type(None) instead. Also wrap strings
188
+ into ForwardRef instances. Consider several corner cases, for example plain
189
+ special forms like Union are not valid, while Union[int, str] is OK, etc.
190
+ The msg argument is a human-readable error message, e.g.::
191
+
192
+ "Union[arg, ...]: arg should be a type."
193
+
194
+ We append the repr() of the actual value (truncated to 100 chars).
195
+ """
196
+ invalid_generic_forms = (Generic, Protocol)
197
+ if not allow_special_forms:
198
+ invalid_generic_forms += (ClassVar,)
199
+ if is_argument:
200
+ invalid_generic_forms += (Final,)
201
+
202
+ arg = _type_convert(arg, module=module, allow_special_forms=allow_special_forms, owner=owner)
203
+ if (isinstance(arg, _GenericAlias) and
204
+ arg.__origin__ in invalid_generic_forms):
205
+ raise TypeError(f"{arg} is not valid as type argument")
206
+ if arg in (Any, LiteralString, NoReturn, Never, Self, TypeAlias):
207
+ return arg
208
+ if allow_special_forms and arg in (ClassVar, Final):
209
+ return arg
210
+ if isinstance(arg, _SpecialForm) or arg in (Generic, Protocol):
211
+ raise TypeError(f"Plain {arg} is not valid as type argument")
212
+ if type(arg) is tuple:
213
+ raise TypeError(f"{msg} Got {arg!r:.100}.")
214
+ return arg
215
+
216
+
217
+ def _is_param_expr(arg):
218
+ return arg is ... or isinstance(arg,
219
+ (tuple, list, ParamSpec, _ConcatenateGenericAlias))
220
+
221
+
222
+ def _should_unflatten_callable_args(typ, args):
223
+ """Internal helper for munging collections.abc.Callable's __args__.
224
+
225
+ The canonical representation for a Callable's __args__ flattens the
226
+ argument types, see https://github.com/python/cpython/issues/86361.
227
+
228
+ For example::
229
+
230
+ >>> import collections.abc
231
+ >>> P = ParamSpec('P')
232
+ >>> collections.abc.Callable[[int, int], str].__args__ == (int, int, str)
233
+ True
234
+ >>> collections.abc.Callable[P, str].__args__ == (P, str)
235
+ True
236
+
237
+ As a result, if we need to reconstruct the Callable from its __args__,
238
+ we need to unflatten it.
239
+ """
240
+ return (
241
+ typ.__origin__ is collections.abc.Callable
242
+ and not (len(args) == 2 and _is_param_expr(args[0]))
243
+ )
244
+
245
+
246
+ def _type_repr(obj):
247
+ """Return the repr() of an object, special-casing types (internal helper).
248
+
249
+ If obj is a type, we return a shorter version than the default
250
+ type.__repr__, based on the module and qualified name, which is
251
+ typically enough to uniquely identify a type. For everything
252
+ else, we fall back on repr(obj).
253
+ """
254
+ if isinstance(obj, tuple):
255
+ # Special case for `repr` of types with `ParamSpec`:
256
+ return '[' + ', '.join(_type_repr(t) for t in obj) + ']'
257
+ return _lazy_annotationlib.type_repr(obj)
258
+
259
+
260
+ def _collect_type_parameters(args, *, enforce_default_ordering: bool = True):
261
+ """Collect all type parameters in args
262
+ in order of first appearance (lexicographic order).
263
+
264
+ For example::
265
+
266
+ >>> P = ParamSpec('P')
267
+ >>> T = TypeVar('T')
268
+ >>> _collect_type_parameters((T, Callable[P, T]))
269
+ (~T, ~P)
270
+ """
271
+ # required type parameter cannot appear after parameter with default
272
+ default_encountered = False
273
+ # or after TypeVarTuple
274
+ type_var_tuple_encountered = False
275
+ parameters = []
276
+ for t in args:
277
+ if isinstance(t, type):
278
+ # We don't want __parameters__ descriptor of a bare Python class.
279
+ pass
280
+ elif isinstance(t, tuple):
281
+ # `t` might be a tuple, when `ParamSpec` is substituted with
282
+ # `[T, int]`, or `[int, *Ts]`, etc.
283
+ for x in t:
284
+ for collected in _collect_type_parameters([x]):
285
+ if collected not in parameters:
286
+ parameters.append(collected)
287
+ elif hasattr(t, '__typing_subst__'):
288
+ if t not in parameters:
289
+ if enforce_default_ordering:
290
+ if type_var_tuple_encountered and t.has_default():
291
+ raise TypeError('Type parameter with a default'
292
+ ' follows TypeVarTuple')
293
+
294
+ if t.has_default():
295
+ default_encountered = True
296
+ elif default_encountered:
297
+ raise TypeError(f'Type parameter {t!r} without a default'
298
+ ' follows type parameter with a default')
299
+
300
+ parameters.append(t)
301
+ else:
302
+ if _is_unpacked_typevartuple(t):
303
+ type_var_tuple_encountered = True
304
+ for x in getattr(t, '__parameters__', ()):
305
+ if x not in parameters:
306
+ parameters.append(x)
307
+ return tuple(parameters)
308
+
309
+
310
+ def _check_generic_specialization(cls, arguments):
311
+ """Check correct count for parameters of a generic cls (internal helper).
312
+
313
+ This gives a nice error message in case of count mismatch.
314
+ """
315
+ expected_len = len(cls.__parameters__)
316
+ if not expected_len:
317
+ raise TypeError(f"{cls} is not a generic class")
318
+ actual_len = len(arguments)
319
+ if actual_len != expected_len:
320
+ # deal with defaults
321
+ if actual_len < expected_len:
322
+ # If the parameter at index `actual_len` in the parameters list
323
+ # has a default, then all parameters after it must also have
324
+ # one, because we validated as much in _collect_type_parameters().
325
+ # That means that no error needs to be raised here, despite
326
+ # the number of arguments being passed not matching the number
327
+ # of parameters: all parameters that aren't explicitly
328
+ # specialized in this call are parameters with default values.
329
+ if cls.__parameters__[actual_len].has_default():
330
+ return
331
+
332
+ expected_len -= sum(p.has_default() for p in cls.__parameters__)
333
+ expect_val = f"at least {expected_len}"
334
+ else:
335
+ expect_val = expected_len
336
+
337
+ raise TypeError(f"Too {'many' if actual_len > expected_len else 'few'} arguments"
338
+ f" for {cls}; actual {actual_len}, expected {expect_val}")
339
+
340
+
341
+ def _unpack_args(*args):
342
+ newargs = []
343
+ for arg in args:
344
+ subargs = getattr(arg, '__typing_unpacked_tuple_args__', None)
345
+ if subargs is not None and not (subargs and subargs[-1] is ...):
346
+ newargs.extend(subargs)
347
+ else:
348
+ newargs.append(arg)
349
+ return newargs
350
+
351
+ def _deduplicate(params, *, unhashable_fallback=False):
352
+ # Weed out strict duplicates, preserving the first of each occurrence.
353
+ try:
354
+ return dict.fromkeys(params)
355
+ except TypeError:
356
+ if not unhashable_fallback:
357
+ raise
358
+ # Happens for cases like `Annotated[dict, {'x': IntValidator()}]`
359
+ new_unhashable = []
360
+ for t in params:
361
+ if t not in new_unhashable:
362
+ new_unhashable.append(t)
363
+ return new_unhashable
364
+
365
+ def _flatten_literal_params(parameters):
366
+ """Internal helper for Literal creation: flatten Literals among parameters."""
367
+ params = []
368
+ for p in parameters:
369
+ if isinstance(p, _LiteralGenericAlias):
370
+ params.extend(p.__args__)
371
+ else:
372
+ params.append(p)
373
+ return tuple(params)
374
+
375
+
376
+ _cleanups = []
377
+ _caches = {}
378
+
379
+
380
+ def _tp_cache(func=None, /, *, typed=False):
381
+ """Internal wrapper caching __getitem__ of generic types.
382
+
383
+ For non-hashable arguments, the original function is used as a fallback.
384
+ """
385
+ def decorator(func):
386
+ # The callback 'inner' references the newly created lru_cache
387
+ # indirectly by performing a lookup in the global '_caches' dictionary.
388
+ # This breaks a reference that can be problematic when combined with
389
+ # C API extensions that leak references to types. See GH-98253.
390
+
391
+ cache = functools.lru_cache(typed=typed)(func)
392
+ _caches[func] = cache
393
+ _cleanups.append(cache.cache_clear)
394
+ del cache
395
+
396
+ @functools.wraps(func)
397
+ def inner(*args, **kwds):
398
+ try:
399
+ return _caches[func](*args, **kwds)
400
+ except TypeError:
401
+ pass # All real errors (not unhashable args) are raised below.
402
+ return func(*args, **kwds)
403
+ return inner
404
+
405
+ if func is not None:
406
+ return decorator(func)
407
+
408
+ return decorator
409
+
410
+
411
+ def _deprecation_warning_for_no_type_params_passed(funcname: str) -> None:
412
+ import warnings
413
+
414
+ depr_message = (
415
+ f"Failing to pass a value to the 'type_params' parameter "
416
+ f"of {funcname!r} is deprecated, as it leads to incorrect behaviour "
417
+ f"when calling {funcname} on a stringified annotation "
418
+ f"that references a PEP 695 type parameter. "
419
+ f"It will be disallowed in Python 3.15."
420
+ )
421
+ warnings.warn(depr_message, category=DeprecationWarning, stacklevel=3)
422
+
423
+
424
+ class _Sentinel:
425
+ __slots__ = ()
426
+ def __repr__(self):
427
+ return '<sentinel>'
428
+
429
+
430
+ _sentinel = _Sentinel()
431
+
432
+
433
+ def _eval_type(t, globalns, localns, type_params=_sentinel, *, recursive_guard=frozenset(),
434
+ format=None, owner=None, parent_fwdref=None, prefer_fwd_module=False):
435
+ """Evaluate all forward references in the given type t.
436
+
437
+ For use of globalns and localns see the docstring for get_type_hints().
438
+ recursive_guard is used to prevent infinite recursion with a recursive
439
+ ForwardRef.
440
+ """
441
+ if type_params is _sentinel:
442
+ _deprecation_warning_for_no_type_params_passed("typing._eval_type")
443
+ type_params = ()
444
+ if isinstance(t, _lazy_annotationlib.ForwardRef):
445
+ # If the forward_ref has __forward_module__ set, evaluate() infers the globals
446
+ # from the module, and it will probably pick better than the globals we have here.
447
+ # We do this only for calls from get_type_hints() (which opts in through the
448
+ # prefer_fwd_module flag), so that the default behavior remains more straightforward.
449
+ if prefer_fwd_module and t.__forward_module__ is not None:
450
+ globalns = None
451
+ # If there are type params on the owner, we need to add them back, because
452
+ # annotationlib won't.
453
+ if owner_type_params := getattr(owner, "__type_params__", None):
454
+ globalns = getattr(
455
+ sys.modules.get(t.__forward_module__, None), "__dict__", None
456
+ )
457
+ if globalns is not None:
458
+ globalns = dict(globalns)
459
+ for type_param in owner_type_params:
460
+ globalns[type_param.__name__] = type_param
461
+ return evaluate_forward_ref(t, globals=globalns, locals=localns,
462
+ type_params=type_params, owner=owner,
463
+ _recursive_guard=recursive_guard, format=format)
464
+ if isinstance(t, (_GenericAlias, GenericAlias, Union)):
465
+ if isinstance(t, GenericAlias):
466
+ args = tuple(
467
+ _make_forward_ref(arg, parent_fwdref=parent_fwdref) if isinstance(arg, str) else arg
468
+ for arg in t.__args__
469
+ )
470
+ is_unpacked = t.__unpacked__
471
+ if _should_unflatten_callable_args(t, args):
472
+ t = t.__origin__[(args[:-1], args[-1])]
473
+ else:
474
+ t = t.__origin__[args]
475
+ if is_unpacked:
476
+ t = Unpack[t]
477
+
478
+ ev_args = tuple(
479
+ _eval_type(
480
+ a, globalns, localns, type_params, recursive_guard=recursive_guard,
481
+ format=format, owner=owner, prefer_fwd_module=prefer_fwd_module,
482
+ )
483
+ for a in t.__args__
484
+ )
485
+ if ev_args == t.__args__:
486
+ return t
487
+ if isinstance(t, GenericAlias):
488
+ return GenericAlias(t.__origin__, ev_args)
489
+ if isinstance(t, Union):
490
+ return functools.reduce(operator.or_, ev_args)
491
+ else:
492
+ return t.copy_with(ev_args)
493
+ return t
494
+
495
+
496
+ class _Final:
497
+ """Mixin to prohibit subclassing."""
498
+
499
+ __slots__ = ('__weakref__',)
500
+
501
+ def __init_subclass__(cls, /, *args, **kwds):
502
+ if '_root' not in kwds:
503
+ raise TypeError("Cannot subclass special typing classes")
504
+
505
+
506
+ class _NotIterable:
507
+ """Mixin to prevent iteration, without being compatible with Iterable.
508
+
509
+ That is, we could do::
510
+
511
+ def __iter__(self): raise TypeError()
512
+
513
+ But this would make users of this mixin duck type-compatible with
514
+ collections.abc.Iterable - isinstance(foo, Iterable) would be True.
515
+
516
+ Luckily, we can instead prevent iteration by setting __iter__ to None, which
517
+ is treated specially.
518
+ """
519
+
520
+ __slots__ = ()
521
+ __iter__ = None
522
+
523
+
524
+ # Internal indicator of special typing constructs.
525
+ # See __doc__ instance attribute for specific docs.
526
+ class _SpecialForm(_Final, _NotIterable, _root=True):
527
+ __slots__ = ('_name', '__doc__', '_getitem')
528
+
529
+ def __init__(self, getitem):
530
+ self._getitem = getitem
531
+ self._name = getitem.__name__
532
+ self.__doc__ = getitem.__doc__
533
+
534
+ def __getattr__(self, item):
535
+ if item in {'__name__', '__qualname__'}:
536
+ return self._name
537
+
538
+ raise AttributeError(item)
539
+
540
+ def __mro_entries__(self, bases):
541
+ raise TypeError(f"Cannot subclass {self!r}")
542
+
543
+ def __repr__(self):
544
+ return 'typing.' + self._name
545
+
546
+ def __reduce__(self):
547
+ return self._name
548
+
549
+ def __call__(self, *args, **kwds):
550
+ raise TypeError(f"Cannot instantiate {self!r}")
551
+
552
+ def __or__(self, other):
553
+ return Union[self, other]
554
+
555
+ def __ror__(self, other):
556
+ return Union[other, self]
557
+
558
+ def __instancecheck__(self, obj):
559
+ raise TypeError(f"{self} cannot be used with isinstance()")
560
+
561
+ def __subclasscheck__(self, cls):
562
+ raise TypeError(f"{self} cannot be used with issubclass()")
563
+
564
+ @_tp_cache
565
+ def __getitem__(self, parameters):
566
+ return self._getitem(self, parameters)
567
+
568
+
569
+ class _TypedCacheSpecialForm(_SpecialForm, _root=True):
570
+ def __getitem__(self, parameters):
571
+ if not isinstance(parameters, tuple):
572
+ parameters = (parameters,)
573
+ return self._getitem(self, *parameters)
574
+
575
+
576
+ class _AnyMeta(type):
577
+ def __instancecheck__(self, obj):
578
+ if self is Any:
579
+ raise TypeError("typing.Any cannot be used with isinstance()")
580
+ return super().__instancecheck__(obj)
581
+
582
+ def __repr__(self):
583
+ if self is Any:
584
+ return "typing.Any"
585
+ return super().__repr__() # respect to subclasses
586
+
587
+
588
+ class Any(metaclass=_AnyMeta):
589
+ """Special type indicating an unconstrained type.
590
+
591
+ - Any is assignable to every type.
592
+ - Any assumed to have all methods and attributes.
593
+ - All values are assignable to Any.
594
+
595
+ Note that all the above statements are true from the point of view of
596
+ static type checkers. At runtime, Any cannot be used with instance
597
+ checks.
598
+ """
599
+
600
+ def __new__(cls, *args, **kwargs):
601
+ if cls is Any:
602
+ raise TypeError("Any cannot be instantiated")
603
+ return super().__new__(cls)
604
+
605
+
606
+ @_SpecialForm
607
+ def NoReturn(self, parameters):
608
+ """Special type indicating functions that never return.
609
+
610
+ Example::
611
+
612
+ from typing import NoReturn
613
+
614
+ def stop() -> NoReturn:
615
+ raise Exception('no way')
616
+
617
+ NoReturn can also be used as a bottom type, a type that
618
+ has no values. Starting in Python 3.11, the Never type should
619
+ be used for this concept instead. Type checkers should treat the two
620
+ equivalently.
621
+ """
622
+ raise TypeError(f"{self} is not subscriptable")
623
+
624
+ # This is semantically identical to NoReturn, but it is implemented
625
+ # separately so that type checkers can distinguish between the two
626
+ # if they want.
627
+ @_SpecialForm
628
+ def Never(self, parameters):
629
+ """The bottom type, a type that has no members.
630
+
631
+ This can be used to define a function that should never be
632
+ called, or a function that never returns::
633
+
634
+ from typing import Never
635
+
636
+ def never_call_me(arg: Never) -> None:
637
+ pass
638
+
639
+ def int_or_str(arg: int | str) -> None:
640
+ never_call_me(arg) # type checker error
641
+ match arg:
642
+ case int():
643
+ print("It's an int")
644
+ case str():
645
+ print("It's a str")
646
+ case _:
647
+ never_call_me(arg) # OK, arg is of type Never
648
+ """
649
+ raise TypeError(f"{self} is not subscriptable")
650
+
651
+
652
+ @_SpecialForm
653
+ def Self(self, parameters):
654
+ """Used to spell the type of "self" in classes.
655
+
656
+ Example::
657
+
658
+ from typing import Self
659
+
660
+ class Foo:
661
+ def return_self(self) -> Self:
662
+ ...
663
+ return self
664
+
665
+ This is especially useful for:
666
+ - classmethods that are used as alternative constructors
667
+ - annotating an `__enter__` method which returns self
668
+ """
669
+ raise TypeError(f"{self} is not subscriptable")
670
+
671
+
672
+ @_SpecialForm
673
+ def LiteralString(self, parameters):
674
+ """Represents an arbitrary literal string.
675
+
676
+ Example::
677
+
678
+ from typing import LiteralString
679
+
680
+ def run_query(sql: LiteralString) -> None:
681
+ ...
682
+
683
+ def caller(arbitrary_string: str, literal_string: LiteralString) -> None:
684
+ run_query("SELECT * FROM students") # OK
685
+ run_query(literal_string) # OK
686
+ run_query("SELECT * FROM " + literal_string) # OK
687
+ run_query(arbitrary_string) # type checker error
688
+ run_query( # type checker error
689
+ f"SELECT * FROM students WHERE name = {arbitrary_string}"
690
+ )
691
+
692
+ Only string literals and other LiteralStrings are compatible
693
+ with LiteralString. This provides a tool to help prevent
694
+ security issues such as SQL injection.
695
+ """
696
+ raise TypeError(f"{self} is not subscriptable")
697
+
698
+
699
+ @_SpecialForm
700
+ def ClassVar(self, parameters):
701
+ """Special type construct to mark class variables.
702
+
703
+ An annotation wrapped in ClassVar indicates that a given
704
+ attribute is intended to be used as a class variable and
705
+ should not be set on instances of that class.
706
+
707
+ Usage::
708
+
709
+ class Starship:
710
+ stats: ClassVar[dict[str, int]] = {} # class variable
711
+ damage: int = 10 # instance variable
712
+
713
+ ClassVar accepts only types and cannot be further subscribed.
714
+
715
+ Note that ClassVar is not a class itself, and cannot
716
+ be used with isinstance() or issubclass().
717
+ """
718
+ item = _type_check(parameters, f'{self} accepts only single type.', allow_special_forms=True)
719
+ return _GenericAlias(self, (item,))
720
+
721
+ @_SpecialForm
722
+ def Final(self, parameters):
723
+ """Special typing construct to indicate final names to type checkers.
724
+
725
+ A final name cannot be re-assigned or overridden in a subclass.
726
+
727
+ For example::
728
+
729
+ MAX_SIZE: Final = 9000
730
+ MAX_SIZE += 1 # Error reported by type checker
731
+
732
+ class Connection:
733
+ TIMEOUT: Final[int] = 10
734
+
735
+ class FastConnector(Connection):
736
+ TIMEOUT = 1 # Error reported by type checker
737
+
738
+ There is no runtime checking of these properties.
739
+ """
740
+ item = _type_check(parameters, f'{self} accepts only single type.', allow_special_forms=True)
741
+ return _GenericAlias(self, (item,))
742
+
743
+ @_SpecialForm
744
+ def Optional(self, parameters):
745
+ """Optional[X] is equivalent to X | None."""
746
+ arg = _type_check(parameters, f"{self} requires a single type.")
747
+ return Union[arg, type(None)]
748
+
749
+ @_TypedCacheSpecialForm
750
+ @_tp_cache(typed=True)
751
+ def Literal(self, *parameters):
752
+ """Special typing form to define literal types (a.k.a. value types).
753
+
754
+ This form can be used to indicate to type checkers that the corresponding
755
+ variable or function parameter has a value equivalent to the provided
756
+ literal (or one of several literals)::
757
+
758
+ def validate_simple(data: Any) -> Literal[True]: # always returns True
759
+ ...
760
+
761
+ MODE = Literal['r', 'rb', 'w', 'wb']
762
+ def open_helper(file: str, mode: MODE) -> str:
763
+ ...
764
+
765
+ open_helper('/some/path', 'r') # Passes type check
766
+ open_helper('/other/path', 'typo') # Error in type checker
767
+
768
+ Literal[...] cannot be subclassed. At runtime, an arbitrary value
769
+ is allowed as type argument to Literal[...], but type checkers may
770
+ impose restrictions.
771
+ """
772
+ # There is no '_type_check' call because arguments to Literal[...] are
773
+ # values, not types.
774
+ parameters = _flatten_literal_params(parameters)
775
+ value_and_type_parameters = list(_value_and_type_iter(parameters))
776
+ deduplicated_parameters = tuple(
777
+ p
778
+ for p, _ in _deduplicate(
779
+ value_and_type_parameters,
780
+ unhashable_fallback=True,
781
+ )
782
+ )
783
+
784
+ return _LiteralGenericAlias(self, deduplicated_parameters)
785
+
786
+
787
+ @_SpecialForm
788
+ def TypeAlias(self, parameters):
789
+ """Special form for marking type aliases.
790
+
791
+ TypeAlias can be used to indicate that an assignment should
792
+ be recognized as a proper type alias definition by type
793
+ checkers.
794
+
795
+ For example::
796
+
797
+ Predicate: TypeAlias = Callable[..., bool]
798
+
799
+ It's invalid when used anywhere except as in the example above.
800
+ """
801
+ raise TypeError(f"{self} is not subscriptable")
802
+
803
+
804
+ @_SpecialForm
805
+ def Concatenate(self, parameters):
806
+ """Special form for annotating higher-order functions.
807
+
808
+ ``Concatenate`` can be used in conjunction with ``ParamSpec`` and
809
+ ``Callable`` to represent a higher-order function which adds, removes or
810
+ transforms the parameters of a callable.
811
+
812
+ For example::
813
+
814
+ Callable[Concatenate[int, P], int]
815
+
816
+ See PEP 612 for detailed information.
817
+ """
818
+ if parameters == ():
819
+ raise TypeError("Cannot take a Concatenate of no types.")
820
+ if not isinstance(parameters, tuple):
821
+ parameters = (parameters,)
822
+ if not (parameters[-1] is ... or isinstance(parameters[-1], ParamSpec)):
823
+ raise TypeError("The last parameter to Concatenate should be a "
824
+ "ParamSpec variable or ellipsis.")
825
+ msg = "Concatenate[arg, ...]: each arg must be a type."
826
+ parameters = (*(_type_check(p, msg) for p in parameters[:-1]), parameters[-1])
827
+ return _ConcatenateGenericAlias(self, parameters)
828
+
829
+
830
+ @_SpecialForm
831
+ def TypeGuard(self, parameters):
832
+ """Special typing construct for marking user-defined type predicate functions.
833
+
834
+ ``TypeGuard`` can be used to annotate the return type of a user-defined
835
+ type predicate function. ``TypeGuard`` only accepts a single type argument.
836
+ At runtime, functions marked this way should return a boolean.
837
+
838
+ ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
839
+ type checkers to determine a more precise type of an expression within a
840
+ program's code flow. Usually type narrowing is done by analyzing
841
+ conditional code flow and applying the narrowing to a block of code. The
842
+ conditional expression here is sometimes referred to as a "type predicate".
843
+
844
+ Sometimes it would be convenient to use a user-defined boolean function
845
+ as a type predicate. Such a function should use ``TypeGuard[...]`` or
846
+ ``TypeIs[...]`` as its return type to alert static type checkers to
847
+ this intention. ``TypeGuard`` should be used over ``TypeIs`` when narrowing
848
+ from an incompatible type (e.g., ``list[object]`` to ``list[int]``) or when
849
+ the function does not return ``True`` for all instances of the narrowed type.
850
+
851
+ Using ``-> TypeGuard[NarrowedType]`` tells the static type checker that
852
+ for a given function:
853
+
854
+ 1. The return value is a boolean.
855
+ 2. If the return value is ``True``, the type of its argument
856
+ is ``NarrowedType``.
857
+
858
+ For example::
859
+
860
+ def is_str_list(val: list[object]) -> TypeGuard[list[str]]:
861
+ '''Determines whether all objects in the list are strings'''
862
+ return all(isinstance(x, str) for x in val)
863
+
864
+ def func1(val: list[object]):
865
+ if is_str_list(val):
866
+ # Type of ``val`` is narrowed to ``list[str]``.
867
+ print(" ".join(val))
868
+ else:
869
+ # Type of ``val`` remains as ``list[object]``.
870
+ print("Not a list of strings!")
871
+
872
+ Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
873
+ form of ``TypeA`` (it can even be a wider form) and this may lead to
874
+ type-unsafe results. The main reason is to allow for things like
875
+ narrowing ``list[object]`` to ``list[str]`` even though the latter is not
876
+ a subtype of the former, since ``list`` is invariant. The responsibility of
877
+ writing type-safe type predicates is left to the user.
878
+
879
+ ``TypeGuard`` also works with type variables. For more information, see
880
+ PEP 647 (User-Defined Type Guards).
881
+ """
882
+ item = _type_check(parameters, f'{self} accepts only single type.')
883
+ return _GenericAlias(self, (item,))
884
+
885
+
886
+ @_SpecialForm
887
+ def TypeIs(self, parameters):
888
+ """Special typing construct for marking user-defined type predicate functions.
889
+
890
+ ``TypeIs`` can be used to annotate the return type of a user-defined
891
+ type predicate function. ``TypeIs`` only accepts a single type argument.
892
+ At runtime, functions marked this way should return a boolean and accept
893
+ at least one argument.
894
+
895
+ ``TypeIs`` aims to benefit *type narrowing* -- a technique used by static
896
+ type checkers to determine a more precise type of an expression within a
897
+ program's code flow. Usually type narrowing is done by analyzing
898
+ conditional code flow and applying the narrowing to a block of code. The
899
+ conditional expression here is sometimes referred to as a "type predicate".
900
+
901
+ Sometimes it would be convenient to use a user-defined boolean function
902
+ as a type predicate. Such a function should use ``TypeIs[...]`` or
903
+ ``TypeGuard[...]`` as its return type to alert static type checkers to
904
+ this intention. ``TypeIs`` usually has more intuitive behavior than
905
+ ``TypeGuard``, but it cannot be used when the input and output types
906
+ are incompatible (e.g., ``list[object]`` to ``list[int]``) or when the
907
+ function does not return ``True`` for all instances of the narrowed type.
908
+
909
+ Using ``-> TypeIs[NarrowedType]`` tells the static type checker that for
910
+ a given function:
911
+
912
+ 1. The return value is a boolean.
913
+ 2. If the return value is ``True``, the type of its argument
914
+ is the intersection of the argument's original type and
915
+ ``NarrowedType``.
916
+ 3. If the return value is ``False``, the type of its argument
917
+ is narrowed to exclude ``NarrowedType``.
918
+
919
+ For example::
920
+
921
+ from typing import assert_type, final, TypeIs
922
+
923
+ class Parent: pass
924
+ class Child(Parent): pass
925
+ @final
926
+ class Unrelated: pass
927
+
928
+ def is_parent(val: object) -> TypeIs[Parent]:
929
+ return isinstance(val, Parent)
930
+
931
+ def run(arg: Child | Unrelated):
932
+ if is_parent(arg):
933
+ # Type of ``arg`` is narrowed to the intersection
934
+ # of ``Parent`` and ``Child``, which is equivalent to
935
+ # ``Child``.
936
+ assert_type(arg, Child)
937
+ else:
938
+ # Type of ``arg`` is narrowed to exclude ``Parent``,
939
+ # so only ``Unrelated`` is left.
940
+ assert_type(arg, Unrelated)
941
+
942
+ The type inside ``TypeIs`` must be consistent with the type of the
943
+ function's argument; if it is not, static type checkers will raise
944
+ an error. An incorrectly written ``TypeIs`` function can lead to
945
+ unsound behavior in the type system; it is the user's responsibility
946
+ to write such functions in a type-safe manner.
947
+
948
+ ``TypeIs`` also works with type variables. For more information, see
949
+ PEP 742 (Narrowing types with ``TypeIs``).
950
+ """
951
+ item = _type_check(parameters, f'{self} accepts only single type.')
952
+ return _GenericAlias(self, (item,))
953
+
954
+
955
+ def _make_forward_ref(code, *, parent_fwdref=None, **kwargs):
956
+ if parent_fwdref is not None:
957
+ if parent_fwdref.__forward_module__ is not None:
958
+ kwargs['module'] = parent_fwdref.__forward_module__
959
+ if parent_fwdref.__owner__ is not None:
960
+ kwargs['owner'] = parent_fwdref.__owner__
961
+ forward_ref = _lazy_annotationlib.ForwardRef(code, **kwargs)
962
+ # For compatibility, eagerly compile the forwardref's code.
963
+ forward_ref.__forward_code__
964
+ return forward_ref
965
+
966
+
967
+ def evaluate_forward_ref(
968
+ forward_ref,
969
+ *,
970
+ owner=None,
971
+ globals=None,
972
+ locals=None,
973
+ type_params=None,
974
+ format=None,
975
+ _recursive_guard=frozenset(),
976
+ ):
977
+ """Evaluate a forward reference as a type hint.
978
+
979
+ This is similar to calling the ForwardRef.evaluate() method,
980
+ but unlike that method, evaluate_forward_ref() also
981
+ recursively evaluates forward references nested within the type hint.
982
+
983
+ *forward_ref* must be an instance of ForwardRef. *owner*, if given,
984
+ should be the object that holds the annotations that the forward reference
985
+ derived from, such as a module, class object, or function. It is used to
986
+ infer the namespaces to use for looking up names. *globals* and *locals*
987
+ can also be explicitly given to provide the global and local namespaces.
988
+ *type_params* is a tuple of type parameters that are in scope when
989
+ evaluating the forward reference. This parameter should be provided (though
990
+ it may be an empty tuple) if *owner* is not given and the forward reference
991
+ does not already have an owner set. *format* specifies the format of the
992
+ annotation and is a member of the annotationlib.Format enum, defaulting to
993
+ VALUE.
994
+
995
+ """
996
+ if format == _lazy_annotationlib.Format.STRING:
997
+ return forward_ref.__resolved_str__
998
+ if forward_ref.__forward_arg__ in _recursive_guard:
999
+ return forward_ref
1000
+
1001
+ if format is None:
1002
+ format = _lazy_annotationlib.Format.VALUE
1003
+ value = forward_ref.evaluate(globals=globals, locals=locals,
1004
+ type_params=type_params, owner=owner, format=format)
1005
+
1006
+ if (isinstance(value, _lazy_annotationlib.ForwardRef)
1007
+ and format == _lazy_annotationlib.Format.FORWARDREF):
1008
+ return value
1009
+
1010
+ if isinstance(value, str):
1011
+ value = _make_forward_ref(value, module=forward_ref.__forward_module__,
1012
+ owner=owner or forward_ref.__owner__,
1013
+ is_argument=forward_ref.__forward_is_argument__,
1014
+ is_class=forward_ref.__forward_is_class__)
1015
+ if owner is None:
1016
+ owner = forward_ref.__owner__
1017
+ return _eval_type(
1018
+ value,
1019
+ globals,
1020
+ locals,
1021
+ type_params,
1022
+ recursive_guard=_recursive_guard | {forward_ref.__forward_arg__},
1023
+ format=format,
1024
+ owner=owner,
1025
+ parent_fwdref=forward_ref,
1026
+ )
1027
+
1028
+
1029
+ def _is_unpacked_typevartuple(x: Any) -> bool:
1030
+ # Need to check 'is True' here
1031
+ # See: https://github.com/python/cpython/issues/137706
1032
+ return ((not isinstance(x, type)) and
1033
+ getattr(x, '__typing_is_unpacked_typevartuple__', False) is True)
1034
+
1035
+
1036
+ def _is_typevar_like(x: Any) -> bool:
1037
+ return isinstance(x, (TypeVar, ParamSpec)) or _is_unpacked_typevartuple(x)
1038
+
1039
+
1040
+ def _typevar_subst(self, arg):
1041
+ msg = "Parameters to generic types must be types."
1042
+ arg = _type_check(arg, msg, is_argument=True)
1043
+ if ((isinstance(arg, _GenericAlias) and arg.__origin__ is Unpack) or
1044
+ (isinstance(arg, GenericAlias) and getattr(arg, '__unpacked__', False))):
1045
+ raise TypeError(f"{arg} is not valid as type argument")
1046
+ return arg
1047
+
1048
+
1049
+ def _typevartuple_prepare_subst(self, alias, args):
1050
+ params = alias.__parameters__
1051
+ typevartuple_index = params.index(self)
1052
+ for param in params[typevartuple_index + 1:]:
1053
+ if isinstance(param, TypeVarTuple):
1054
+ raise TypeError(f"More than one TypeVarTuple parameter in {alias}")
1055
+
1056
+ alen = len(args)
1057
+ plen = len(params)
1058
+ left = typevartuple_index
1059
+ right = plen - typevartuple_index - 1
1060
+ var_tuple_index = None
1061
+ fillarg = None
1062
+ for k, arg in enumerate(args):
1063
+ if not isinstance(arg, type):
1064
+ subargs = getattr(arg, '__typing_unpacked_tuple_args__', None)
1065
+ if subargs and len(subargs) == 2 and subargs[-1] is ...:
1066
+ if var_tuple_index is not None:
1067
+ raise TypeError("More than one unpacked arbitrary-length tuple argument")
1068
+ var_tuple_index = k
1069
+ fillarg = subargs[0]
1070
+ if var_tuple_index is not None:
1071
+ left = min(left, var_tuple_index)
1072
+ right = min(right, alen - var_tuple_index - 1)
1073
+ elif left + right > alen:
1074
+ raise TypeError(f"Too few arguments for {alias};"
1075
+ f" actual {alen}, expected at least {plen-1}")
1076
+ if left == alen - right and self.has_default():
1077
+ replacement = _unpack_args(self.__default__)
1078
+ else:
1079
+ replacement = args[left: alen - right]
1080
+
1081
+ return (
1082
+ *args[:left],
1083
+ *([fillarg]*(typevartuple_index - left)),
1084
+ replacement,
1085
+ *([fillarg]*(plen - right - left - typevartuple_index - 1)),
1086
+ *args[alen - right:],
1087
+ )
1088
+
1089
+
1090
+ def _paramspec_subst(self, arg):
1091
+ if isinstance(arg, (list, tuple)):
1092
+ arg = tuple(_type_check(a, "Expected a type.") for a in arg)
1093
+ elif not _is_param_expr(arg):
1094
+ raise TypeError(f"Expected a list of types, an ellipsis, "
1095
+ f"ParamSpec, or Concatenate. Got {arg}")
1096
+ return arg
1097
+
1098
+
1099
+ def _paramspec_prepare_subst(self, alias, args):
1100
+ params = alias.__parameters__
1101
+ i = params.index(self)
1102
+ if i == len(args) and self.has_default():
1103
+ args = (*args, self.__default__)
1104
+ if i >= len(args):
1105
+ raise TypeError(f"Too few arguments for {alias}")
1106
+ # Special case where Z[[int, str, bool]] == Z[int, str, bool] in PEP 612.
1107
+ if len(params) == 1 and not _is_param_expr(args[0]):
1108
+ assert i == 0
1109
+ args = (args,)
1110
+ # Convert lists to tuples to help other libraries cache the results.
1111
+ elif isinstance(args[i], list):
1112
+ args = (*args[:i], tuple(args[i]), *args[i+1:])
1113
+ return args
1114
+
1115
+
1116
+ @_tp_cache
1117
+ def _generic_class_getitem(cls, args):
1118
+ """Parameterizes a generic class.
1119
+
1120
+ At least, parameterizing a generic class is the *main* thing this method
1121
+ does. For example, for some generic class `Foo`, this is called when we
1122
+ do `Foo[int]` - there, with `cls=Foo` and `args=int`.
1123
+
1124
+ However, note that this method is also called when defining generic
1125
+ classes in the first place with `class Foo(Generic[T]): ...`.
1126
+ """
1127
+ if not isinstance(args, tuple):
1128
+ args = (args,)
1129
+
1130
+ args = tuple(_type_convert(p) for p in args)
1131
+ is_generic_or_protocol = cls in (Generic, Protocol)
1132
+
1133
+ if is_generic_or_protocol:
1134
+ # Generic and Protocol can only be subscripted with unique type variables.
1135
+ if not args:
1136
+ raise TypeError(
1137
+ f"Parameter list to {cls.__qualname__}[...] cannot be empty"
1138
+ )
1139
+ if not all(_is_typevar_like(p) for p in args):
1140
+ raise TypeError(
1141
+ f"Parameters to {cls.__name__}[...] must all be type variables "
1142
+ f"or parameter specification variables.")
1143
+ if len(set(args)) != len(args):
1144
+ raise TypeError(
1145
+ f"Parameters to {cls.__name__}[...] must all be unique")
1146
+ else:
1147
+ # Subscripting a regular Generic subclass.
1148
+ try:
1149
+ parameters = cls.__parameters__
1150
+ except AttributeError as e:
1151
+ init_subclass = getattr(cls, '__init_subclass__', None)
1152
+ if init_subclass not in {None, Generic.__init_subclass__}:
1153
+ e.add_note(
1154
+ f"Note: this exception may have been caused by "
1155
+ f"{init_subclass.__qualname__!r} (or the "
1156
+ f"'__init_subclass__' method on a superclass) not "
1157
+ f"calling 'super().__init_subclass__()'"
1158
+ )
1159
+ raise
1160
+ for param in parameters:
1161
+ prepare = getattr(param, '__typing_prepare_subst__', None)
1162
+ if prepare is not None:
1163
+ args = prepare(cls, args)
1164
+ _check_generic_specialization(cls, args)
1165
+
1166
+ new_args = []
1167
+ for param, new_arg in zip(parameters, args):
1168
+ if isinstance(param, TypeVarTuple):
1169
+ new_args.extend(new_arg)
1170
+ else:
1171
+ new_args.append(new_arg)
1172
+ args = tuple(new_args)
1173
+
1174
+ return _GenericAlias(cls, args)
1175
+
1176
+
1177
+ def _generic_init_subclass(cls, *args, **kwargs):
1178
+ super(Generic, cls).__init_subclass__(*args, **kwargs)
1179
+ tvars = []
1180
+ if '__orig_bases__' in cls.__dict__:
1181
+ error = Generic in cls.__orig_bases__
1182
+ else:
1183
+ error = (Generic in cls.__bases__ and
1184
+ cls.__name__ != 'Protocol' and
1185
+ type(cls) != _TypedDictMeta)
1186
+ if error:
1187
+ raise TypeError("Cannot inherit from plain Generic")
1188
+ if '__orig_bases__' in cls.__dict__:
1189
+ tvars = _collect_type_parameters(cls.__orig_bases__)
1190
+ # Look for Generic[T1, ..., Tn].
1191
+ # If found, tvars must be a subset of it.
1192
+ # If not found, tvars is it.
1193
+ # Also check for and reject plain Generic,
1194
+ # and reject multiple Generic[...].
1195
+ gvars = None
1196
+ for base in cls.__orig_bases__:
1197
+ if (isinstance(base, _GenericAlias) and
1198
+ base.__origin__ is Generic):
1199
+ if gvars is not None:
1200
+ raise TypeError(
1201
+ "Cannot inherit from Generic[...] multiple times.")
1202
+ gvars = base.__parameters__
1203
+ if gvars is not None:
1204
+ tvarset = set(tvars)
1205
+ gvarset = set(gvars)
1206
+ if not tvarset <= gvarset:
1207
+ s_vars = ', '.join(str(t) for t in tvars if t not in gvarset)
1208
+ s_args = ', '.join(str(g) for g in gvars)
1209
+ raise TypeError(f"Some type variables ({s_vars}) are"
1210
+ f" not listed in Generic[{s_args}]")
1211
+ tvars = gvars
1212
+ cls.__parameters__ = tuple(tvars)
1213
+
1214
+
1215
+ def _is_dunder(attr):
1216
+ return attr.startswith('__') and attr.endswith('__')
1217
+
1218
+ class _BaseGenericAlias(_Final, _root=True):
1219
+ """The central part of the internal API.
1220
+
1221
+ This represents a generic version of type 'origin' with type arguments 'params'.
1222
+ There are two kind of these aliases: user defined and special. The special ones
1223
+ are wrappers around builtin collections and ABCs in collections.abc. These must
1224
+ have 'name' always set. If 'inst' is False, then the alias can't be instantiated;
1225
+ this is used by e.g. typing.List and typing.Dict.
1226
+ """
1227
+
1228
+ def __init__(self, origin, *, inst=True, name=None):
1229
+ self._inst = inst
1230
+ self._name = name
1231
+ self.__origin__ = origin
1232
+ self.__slots__ = None # This is not documented.
1233
+
1234
+ def __call__(self, *args, **kwargs):
1235
+ if not self._inst:
1236
+ raise TypeError(f"Type {self._name} cannot be instantiated; "
1237
+ f"use {self.__origin__.__name__}() instead")
1238
+ result = self.__origin__(*args, **kwargs)
1239
+ try:
1240
+ result.__orig_class__ = self
1241
+ # Some objects raise TypeError (or something even more exotic)
1242
+ # if you try to set attributes on them; we guard against that here
1243
+ except Exception:
1244
+ pass
1245
+ return result
1246
+
1247
+ def __mro_entries__(self, bases):
1248
+ res = []
1249
+ if self.__origin__ not in bases:
1250
+ res.append(self.__origin__)
1251
+
1252
+ # Check if any base that occurs after us in `bases` is either itself a
1253
+ # subclass of Generic, or something which will add a subclass of Generic
1254
+ # to `__bases__` via its `__mro_entries__`. If not, add Generic
1255
+ # ourselves. The goal is to ensure that Generic (or a subclass) will
1256
+ # appear exactly once in the final bases tuple. If we let it appear
1257
+ # multiple times, we risk "can't form a consistent MRO" errors.
1258
+ i = bases.index(self)
1259
+ for b in bases[i+1:]:
1260
+ if isinstance(b, _BaseGenericAlias):
1261
+ break
1262
+ if not isinstance(b, type):
1263
+ meth = getattr(b, "__mro_entries__", None)
1264
+ new_bases = meth(bases) if meth else None
1265
+ if (
1266
+ isinstance(new_bases, tuple) and
1267
+ any(
1268
+ isinstance(b2, type) and issubclass(b2, Generic)
1269
+ for b2 in new_bases
1270
+ )
1271
+ ):
1272
+ break
1273
+ elif issubclass(b, Generic):
1274
+ break
1275
+ else:
1276
+ res.append(Generic)
1277
+ return tuple(res)
1278
+
1279
+ def __getattr__(self, attr):
1280
+ if attr in {'__name__', '__qualname__'}:
1281
+ return self._name or self.__origin__.__name__
1282
+
1283
+ # We are careful for copy and pickle.
1284
+ # Also for simplicity we don't relay any dunder names
1285
+ if '__origin__' in self.__dict__ and not _is_dunder(attr):
1286
+ return getattr(self.__origin__, attr)
1287
+ raise AttributeError(attr)
1288
+
1289
+ def __setattr__(self, attr, val):
1290
+ if _is_dunder(attr) or attr in {'_name', '_inst', '_nparams', '_defaults'}:
1291
+ super().__setattr__(attr, val)
1292
+ else:
1293
+ setattr(self.__origin__, attr, val)
1294
+
1295
+ def __instancecheck__(self, obj):
1296
+ return self.__subclasscheck__(type(obj))
1297
+
1298
+ def __subclasscheck__(self, cls):
1299
+ raise TypeError("Subscripted generics cannot be used with"
1300
+ " class and instance checks")
1301
+
1302
+ def __dir__(self):
1303
+ return list(set(super().__dir__()
1304
+ + [attr for attr in dir(self.__origin__) if not _is_dunder(attr)]))
1305
+
1306
+
1307
+ # Special typing constructs Union, Optional, Generic, Callable and Tuple
1308
+ # use three special attributes for internal bookkeeping of generic types:
1309
+ # * __parameters__ is a tuple of unique free type parameters of a generic
1310
+ # type, for example, Dict[T, T].__parameters__ == (T,);
1311
+ # * __origin__ keeps a reference to a type that was subscripted,
1312
+ # e.g., Union[T, int].__origin__ == Union, or the non-generic version of
1313
+ # the type.
1314
+ # * __args__ is a tuple of all arguments used in subscripting,
1315
+ # e.g., Dict[T, int].__args__ == (T, int).
1316
+
1317
+
1318
+ class _GenericAlias(_BaseGenericAlias, _root=True):
1319
+ """The type of parameterized generics.
1320
+
1321
+ That is, for example, `type(List[int])` is `_GenericAlias`.
1322
+
1323
+ Objects which are instances of this class include:
1324
+ * Parameterized container types, e.g. `Tuple[int]`, `List[int]`.
1325
+ * Note that native container types, e.g. `tuple`, `list`, use
1326
+ `types.GenericAlias` instead.
1327
+ * Parameterized classes:
1328
+ class C[T]: pass
1329
+ # C[int] is a _GenericAlias
1330
+ * `Callable` aliases, generic `Callable` aliases, and
1331
+ parameterized `Callable` aliases:
1332
+ T = TypeVar('T')
1333
+ # _CallableGenericAlias inherits from _GenericAlias.
1334
+ A = Callable[[], None] # _CallableGenericAlias
1335
+ B = Callable[[T], None] # _CallableGenericAlias
1336
+ C = B[int] # _CallableGenericAlias
1337
+ * Parameterized `Final`, `ClassVar`, `TypeForm`, `TypeGuard`, and `TypeIs`:
1338
+ # All _GenericAlias
1339
+ Final[int]
1340
+ ClassVar[float]
1341
+ TypeForm[bytearray]
1342
+ TypeGuard[bool]
1343
+ TypeIs[range]
1344
+
1345
+ Note that instances of this class are not classes (e.g by `inspect.isclass`),
1346
+ even though they behave like them.
1347
+ """
1348
+ def __init__(self, origin, args, *, inst=True, name=None):
1349
+ super().__init__(origin, inst=inst, name=name)
1350
+ if not isinstance(args, tuple):
1351
+ args = (args,)
1352
+ self.__args__ = tuple(... if a is _TypingEllipsis else
1353
+ a for a in args)
1354
+ enforce_default_ordering = origin in (Generic, Protocol)
1355
+ self.__parameters__ = _collect_type_parameters(
1356
+ args,
1357
+ enforce_default_ordering=enforce_default_ordering,
1358
+ )
1359
+ if not name:
1360
+ self.__module__ = origin.__module__
1361
+
1362
+ def __eq__(self, other):
1363
+ if not isinstance(other, _GenericAlias):
1364
+ return NotImplemented
1365
+ return (self.__origin__ == other.__origin__
1366
+ and self.__args__ == other.__args__)
1367
+
1368
+ def __hash__(self):
1369
+ return hash((self.__origin__, self.__args__))
1370
+
1371
+ def __or__(self, right):
1372
+ return Union[self, right]
1373
+
1374
+ def __ror__(self, left):
1375
+ return Union[left, self]
1376
+
1377
+ @_tp_cache
1378
+ def __getitem__(self, args):
1379
+ """Parameterizes an already-parameterized object.
1380
+
1381
+ For example, we arrive here doing something like:
1382
+ T1 = TypeVar('T1')
1383
+ T2 = TypeVar('T2')
1384
+ T3 = TypeVar('T3')
1385
+ class A(Generic[T1]): pass
1386
+ B = A[T2] # B is a _GenericAlias
1387
+ C = B[T3] # Invokes _GenericAlias.__getitem__
1388
+
1389
+ We also arrive here when parameterizing a generic `Callable` alias:
1390
+ T = TypeVar('T')
1391
+ C = Callable[[T], None]
1392
+ C[int] # Invokes _GenericAlias.__getitem__
1393
+ """
1394
+
1395
+ if self.__origin__ in (Generic, Protocol):
1396
+ # Can't subscript Generic[...] or Protocol[...].
1397
+ raise TypeError(f"Cannot subscript already-subscripted {self}")
1398
+ if not self.__parameters__:
1399
+ raise TypeError(f"{self} is not a generic class")
1400
+
1401
+ # Preprocess `args`.
1402
+ if not isinstance(args, tuple):
1403
+ args = (args,)
1404
+ args = _unpack_args(*(_type_convert(p) for p in args))
1405
+ new_args = self._determine_new_args(args)
1406
+ r = self.copy_with(new_args)
1407
+ return r
1408
+
1409
+ def _determine_new_args(self, args):
1410
+ """Determines new __args__ for __getitem__.
1411
+
1412
+ For example, suppose we had:
1413
+ T1 = TypeVar('T1')
1414
+ T2 = TypeVar('T2')
1415
+ class A(Generic[T1, T2]): pass
1416
+ T3 = TypeVar('T3')
1417
+ B = A[int, T3]
1418
+ C = B[str]
1419
+ `B.__args__` is `(int, T3)`, so `C.__args__` should be `(int, str)`.
1420
+ Unfortunately, this is harder than it looks, because if `T3` is
1421
+ anything more exotic than a plain `TypeVar`, we need to consider
1422
+ edge cases.
1423
+ """
1424
+ params = self.__parameters__
1425
+ # In the example above, this would be {T3: str}
1426
+ for param in params:
1427
+ prepare = getattr(param, '__typing_prepare_subst__', None)
1428
+ if prepare is not None:
1429
+ args = prepare(self, args)
1430
+ alen = len(args)
1431
+ plen = len(params)
1432
+ if alen != plen:
1433
+ raise TypeError(f"Too {'many' if alen > plen else 'few'} arguments for {self};"
1434
+ f" actual {alen}, expected {plen}")
1435
+ new_arg_by_param = dict(zip(params, args))
1436
+ return tuple(self._make_substitution(self.__args__, new_arg_by_param))
1437
+
1438
+ def _make_substitution(self, args, new_arg_by_param):
1439
+ """Create a list of new type arguments."""
1440
+ new_args = []
1441
+ for old_arg in args:
1442
+ if isinstance(old_arg, type):
1443
+ new_args.append(old_arg)
1444
+ continue
1445
+
1446
+ substfunc = getattr(old_arg, '__typing_subst__', None)
1447
+ if substfunc:
1448
+ new_arg = substfunc(new_arg_by_param[old_arg])
1449
+ else:
1450
+ subparams = getattr(old_arg, '__parameters__', ())
1451
+ if not subparams:
1452
+ new_arg = old_arg
1453
+ else:
1454
+ subargs = []
1455
+ for x in subparams:
1456
+ if isinstance(x, TypeVarTuple):
1457
+ subargs.extend(new_arg_by_param[x])
1458
+ else:
1459
+ subargs.append(new_arg_by_param[x])
1460
+ new_arg = old_arg[tuple(subargs)]
1461
+
1462
+ if self.__origin__ == collections.abc.Callable and isinstance(new_arg, tuple):
1463
+ # Consider the following `Callable`.
1464
+ # C = Callable[[int], str]
1465
+ # Here, `C.__args__` should be (int, str) - NOT ([int], str).
1466
+ # That means that if we had something like...
1467
+ # P = ParamSpec('P')
1468
+ # T = TypeVar('T')
1469
+ # C = Callable[P, T]
1470
+ # D = C[[int, str], float]
1471
+ # ...we need to be careful; `new_args` should end up as
1472
+ # `(int, str, float)` rather than `([int, str], float)`.
1473
+ new_args.extend(new_arg)
1474
+ elif _is_unpacked_typevartuple(old_arg):
1475
+ # Consider the following `_GenericAlias`, `B`:
1476
+ # class A(Generic[*Ts]): ...
1477
+ # B = A[T, *Ts]
1478
+ # If we then do:
1479
+ # B[float, int, str]
1480
+ # The `new_arg` corresponding to `T` will be `float`, and the
1481
+ # `new_arg` corresponding to `*Ts` will be `(int, str)`. We
1482
+ # should join all these types together in a flat list
1483
+ # `(float, int, str)` - so again, we should `extend`.
1484
+ new_args.extend(new_arg)
1485
+ elif isinstance(old_arg, tuple):
1486
+ # Corner case:
1487
+ # P = ParamSpec('P')
1488
+ # T = TypeVar('T')
1489
+ # class Base(Generic[P]): ...
1490
+ # Can be substituted like this:
1491
+ # X = Base[[int, T]]
1492
+ # In this case, `old_arg` will be a tuple:
1493
+ new_args.append(
1494
+ tuple(self._make_substitution(old_arg, new_arg_by_param)),
1495
+ )
1496
+ else:
1497
+ new_args.append(new_arg)
1498
+ return new_args
1499
+
1500
+ def copy_with(self, args):
1501
+ return self.__class__(self.__origin__, args, name=self._name, inst=self._inst)
1502
+
1503
+ def __repr__(self):
1504
+ if self._name:
1505
+ name = 'typing.' + self._name
1506
+ else:
1507
+ name = _type_repr(self.__origin__)
1508
+ if self.__args__:
1509
+ args = ", ".join([_type_repr(a) for a in self.__args__])
1510
+ else:
1511
+ # To ensure the repr is eval-able.
1512
+ args = "()"
1513
+ return f'{name}[{args}]'
1514
+
1515
+ def __reduce__(self):
1516
+ if self._name:
1517
+ origin = globals()[self._name]
1518
+ else:
1519
+ origin = self.__origin__
1520
+ args = tuple(self.__args__)
1521
+ if len(args) == 1 and not isinstance(args[0], tuple):
1522
+ args, = args
1523
+ return operator.getitem, (origin, args)
1524
+
1525
+ def __mro_entries__(self, bases):
1526
+ if isinstance(self.__origin__, _SpecialForm):
1527
+ raise TypeError(f"Cannot subclass {self!r}")
1528
+
1529
+ if self._name: # generic version of an ABC or built-in class
1530
+ return super().__mro_entries__(bases)
1531
+ if self.__origin__ is Generic:
1532
+ if Protocol in bases:
1533
+ return ()
1534
+ i = bases.index(self)
1535
+ for b in bases[i+1:]:
1536
+ if isinstance(b, _BaseGenericAlias) and b is not self:
1537
+ return ()
1538
+ return (self.__origin__,)
1539
+
1540
+ def __iter__(self):
1541
+ yield Unpack[self]
1542
+
1543
+
1544
+ # _nparams is the number of accepted parameters, e.g. 0 for Hashable,
1545
+ # 1 for List and 2 for Dict. It may be -1 if variable number of
1546
+ # parameters are accepted (needs custom __getitem__).
1547
+
1548
+ class _SpecialGenericAlias(_NotIterable, _BaseGenericAlias, _root=True):
1549
+ def __init__(self, origin, nparams, *, inst=True, name=None, defaults=()):
1550
+ if name is None:
1551
+ name = origin.__name__
1552
+ super().__init__(origin, inst=inst, name=name)
1553
+ self._nparams = nparams
1554
+ self._defaults = defaults
1555
+ if origin.__module__ == 'builtins':
1556
+ self.__doc__ = f'Deprecated alias to {origin.__qualname__}.'
1557
+ else:
1558
+ self.__doc__ = f'Deprecated alias to {origin.__module__}.{origin.__qualname__}.'
1559
+
1560
+ @_tp_cache
1561
+ def __getitem__(self, params):
1562
+ if not isinstance(params, tuple):
1563
+ params = (params,)
1564
+ msg = "Parameters to generic types must be types."
1565
+ params = tuple(_type_check(p, msg) for p in params)
1566
+ if (self._defaults
1567
+ and len(params) < self._nparams
1568
+ and len(params) + len(self._defaults) >= self._nparams
1569
+ ):
1570
+ params = (*params, *self._defaults[len(params) - self._nparams:])
1571
+ actual_len = len(params)
1572
+
1573
+ if actual_len != self._nparams:
1574
+ if self._defaults:
1575
+ expected = f"at least {self._nparams - len(self._defaults)}"
1576
+ else:
1577
+ expected = str(self._nparams)
1578
+ if not self._nparams:
1579
+ raise TypeError(f"{self} is not a generic class")
1580
+ raise TypeError(f"Too {'many' if actual_len > self._nparams else 'few'} arguments for {self};"
1581
+ f" actual {actual_len}, expected {expected}")
1582
+ return self.copy_with(params)
1583
+
1584
+ def copy_with(self, params):
1585
+ return _GenericAlias(self.__origin__, params,
1586
+ name=self._name, inst=self._inst)
1587
+
1588
+ def __repr__(self):
1589
+ return 'typing.' + self._name
1590
+
1591
+ def __subclasscheck__(self, cls):
1592
+ if isinstance(cls, _SpecialGenericAlias):
1593
+ return issubclass(cls.__origin__, self.__origin__)
1594
+ if not isinstance(cls, _GenericAlias):
1595
+ return issubclass(cls, self.__origin__)
1596
+ return super().__subclasscheck__(cls)
1597
+
1598
+ def __reduce__(self):
1599
+ return self._name
1600
+
1601
+ def __or__(self, right):
1602
+ return Union[self, right]
1603
+
1604
+ def __ror__(self, left):
1605
+ return Union[left, self]
1606
+
1607
+
1608
+ class _DeprecatedGenericAlias(_SpecialGenericAlias, _root=True):
1609
+ def __init__(
1610
+ self, origin, nparams, *, removal_version, inst=True, name=None
1611
+ ):
1612
+ super().__init__(origin, nparams, inst=inst, name=name)
1613
+ self._removal_version = removal_version
1614
+
1615
+ def __instancecheck__(self, inst):
1616
+ import warnings
1617
+ warnings._deprecated(
1618
+ f"{self.__module__}.{self._name}", remove=self._removal_version
1619
+ )
1620
+ return super().__instancecheck__(inst)
1621
+
1622
+
1623
+ class _CallableGenericAlias(_NotIterable, _GenericAlias, _root=True):
1624
+ def __repr__(self):
1625
+ assert self._name == 'Callable'
1626
+ args = self.__args__
1627
+ if len(args) == 2 and _is_param_expr(args[0]):
1628
+ return super().__repr__()
1629
+ return (f'typing.Callable'
1630
+ f'[[{", ".join([_type_repr(a) for a in args[:-1]])}], '
1631
+ f'{_type_repr(args[-1])}]')
1632
+
1633
+ def __reduce__(self):
1634
+ args = self.__args__
1635
+ if not (len(args) == 2 and _is_param_expr(args[0])):
1636
+ args = list(args[:-1]), args[-1]
1637
+ return operator.getitem, (Callable, args)
1638
+
1639
+
1640
+ class _CallableType(_SpecialGenericAlias, _root=True):
1641
+ def copy_with(self, params):
1642
+ return _CallableGenericAlias(self.__origin__, params,
1643
+ name=self._name, inst=self._inst)
1644
+
1645
+ def __getitem__(self, params):
1646
+ if not isinstance(params, tuple) or len(params) != 2:
1647
+ raise TypeError("Callable must be used as "
1648
+ "Callable[[arg, ...], result].")
1649
+ args, result = params
1650
+ # This relaxes what args can be on purpose to allow things like
1651
+ # PEP 612 ParamSpec. Responsibility for whether a user is using
1652
+ # Callable[...] properly is deferred to static type checkers.
1653
+ if isinstance(args, list):
1654
+ params = (tuple(args), result)
1655
+ else:
1656
+ params = (args, result)
1657
+ return self.__getitem_inner__(params)
1658
+
1659
+ @_tp_cache
1660
+ def __getitem_inner__(self, params):
1661
+ args, result = params
1662
+ msg = "Callable[args, result]: result must be a type."
1663
+ result = _type_check(result, msg)
1664
+ if args is Ellipsis:
1665
+ return self.copy_with((_TypingEllipsis, result))
1666
+ if not isinstance(args, tuple):
1667
+ args = (args,)
1668
+ args = tuple(_type_convert(arg) for arg in args)
1669
+ params = args + (result,)
1670
+ return self.copy_with(params)
1671
+
1672
+
1673
+ class _TupleType(_SpecialGenericAlias, _root=True):
1674
+ @_tp_cache
1675
+ def __getitem__(self, params):
1676
+ if not isinstance(params, tuple):
1677
+ params = (params,)
1678
+ if len(params) >= 2 and params[-1] is ...:
1679
+ msg = "Tuple[t, ...]: t must be a type."
1680
+ params = tuple(_type_check(p, msg) for p in params[:-1])
1681
+ return self.copy_with((*params, _TypingEllipsis))
1682
+ msg = "Tuple[t0, t1, ...]: each t must be a type."
1683
+ params = tuple(_type_check(p, msg) for p in params)
1684
+ return self.copy_with(params)
1685
+
1686
+
1687
+ class _UnionGenericAliasMeta(type):
1688
+ def __instancecheck__(self, inst: object) -> bool:
1689
+ import warnings
1690
+ warnings._deprecated("_UnionGenericAlias", remove=(3, 17))
1691
+ return isinstance(inst, Union)
1692
+
1693
+ def __subclasscheck__(self, inst: type) -> bool:
1694
+ import warnings
1695
+ warnings._deprecated("_UnionGenericAlias", remove=(3, 17))
1696
+ return issubclass(inst, Union)
1697
+
1698
+ def __eq__(self, other):
1699
+ import warnings
1700
+ warnings._deprecated("_UnionGenericAlias", remove=(3, 17))
1701
+ if other is _UnionGenericAlias or other is Union:
1702
+ return True
1703
+ return NotImplemented
1704
+
1705
+ def __hash__(self):
1706
+ return hash(Union)
1707
+
1708
+
1709
+ class _UnionGenericAlias(metaclass=_UnionGenericAliasMeta):
1710
+ """Compatibility hack.
1711
+
1712
+ A class named _UnionGenericAlias used to be used to implement
1713
+ typing.Union. This class exists to serve as a shim to preserve
1714
+ the meaning of some code that used to use _UnionGenericAlias
1715
+ directly.
1716
+
1717
+ """
1718
+ def __new__(cls, self_cls, parameters, /, *, name=None):
1719
+ import warnings
1720
+ warnings._deprecated("_UnionGenericAlias", remove=(3, 17))
1721
+ return Union[parameters]
1722
+
1723
+
1724
+ def _value_and_type_iter(parameters):
1725
+ return ((p, type(p)) for p in parameters)
1726
+
1727
+
1728
+ class _LiteralGenericAlias(_GenericAlias, _root=True):
1729
+ def __eq__(self, other):
1730
+ if not isinstance(other, _LiteralGenericAlias):
1731
+ return NotImplemented
1732
+
1733
+ return set(_value_and_type_iter(self.__args__)) == set(_value_and_type_iter(other.__args__))
1734
+
1735
+ def __hash__(self):
1736
+ return hash(frozenset(_value_and_type_iter(self.__args__)))
1737
+
1738
+
1739
+ class _ConcatenateGenericAlias(_GenericAlias, _root=True):
1740
+ def copy_with(self, params):
1741
+ if isinstance(params[-1], (list, tuple)):
1742
+ return (*params[:-1], *params[-1])
1743
+ if isinstance(params[-1], _ConcatenateGenericAlias):
1744
+ params = (*params[:-1], *params[-1].__args__)
1745
+ return super().copy_with(params)
1746
+
1747
+
1748
+ @_SpecialForm
1749
+ def Unpack(self, parameters):
1750
+ """Type unpack operator.
1751
+
1752
+ The type unpack operator takes the child types from some container type,
1753
+ such as `tuple[int, str]` or a `TypeVarTuple`, and 'pulls them out'.
1754
+
1755
+ For example::
1756
+
1757
+ # For some generic class `Foo`:
1758
+ Foo[Unpack[tuple[int, str]]] # Equivalent to Foo[int, str]
1759
+
1760
+ Ts = TypeVarTuple('Ts')
1761
+ # Specifies that `Bar` is generic in an arbitrary number of types.
1762
+ # (Think of `Ts` as a tuple of an arbitrary number of individual
1763
+ # `TypeVar`s, which the `Unpack` is 'pulling out' directly into the
1764
+ # `Generic[]`.)
1765
+ class Bar(Generic[Unpack[Ts]]): ...
1766
+ Bar[int] # Valid
1767
+ Bar[int, str] # Also valid
1768
+
1769
+ From Python 3.11, this can also be done using the `*` operator::
1770
+
1771
+ Foo[*tuple[int, str]]
1772
+ class Bar(Generic[*Ts]): ...
1773
+
1774
+ And from Python 3.12, it can be done using built-in syntax for generics::
1775
+
1776
+ Foo[*tuple[int, str]]
1777
+ class Bar[*Ts]: ...
1778
+
1779
+ The operator can also be used along with a `TypedDict` to annotate
1780
+ `**kwargs` in a function signature::
1781
+
1782
+ class Movie(TypedDict):
1783
+ name: str
1784
+ year: int
1785
+
1786
+ # This function expects two keyword arguments - *name* of type `str` and
1787
+ # *year* of type `int`.
1788
+ def foo(**kwargs: Unpack[Movie]): ...
1789
+
1790
+ Note that there is only some runtime checking of this operator. Not
1791
+ everything the runtime allows is accepted by static type checkers.
1792
+
1793
+ For more information, see PEPs 646 and 692.
1794
+ """
1795
+ item = _type_check(parameters, f'{self} accepts only single type.')
1796
+ return _UnpackGenericAlias(origin=self, args=(item,))
1797
+
1798
+
1799
+ class _UnpackGenericAlias(_GenericAlias, _root=True):
1800
+ def __repr__(self):
1801
+ # `Unpack` only takes one argument, so __args__ should contain only
1802
+ # a single item.
1803
+ return f'typing.Unpack[{_type_repr(self.__args__[0])}]'
1804
+
1805
+ def __getitem__(self, args):
1806
+ if self.__typing_is_unpacked_typevartuple__:
1807
+ return args
1808
+ return super().__getitem__(args)
1809
+
1810
+ @property
1811
+ def __typing_unpacked_tuple_args__(self):
1812
+ assert self.__origin__ is Unpack
1813
+ assert len(self.__args__) == 1
1814
+ arg, = self.__args__
1815
+ if isinstance(arg, (_GenericAlias, types.GenericAlias)):
1816
+ if arg.__origin__ is not tuple:
1817
+ raise TypeError("Unpack[...] must be used with a tuple type")
1818
+ return arg.__args__
1819
+ return None
1820
+
1821
+ @property
1822
+ def __typing_is_unpacked_typevartuple__(self):
1823
+ assert self.__origin__ is Unpack
1824
+ assert len(self.__args__) == 1
1825
+ return isinstance(self.__args__[0], TypeVarTuple)
1826
+
1827
+
1828
+ class _TypingEllipsis:
1829
+ """Internal placeholder for ... (ellipsis)."""
1830
+
1831
+
1832
+ _TYPING_INTERNALS = frozenset({
1833
+ '__parameters__', '__orig_bases__', '__orig_class__',
1834
+ '_is_protocol', '_is_runtime_protocol', '__protocol_attrs__',
1835
+ '__non_callable_proto_members__', '__type_params__',
1836
+ })
1837
+
1838
+ _SPECIAL_NAMES = frozenset({
1839
+ '__abstractmethods__', '__annotations__', '__dict__', '__doc__',
1840
+ '__init__', '__module__', '__new__', '__slots__',
1841
+ '__subclasshook__', '__weakref__', '__class_getitem__',
1842
+ '__match_args__', '__static_attributes__', '__firstlineno__',
1843
+ '__annotate__', '__annotate_func__', '__annotations_cache__',
1844
+ })
1845
+
1846
+ # These special attributes will be not collected as protocol members.
1847
+ EXCLUDED_ATTRIBUTES = _TYPING_INTERNALS | _SPECIAL_NAMES | {'_MutableMapping__marker'}
1848
+
1849
+
1850
+ def _get_protocol_attrs(cls):
1851
+ """Collect protocol members from a protocol class objects.
1852
+
1853
+ This includes names actually defined in the class dictionary, as well
1854
+ as names that appear in annotations. Special names (above) are skipped.
1855
+ """
1856
+ attrs = set()
1857
+ for base in cls.__mro__[:-1]: # without object
1858
+ if base.__name__ in {'Protocol', 'Generic'}:
1859
+ continue
1860
+ try:
1861
+ annotations = base.__annotations__
1862
+ except Exception:
1863
+ # Only go through annotationlib to handle deferred annotations if we need to
1864
+ annotations = _lazy_annotationlib.get_annotations(
1865
+ base, format=_lazy_annotationlib.Format.FORWARDREF
1866
+ )
1867
+ for attr in (*base.__dict__, *annotations):
1868
+ if not attr.startswith('_abc_') and attr not in EXCLUDED_ATTRIBUTES:
1869
+ attrs.add(attr)
1870
+ return attrs
1871
+
1872
+
1873
+ def _no_init_or_replace_init(self, *args, **kwargs):
1874
+ cls = type(self)
1875
+
1876
+ if cls._is_protocol:
1877
+ raise TypeError('Protocols cannot be instantiated')
1878
+
1879
+ # Already using a custom `__init__`. No need to calculate correct
1880
+ # `__init__` to call. This can lead to RecursionError. See bpo-45121.
1881
+ if cls.__init__ is not _no_init_or_replace_init:
1882
+ return
1883
+
1884
+ # Initially, `__init__` of a protocol subclass is set to `_no_init_or_replace_init`.
1885
+ # The first instantiation of the subclass will call `_no_init_or_replace_init` which
1886
+ # searches for a proper new `__init__` in the MRO. The new `__init__`
1887
+ # replaces the subclass' old `__init__` (ie `_no_init_or_replace_init`). Subsequent
1888
+ # instantiation of the protocol subclass will thus use the new
1889
+ # `__init__` and no longer call `_no_init_or_replace_init`.
1890
+ for base in cls.__mro__:
1891
+ init = base.__dict__.get('__init__', _no_init_or_replace_init)
1892
+ if init is not _no_init_or_replace_init:
1893
+ cls.__init__ = init
1894
+ break
1895
+ else:
1896
+ # should not happen
1897
+ cls.__init__ = object.__init__
1898
+
1899
+ cls.__init__(self, *args, **kwargs)
1900
+
1901
+
1902
+ def _caller(depth=1, default='__main__'):
1903
+ try:
1904
+ return sys._getframemodulename(depth + 1) or default
1905
+ except AttributeError: # For platforms without _getframemodulename()
1906
+ pass
1907
+ try:
1908
+ return sys._getframe(depth + 1).f_globals.get('__name__', default)
1909
+ except (AttributeError, ValueError): # For platforms without _getframe()
1910
+ pass
1911
+ return None
1912
+
1913
+ def _allow_reckless_class_checks(depth=2):
1914
+ """Allow instance and class checks for special stdlib modules.
1915
+
1916
+ The abc and functools modules indiscriminately call isinstance() and
1917
+ issubclass() on the whole MRO of a user class, which may contain protocols.
1918
+ """
1919
+ return _caller(depth) in {'abc', 'functools', None}
1920
+
1921
+
1922
+ _PROTO_ALLOWLIST = {
1923
+ 'collections.abc': [
1924
+ 'Callable', 'Awaitable', 'Iterable', 'Iterator', 'AsyncIterable',
1925
+ 'AsyncIterator', 'Hashable', 'Sized', 'Container', 'Collection',
1926
+ 'Reversible', 'Buffer',
1927
+ ],
1928
+ 'contextlib': ['AbstractContextManager', 'AbstractAsyncContextManager'],
1929
+ 'io': ['Reader', 'Writer'],
1930
+ 'os': ['PathLike'],
1931
+ }
1932
+
1933
+
1934
+ @functools.cache
1935
+ def _lazy_load_getattr_static():
1936
+ # Import getattr_static lazily so as not to slow down the import of typing.py
1937
+ # Cache the result so we don't slow down _ProtocolMeta.__instancecheck__ unnecessarily
1938
+ from inspect import getattr_static
1939
+ return getattr_static
1940
+
1941
+
1942
+ _cleanups.append(_lazy_load_getattr_static.cache_clear)
1943
+
1944
+ def _pickle_psargs(psargs):
1945
+ return ParamSpecArgs, (psargs.__origin__,)
1946
+
1947
+ copyreg.pickle(ParamSpecArgs, _pickle_psargs)
1948
+
1949
+ def _pickle_pskwargs(pskwargs):
1950
+ return ParamSpecKwargs, (pskwargs.__origin__,)
1951
+
1952
+ copyreg.pickle(ParamSpecKwargs, _pickle_pskwargs)
1953
+
1954
+ del _pickle_psargs, _pickle_pskwargs
1955
+
1956
+
1957
+ # Preload these once, as globals, as a micro-optimisation.
1958
+ # This makes a significant difference to the time it takes
1959
+ # to do `isinstance()`/`issubclass()` checks
1960
+ # against runtime-checkable protocols with only one callable member.
1961
+ _abc_instancecheck = ABCMeta.__instancecheck__
1962
+ _abc_subclasscheck = ABCMeta.__subclasscheck__
1963
+
1964
+
1965
+ def _type_check_issubclass_arg_1(arg):
1966
+ """Raise TypeError if `arg` is not an instance of `type`
1967
+ in `issubclass(arg, <protocol>)`.
1968
+
1969
+ In most cases, this is verified by type.__subclasscheck__.
1970
+ Checking it again unnecessarily would slow down issubclass() checks,
1971
+ so, we don't perform this check unless we absolutely have to.
1972
+
1973
+ For various error paths, however,
1974
+ we want to ensure that *this* error message is shown to the user
1975
+ where relevant, rather than a typing.py-specific error message.
1976
+ """
1977
+ if not isinstance(arg, type):
1978
+ # Same error message as for issubclass(1, int).
1979
+ raise TypeError('issubclass() arg 1 must be a class')
1980
+
1981
+
1982
+ class _ProtocolMeta(ABCMeta):
1983
+ # This metaclass is somewhat unfortunate,
1984
+ # but is necessary for several reasons...
1985
+ def __new__(mcls, name, bases, namespace, /, **kwargs):
1986
+ if name == "Protocol" and bases == (Generic,):
1987
+ pass
1988
+ elif Protocol in bases:
1989
+ for base in bases:
1990
+ if not (
1991
+ base in {object, Generic}
1992
+ or base.__name__ in _PROTO_ALLOWLIST.get(base.__module__, [])
1993
+ or (
1994
+ issubclass(base, Generic)
1995
+ and getattr(base, "_is_protocol", False)
1996
+ )
1997
+ ):
1998
+ raise TypeError(
1999
+ f"Protocols can only inherit from other protocols, "
2000
+ f"got {base!r}"
2001
+ )
2002
+ return super().__new__(mcls, name, bases, namespace, **kwargs)
2003
+
2004
+ def __init__(cls, *args, **kwargs):
2005
+ super().__init__(*args, **kwargs)
2006
+ if getattr(cls, "_is_protocol", False):
2007
+ cls.__protocol_attrs__ = _get_protocol_attrs(cls)
2008
+
2009
+ def __subclasscheck__(cls, other):
2010
+ if cls is Protocol:
2011
+ return type.__subclasscheck__(cls, other)
2012
+ if (
2013
+ getattr(cls, '_is_protocol', False)
2014
+ and not _allow_reckless_class_checks()
2015
+ ):
2016
+ if not getattr(cls, '_is_runtime_protocol', False):
2017
+ _type_check_issubclass_arg_1(other)
2018
+ raise TypeError(
2019
+ "Instance and class checks can only be used with "
2020
+ "@runtime_checkable protocols"
2021
+ )
2022
+ if (
2023
+ # this attribute is set by @runtime_checkable:
2024
+ cls.__non_callable_proto_members__
2025
+ and cls.__dict__.get("__subclasshook__") is _proto_hook
2026
+ ):
2027
+ _type_check_issubclass_arg_1(other)
2028
+ non_method_attrs = sorted(cls.__non_callable_proto_members__)
2029
+ raise TypeError(
2030
+ "Protocols with non-method members don't support issubclass()."
2031
+ f" Non-method members: {str(non_method_attrs)[1:-1]}."
2032
+ )
2033
+ return _abc_subclasscheck(cls, other)
2034
+
2035
+ def __instancecheck__(cls, instance):
2036
+ # We need this method for situations where attributes are
2037
+ # assigned in __init__.
2038
+ if cls is Protocol:
2039
+ return type.__instancecheck__(cls, instance)
2040
+ if not getattr(cls, "_is_protocol", False):
2041
+ # i.e., it's a concrete subclass of a protocol
2042
+ return _abc_instancecheck(cls, instance)
2043
+
2044
+ if (
2045
+ not getattr(cls, '_is_runtime_protocol', False) and
2046
+ not _allow_reckless_class_checks()
2047
+ ):
2048
+ raise TypeError("Instance and class checks can only be used with"
2049
+ " @runtime_checkable protocols")
2050
+
2051
+ if _abc_instancecheck(cls, instance):
2052
+ return True
2053
+
2054
+ getattr_static = _lazy_load_getattr_static()
2055
+ for attr in cls.__protocol_attrs__:
2056
+ try:
2057
+ val = getattr_static(instance, attr)
2058
+ except AttributeError:
2059
+ break
2060
+ # this attribute is set by @runtime_checkable:
2061
+ if val is None and attr not in cls.__non_callable_proto_members__:
2062
+ break
2063
+ else:
2064
+ return True
2065
+
2066
+ return False
2067
+
2068
+
2069
+ @classmethod
2070
+ def _proto_hook(cls, other):
2071
+ if not cls.__dict__.get('_is_protocol', False):
2072
+ return NotImplemented
2073
+
2074
+ for attr in cls.__protocol_attrs__:
2075
+ for base in other.__mro__:
2076
+ # Check if the members appears in the class dictionary...
2077
+ if attr in base.__dict__:
2078
+ if base.__dict__[attr] is None:
2079
+ return NotImplemented
2080
+ break
2081
+
2082
+ # ...or in annotations, if it is a sub-protocol.
2083
+ if issubclass(other, Generic) and getattr(other, "_is_protocol", False):
2084
+ # We avoid the slower path through annotationlib here because in most
2085
+ # cases it should be unnecessary.
2086
+ try:
2087
+ annos = base.__annotations__
2088
+ except Exception:
2089
+ annos = _lazy_annotationlib.get_annotations(
2090
+ base, format=_lazy_annotationlib.Format.FORWARDREF
2091
+ )
2092
+ if attr in annos:
2093
+ break
2094
+ else:
2095
+ return NotImplemented
2096
+ return True
2097
+
2098
+
2099
+ class Protocol(Generic, metaclass=_ProtocolMeta):
2100
+ """Base class for protocol classes.
2101
+
2102
+ Protocol classes are defined as::
2103
+
2104
+ class Proto(Protocol):
2105
+ def meth(self) -> int:
2106
+ ...
2107
+
2108
+ Such classes are primarily used with static type checkers that recognize
2109
+ structural subtyping (static duck-typing).
2110
+
2111
+ For example::
2112
+
2113
+ class C:
2114
+ def meth(self) -> int:
2115
+ return 0
2116
+
2117
+ def func(x: Proto) -> int:
2118
+ return x.meth()
2119
+
2120
+ func(C()) # Passes static type check
2121
+
2122
+ See PEP 544 for details. Protocol classes decorated with
2123
+ @typing.runtime_checkable act as simple-minded runtime protocols that check
2124
+ only the presence of given attributes, ignoring their type signatures.
2125
+ Protocol classes can be generic, they are defined as::
2126
+
2127
+ class GenProto[T](Protocol):
2128
+ def meth(self) -> T:
2129
+ ...
2130
+ """
2131
+
2132
+ __slots__ = ()
2133
+ _is_protocol = True
2134
+ _is_runtime_protocol = False
2135
+
2136
+ def __init_subclass__(cls, *args, **kwargs):
2137
+ super().__init_subclass__(*args, **kwargs)
2138
+
2139
+ # Determine if this is a protocol or a concrete subclass.
2140
+ if not cls.__dict__.get('_is_protocol', False):
2141
+ cls._is_protocol = any(b is Protocol for b in cls.__bases__)
2142
+
2143
+ # Set (or override) the protocol subclass hook.
2144
+ if '__subclasshook__' not in cls.__dict__:
2145
+ cls.__subclasshook__ = _proto_hook
2146
+
2147
+ # Prohibit instantiation for protocol classes
2148
+ if cls._is_protocol and cls.__init__ is Protocol.__init__:
2149
+ cls.__init__ = _no_init_or_replace_init
2150
+
2151
+
2152
+ class _AnnotatedAlias(_NotIterable, _GenericAlias, _root=True):
2153
+ """Runtime representation of an annotated type.
2154
+
2155
+ At its core 'Annotated[t, dec1, dec2, ...]' is an alias for the type 't'
2156
+ with extra metadata. The alias behaves like a normal typing alias.
2157
+ Instantiating is the same as instantiating the underlying type; binding
2158
+ it to types is also the same.
2159
+
2160
+ The metadata itself is stored in a '__metadata__' attribute as a tuple.
2161
+ """
2162
+
2163
+ def __init__(self, origin, metadata):
2164
+ if isinstance(origin, _AnnotatedAlias):
2165
+ metadata = origin.__metadata__ + metadata
2166
+ origin = origin.__origin__
2167
+ super().__init__(origin, origin, name='Annotated')
2168
+ self.__metadata__ = metadata
2169
+
2170
+ def copy_with(self, params):
2171
+ assert len(params) == 1
2172
+ new_type = params[0]
2173
+ return _AnnotatedAlias(new_type, self.__metadata__)
2174
+
2175
+ def __repr__(self):
2176
+ return "typing.Annotated[{}, {}]".format(
2177
+ _type_repr(self.__origin__),
2178
+ ", ".join(repr(a) for a in self.__metadata__)
2179
+ )
2180
+
2181
+ def __reduce__(self):
2182
+ return operator.getitem, (
2183
+ Annotated, (self.__origin__,) + self.__metadata__
2184
+ )
2185
+
2186
+ def __eq__(self, other):
2187
+ if not isinstance(other, _AnnotatedAlias):
2188
+ return NotImplemented
2189
+ return (self.__origin__ == other.__origin__
2190
+ and self.__metadata__ == other.__metadata__)
2191
+
2192
+ def __hash__(self):
2193
+ return hash((self.__origin__, self.__metadata__))
2194
+
2195
+ def __getattr__(self, attr):
2196
+ if attr in {'__name__', '__qualname__'}:
2197
+ return 'Annotated'
2198
+ return super().__getattr__(attr)
2199
+
2200
+ def __mro_entries__(self, bases):
2201
+ return (self.__origin__,)
2202
+
2203
+
2204
+ @_TypedCacheSpecialForm
2205
+ @_tp_cache(typed=True)
2206
+ def Annotated(self, *params):
2207
+ """Add context-specific metadata to a type.
2208
+
2209
+ Example: Annotated[int, runtime_check.Unsigned] indicates to the
2210
+ hypothetical runtime_check module that this type is an unsigned int.
2211
+ Every other consumer of this type can ignore this metadata and treat
2212
+ this type as int.
2213
+
2214
+ The first argument to Annotated must be a valid type.
2215
+
2216
+ Details:
2217
+
2218
+ - It's an error to call `Annotated` with less than two arguments.
2219
+ - Access the metadata via the ``__metadata__`` attribute::
2220
+
2221
+ assert Annotated[int, '$'].__metadata__ == ('$',)
2222
+
2223
+ - Nested Annotated types are flattened::
2224
+
2225
+ assert Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]
2226
+
2227
+ - Instantiating an annotated type is equivalent to instantiating the
2228
+ underlying type::
2229
+
2230
+ assert Annotated[C, Ann1](5) == C(5)
2231
+
2232
+ - Annotated can be used as a generic type alias::
2233
+
2234
+ type Optimized[T] = Annotated[T, runtime.Optimize()]
2235
+ # type checker will treat Optimized[int]
2236
+ # as equivalent to Annotated[int, runtime.Optimize()]
2237
+
2238
+ type OptimizedList[T] = Annotated[list[T], runtime.Optimize()]
2239
+ # type checker will treat OptimizedList[int]
2240
+ # as equivalent to Annotated[list[int], runtime.Optimize()]
2241
+
2242
+ - Annotated cannot be used with an unpacked TypeVarTuple::
2243
+
2244
+ type Variadic[*Ts] = Annotated[*Ts, Ann1] # NOT valid
2245
+
2246
+ This would be equivalent to::
2247
+
2248
+ Annotated[T1, T2, T3, ..., Ann1]
2249
+
2250
+ where T1, T2 etc. are TypeVars, which would be invalid, because
2251
+ only one type should be passed to Annotated.
2252
+ """
2253
+ if len(params) < 2:
2254
+ raise TypeError("Annotated[...] should be used "
2255
+ "with at least two arguments (a type and an "
2256
+ "annotation).")
2257
+ if _is_unpacked_typevartuple(params[0]):
2258
+ raise TypeError("Annotated[...] should not be used with an "
2259
+ "unpacked TypeVarTuple")
2260
+ msg = "Annotated[t, ...]: t must be a type."
2261
+ origin = _type_check(params[0], msg, allow_special_forms=True)
2262
+ metadata = tuple(params[1:])
2263
+ return _AnnotatedAlias(origin, metadata)
2264
+
2265
+
2266
+ def runtime_checkable(cls):
2267
+ """Mark a protocol class as a runtime protocol.
2268
+
2269
+ Such protocol can be used with isinstance() and issubclass().
2270
+ Raise TypeError if applied to a non-protocol class.
2271
+ This allows a simple-minded structural check very similar to
2272
+ one-trick ponies in collections.abc such as Iterable.
2273
+
2274
+ For example::
2275
+
2276
+ @runtime_checkable
2277
+ class Closable(Protocol):
2278
+ def close(self): ...
2279
+
2280
+ assert isinstance(open('/some/file'), Closable)
2281
+
2282
+ Warning: this will check only the presence of the required methods,
2283
+ not their type signatures!
2284
+ """
2285
+ if not issubclass(cls, Generic) or not getattr(cls, '_is_protocol', False):
2286
+ raise TypeError('@runtime_checkable can be only applied to protocol classes,'
2287
+ ' got %r' % cls)
2288
+ cls._is_runtime_protocol = True
2289
+ # PEP 544 prohibits using issubclass()
2290
+ # with protocols that have non-method members.
2291
+ # See gh-113320 for why we compute this attribute here,
2292
+ # rather than in `_ProtocolMeta.__init__`
2293
+ cls.__non_callable_proto_members__ = set()
2294
+ for attr in cls.__protocol_attrs__:
2295
+ try:
2296
+ is_callable = callable(getattr(cls, attr, None))
2297
+ except Exception as e:
2298
+ raise TypeError(
2299
+ f"Failed to determine whether protocol member {attr!r} "
2300
+ "is a method member"
2301
+ ) from e
2302
+ else:
2303
+ if not is_callable:
2304
+ cls.__non_callable_proto_members__.add(attr)
2305
+ return cls
2306
+
2307
+
2308
+ def cast(typ, val):
2309
+ """Cast a value to a type.
2310
+
2311
+ This returns the value unchanged. To the type checker this
2312
+ signals that the return value has the designated type, but at
2313
+ runtime we intentionally don't check anything (we want this
2314
+ to be as fast as possible).
2315
+ """
2316
+ return val
2317
+
2318
+
2319
+ def assert_type(val, typ, /):
2320
+ """Ask a static type checker to confirm that the value is of the given type.
2321
+
2322
+ At runtime this does nothing: it returns the first argument unchanged with no
2323
+ checks or side effects, no matter the actual type of the argument.
2324
+
2325
+ When a static type checker encounters a call to assert_type(), it
2326
+ emits an error if the value is not of the specified type::
2327
+
2328
+ def greet(name: str) -> None:
2329
+ assert_type(name, str) # OK
2330
+ assert_type(name, int) # type checker error
2331
+ """
2332
+ return val
2333
+
2334
+
2335
+ def get_type_hints(obj, globalns=None, localns=None, include_extras=False,
2336
+ *, format=None):
2337
+ """Return type hints for an object.
2338
+
2339
+ This is often the same as annotationlib.get_annotations(obj) or obj.__annotations__,
2340
+ but it handles forward references encoded as string literals and recursively replaces all
2341
+ 'Annotated[T, ...]' with 'T' (unless 'include_extras=True').
2342
+
2343
+ The argument may be a module, class, method, or function. The annotations
2344
+ are returned as a dictionary. For classes, annotations include also
2345
+ inherited members.
2346
+
2347
+ TypeError is raised if the argument is not of a type that can contain
2348
+ annotations, and an empty dictionary is returned if no annotations are
2349
+ present.
2350
+
2351
+ BEWARE -- the behavior of globalns and localns is counterintuitive
2352
+ (unless you are familiar with how eval() and exec() work). The
2353
+ search order is locals first, then globals.
2354
+
2355
+ - If no dict arguments are passed, an attempt is made to use the
2356
+ globals from obj (or the respective module's globals for classes),
2357
+ and these are also used as the locals. If the object does not appear
2358
+ to have globals, an empty dictionary is used. For classes, the search
2359
+ order is globals first then locals.
2360
+
2361
+ - If one dict argument is passed, it is used for both globals and
2362
+ locals.
2363
+
2364
+ - If two dict arguments are passed, they specify globals and
2365
+ locals, respectively.
2366
+ """
2367
+ if getattr(obj, '__no_type_check__', None):
2368
+ return {}
2369
+ Format = _lazy_annotationlib.Format
2370
+ if format is None:
2371
+ format = Format.VALUE
2372
+ # Classes require a special treatment.
2373
+ if isinstance(obj, type):
2374
+ hints = {}
2375
+ for base in reversed(obj.__mro__):
2376
+ ann = _lazy_annotationlib.get_annotations(base, format=format)
2377
+ if format == Format.STRING:
2378
+ hints.update(ann)
2379
+ continue
2380
+ if globalns is None:
2381
+ base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {})
2382
+ else:
2383
+ base_globals = globalns
2384
+ base_locals = dict(vars(base)) if localns is None else localns
2385
+ if localns is None and globalns is None:
2386
+ # This is surprising, but required. Before Python 3.10,
2387
+ # get_type_hints only evaluated the globalns of
2388
+ # a class. To maintain backwards compatibility, we reverse
2389
+ # the globalns and localns order so that eval() looks into
2390
+ # *base_globals* first rather than *base_locals*.
2391
+ # This only affects ForwardRefs.
2392
+ base_globals, base_locals = base_locals, base_globals
2393
+ type_params = base.__type_params__
2394
+ base_globals, base_locals = _add_type_params_to_scope(
2395
+ type_params, base_globals, base_locals, True)
2396
+ for name, value in ann.items():
2397
+ if isinstance(value, str):
2398
+ value = _make_forward_ref(value, is_argument=False, is_class=True)
2399
+ value = _eval_type(value, base_globals, base_locals, (),
2400
+ format=format, owner=obj, prefer_fwd_module=True)
2401
+ if value is None:
2402
+ value = type(None)
2403
+ hints[name] = value
2404
+ if include_extras or format == Format.STRING:
2405
+ return hints
2406
+ else:
2407
+ return {k: _strip_annotations(t) for k, t in hints.items()}
2408
+
2409
+ hints = _lazy_annotationlib.get_annotations(obj, format=format)
2410
+ if (
2411
+ not hints
2412
+ and not isinstance(obj, types.ModuleType)
2413
+ and not callable(obj)
2414
+ and not hasattr(obj, '__annotations__')
2415
+ and not hasattr(obj, '__annotate__')
2416
+ ):
2417
+ raise TypeError(f"{obj!r} is not a module, class, or callable.")
2418
+ if format == Format.STRING:
2419
+ return hints
2420
+
2421
+ if globalns is None:
2422
+ if isinstance(obj, types.ModuleType):
2423
+ globalns = obj.__dict__
2424
+ else:
2425
+ nsobj = obj
2426
+ # Find globalns for the unwrapped object.
2427
+ seen = {id(nsobj)}
2428
+ while hasattr(nsobj, '__wrapped__'):
2429
+ nsobj = nsobj.__wrapped__
2430
+ if id(nsobj) in seen:
2431
+ raise ValueError(f'wrapper loop when unwrapping {obj!r}')
2432
+ seen.add(id(nsobj))
2433
+ globalns = getattr(nsobj, '__globals__', {})
2434
+ if localns is None:
2435
+ localns = globalns
2436
+ elif localns is None:
2437
+ localns = globalns
2438
+ type_params = getattr(obj, "__type_params__", ())
2439
+ globalns, localns = _add_type_params_to_scope(type_params, globalns, localns, False)
2440
+ for name, value in hints.items():
2441
+ if isinstance(value, str):
2442
+ # class-level forward refs were handled above, this must be either
2443
+ # a module-level annotation or a function argument annotation
2444
+ value = _make_forward_ref(
2445
+ value,
2446
+ is_argument=not isinstance(obj, types.ModuleType),
2447
+ is_class=False,
2448
+ )
2449
+ value = _eval_type(value, globalns, localns, (), format=format, owner=obj, prefer_fwd_module=True)
2450
+ if value is None:
2451
+ value = type(None)
2452
+ hints[name] = value
2453
+ return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()}
2454
+
2455
+
2456
+ # Add type parameters to the globals and locals scope. This is needed for
2457
+ # compatibility.
2458
+ def _add_type_params_to_scope(type_params, globalns, localns, is_class):
2459
+ if not type_params:
2460
+ return globalns, localns
2461
+ globalns = dict(globalns)
2462
+ localns = dict(localns)
2463
+ for param in type_params:
2464
+ if not is_class or param.__name__ not in globalns:
2465
+ globalns[param.__name__] = param
2466
+ localns.pop(param.__name__, None)
2467
+ return globalns, localns
2468
+
2469
+
2470
+ def _strip_annotations(t):
2471
+ """Strip the annotations from a given type."""
2472
+ if isinstance(t, _AnnotatedAlias):
2473
+ return _strip_annotations(t.__origin__)
2474
+ if hasattr(t, "__origin__") and t.__origin__ in (Required, NotRequired, ReadOnly):
2475
+ return _strip_annotations(t.__args__[0])
2476
+ if isinstance(t, _GenericAlias):
2477
+ stripped_args = tuple(_strip_annotations(a) for a in t.__args__)
2478
+ if stripped_args == t.__args__:
2479
+ return t
2480
+ return t.copy_with(stripped_args)
2481
+ if isinstance(t, GenericAlias):
2482
+ stripped_args = tuple(_strip_annotations(a) for a in t.__args__)
2483
+ if stripped_args == t.__args__:
2484
+ return t
2485
+ return GenericAlias(t.__origin__, stripped_args)
2486
+ if isinstance(t, Union):
2487
+ stripped_args = tuple(_strip_annotations(a) for a in t.__args__)
2488
+ if stripped_args == t.__args__:
2489
+ return t
2490
+ return functools.reduce(operator.or_, stripped_args)
2491
+
2492
+ return t
2493
+
2494
+
2495
+ def get_origin(tp):
2496
+ """Get the unsubscripted version of a type.
2497
+
2498
+ This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar,
2499
+ Annotated, and others. Return None for unsupported types.
2500
+
2501
+ Examples::
2502
+
2503
+ >>> P = ParamSpec('P')
2504
+ >>> assert get_origin(Literal[42]) is Literal
2505
+ >>> assert get_origin(int) is None
2506
+ >>> assert get_origin(ClassVar[int]) is ClassVar
2507
+ >>> assert get_origin(Generic) is Generic
2508
+ >>> assert get_origin(Generic[T]) is Generic
2509
+ >>> assert get_origin(Union[T, int]) is Union
2510
+ >>> assert get_origin(List[Tuple[T, T]][int]) is list
2511
+ >>> assert get_origin(P.args) is P
2512
+ """
2513
+ if isinstance(tp, _AnnotatedAlias):
2514
+ return Annotated
2515
+ if isinstance(tp, (_BaseGenericAlias, GenericAlias,
2516
+ ParamSpecArgs, ParamSpecKwargs)):
2517
+ return tp.__origin__
2518
+ if tp is Generic:
2519
+ return Generic
2520
+ if isinstance(tp, Union):
2521
+ return Union
2522
+ return None
2523
+
2524
+
2525
+ def get_args(tp):
2526
+ """Get type arguments with all substitutions performed.
2527
+
2528
+ For unions, basic simplifications used by Union constructor are performed.
2529
+
2530
+ Examples::
2531
+
2532
+ >>> T = TypeVar('T')
2533
+ >>> assert get_args(Dict[str, int]) == (str, int)
2534
+ >>> assert get_args(int) == ()
2535
+ >>> assert get_args(Union[int, Union[T, int], str][int]) == (int, str)
2536
+ >>> assert get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
2537
+ >>> assert get_args(Callable[[], T][int]) == ([], int)
2538
+ """
2539
+ if isinstance(tp, _AnnotatedAlias):
2540
+ return (tp.__origin__,) + tp.__metadata__
2541
+ if isinstance(tp, (_GenericAlias, GenericAlias)):
2542
+ res = tp.__args__
2543
+ if _should_unflatten_callable_args(tp, res):
2544
+ res = (list(res[:-1]), res[-1])
2545
+ return res
2546
+ if isinstance(tp, Union):
2547
+ return tp.__args__
2548
+ return ()
2549
+
2550
+
2551
+ def is_typeddict(tp):
2552
+ """Check if an object is a TypedDict class.
2553
+
2554
+ For example::
2555
+
2556
+ >>> from typing import TypedDict
2557
+ >>> class Film(TypedDict):
2558
+ ... title: str
2559
+ ... year: int
2560
+ ...
2561
+ >>> is_typeddict(Film)
2562
+ True
2563
+ >>> is_typeddict(dict)
2564
+ False
2565
+ """
2566
+ return isinstance(tp, _TypedDictMeta)
2567
+
2568
+
2569
+ _ASSERT_NEVER_REPR_MAX_LENGTH = 100
2570
+
2571
+
2572
+ def assert_never(arg: Never, /) -> Never:
2573
+ """Statically assert that a line of code is unreachable.
2574
+
2575
+ Example::
2576
+
2577
+ def int_or_str(arg: int | str) -> None:
2578
+ match arg:
2579
+ case int():
2580
+ print("It's an int")
2581
+ case str():
2582
+ print("It's a str")
2583
+ case _:
2584
+ assert_never(arg)
2585
+
2586
+ If a type checker finds that a call to assert_never() is
2587
+ reachable, it will emit an error.
2588
+
2589
+ At runtime, this throws an exception when called.
2590
+ """
2591
+ value = repr(arg)
2592
+ if len(value) > _ASSERT_NEVER_REPR_MAX_LENGTH:
2593
+ value = value[:_ASSERT_NEVER_REPR_MAX_LENGTH] + '...'
2594
+ raise AssertionError(f"Expected code to be unreachable, but got: {value}")
2595
+
2596
+
2597
+ def no_type_check(arg):
2598
+ """Decorator to indicate that annotations are not type hints.
2599
+
2600
+ The argument must be a class or function; if it is a class, it
2601
+ applies recursively to all methods and classes defined in that class
2602
+ (but not to methods defined in its superclasses or subclasses).
2603
+
2604
+ This mutates the function(s) or class(es) in place.
2605
+ """
2606
+ if isinstance(arg, type):
2607
+ for key in dir(arg):
2608
+ obj = getattr(arg, key)
2609
+ if (
2610
+ not hasattr(obj, '__qualname__')
2611
+ or obj.__qualname__ != f'{arg.__qualname__}.{obj.__name__}'
2612
+ or getattr(obj, '__module__', None) != arg.__module__
2613
+ ):
2614
+ # We only modify objects that are defined in this type directly.
2615
+ # If classes / methods are nested in multiple layers,
2616
+ # we will modify them when processing their direct holders.
2617
+ continue
2618
+ # Instance, class, and static methods:
2619
+ if isinstance(obj, types.FunctionType):
2620
+ obj.__no_type_check__ = True
2621
+ if isinstance(obj, types.MethodType):
2622
+ obj.__func__.__no_type_check__ = True
2623
+ # Nested types:
2624
+ if isinstance(obj, type):
2625
+ no_type_check(obj)
2626
+ try:
2627
+ arg.__no_type_check__ = True
2628
+ except TypeError: # built-in classes
2629
+ pass
2630
+ return arg
2631
+
2632
+
2633
+ def no_type_check_decorator(decorator):
2634
+ """Decorator to give another decorator the @no_type_check effect.
2635
+
2636
+ This wraps the decorator with something that wraps the decorated
2637
+ function in @no_type_check.
2638
+ """
2639
+ import warnings
2640
+ warnings._deprecated("typing.no_type_check_decorator", remove=(3, 15))
2641
+ @functools.wraps(decorator)
2642
+ def wrapped_decorator(*args, **kwds):
2643
+ func = decorator(*args, **kwds)
2644
+ func = no_type_check(func)
2645
+ return func
2646
+
2647
+ return wrapped_decorator
2648
+
2649
+
2650
+ def _overload_dummy(*args, **kwds):
2651
+ """Helper for @overload to raise when called."""
2652
+ raise NotImplementedError(
2653
+ "You should not call an overloaded function. "
2654
+ "A series of @overload-decorated functions "
2655
+ "outside a stub module should always be followed "
2656
+ "by an implementation that is not @overload-ed.")
2657
+
2658
+
2659
+ # {module: {qualname: {firstlineno: func}}}
2660
+ _overload_registry = defaultdict(functools.partial(defaultdict, dict))
2661
+
2662
+
2663
+ def overload(func):
2664
+ """Decorator for overloaded functions/methods.
2665
+
2666
+ In a non-stub file, place two or more stub definitions for the same
2667
+ function in a row, each decorated with @overload, followed
2668
+ by an implementation. The implementation should *not*
2669
+ be decorated with @overload::
2670
+
2671
+ @overload
2672
+ def utf8(value: None) -> None: ...
2673
+ @overload
2674
+ def utf8(value: bytes) -> bytes: ...
2675
+ @overload
2676
+ def utf8(value: str) -> bytes: ...
2677
+ def utf8(value):
2678
+ ... # implementation goes here
2679
+
2680
+ In a stub file or in an abstract method (for example, in a Protocol definition),
2681
+ the implementation may be omitted::
2682
+
2683
+ @overload
2684
+ def utf8(value: None) -> None: ...
2685
+ @overload
2686
+ def utf8(value: bytes) -> bytes: ...
2687
+ @overload
2688
+ def utf8(value: str) -> bytes: ...
2689
+
2690
+ The overloads for a function can be retrieved at runtime using the
2691
+ get_overloads() function.
2692
+ """
2693
+ # classmethod and staticmethod
2694
+ f = getattr(func, "__func__", func)
2695
+ try:
2696
+ _overload_registry[f.__module__][f.__qualname__][f.__code__.co_firstlineno] = func
2697
+ except AttributeError:
2698
+ # Not a normal function; ignore.
2699
+ pass
2700
+ return _overload_dummy
2701
+
2702
+
2703
+ def get_overloads(func):
2704
+ """Return all defined overloads for *func* as a sequence."""
2705
+ # classmethod and staticmethod
2706
+ f = getattr(func, "__func__", func)
2707
+ if f.__module__ not in _overload_registry:
2708
+ return []
2709
+ mod_dict = _overload_registry[f.__module__]
2710
+ if f.__qualname__ not in mod_dict:
2711
+ return []
2712
+ return list(mod_dict[f.__qualname__].values())
2713
+
2714
+
2715
+ def clear_overloads():
2716
+ """Clear all overloads in the registry."""
2717
+ _overload_registry.clear()
2718
+
2719
+
2720
+ def final(f):
2721
+ """Decorator to indicate final methods and final classes.
2722
+
2723
+ Use this decorator to indicate to type checkers that the decorated
2724
+ method cannot be overridden, and the decorated class cannot be subclassed.
2725
+
2726
+ For example::
2727
+
2728
+ class Base:
2729
+ @final
2730
+ def done(self) -> None:
2731
+ ...
2732
+ class Sub(Base):
2733
+ def done(self) -> None: # Error reported by type checker
2734
+ ...
2735
+
2736
+ @final
2737
+ class Leaf:
2738
+ ...
2739
+ class Other(Leaf): # Error reported by type checker
2740
+ ...
2741
+
2742
+ There is no runtime checking of these properties. The decorator
2743
+ attempts to set the ``__final__`` attribute to ``True`` on the decorated
2744
+ object to allow runtime introspection.
2745
+ """
2746
+ try:
2747
+ f.__final__ = True
2748
+ except (AttributeError, TypeError):
2749
+ # Skip the attribute silently if it is not writable.
2750
+ # AttributeError happens if the object has __slots__ or a
2751
+ # read-only property, TypeError if it's a builtin class.
2752
+ pass
2753
+ return f
2754
+
2755
+
2756
+ # Some unconstrained type variables. These were initially used by the container types.
2757
+ # They were never meant for export and are now unused, but we keep them around to
2758
+ # avoid breaking compatibility with users who import them.
2759
+ T = TypeVar('T') # Any type.
2760
+ KT = TypeVar('KT') # Key type.
2761
+ VT = TypeVar('VT') # Value type.
2762
+ T_co = TypeVar('T_co', covariant=True) # Any type covariant containers.
2763
+ V_co = TypeVar('V_co', covariant=True) # Any type covariant containers.
2764
+ VT_co = TypeVar('VT_co', covariant=True) # Value type covariant containers.
2765
+ T_contra = TypeVar('T_contra', contravariant=True) # Ditto contravariant.
2766
+ # Internal type bound to class object types.
2767
+ CT_co = TypeVar('CT_co', covariant=True, bound=type)
2768
+
2769
+
2770
+ # A useful type variable with constraints. This represents string types.
2771
+ # (This one *is* for export!)
2772
+ AnyStr = TypeVar('AnyStr', bytes, str)
2773
+
2774
+
2775
+ # Various ABCs mimicking those in collections.abc.
2776
+ _alias = _SpecialGenericAlias
2777
+
2778
+ Hashable = _alias(collections.abc.Hashable, 0) # Not generic.
2779
+ Awaitable = _alias(collections.abc.Awaitable, 1)
2780
+ Coroutine = _alias(collections.abc.Coroutine, 3)
2781
+ AsyncIterable = _alias(collections.abc.AsyncIterable, 1)
2782
+ AsyncIterator = _alias(collections.abc.AsyncIterator, 1)
2783
+ Iterable = _alias(collections.abc.Iterable, 1)
2784
+ Iterator = _alias(collections.abc.Iterator, 1)
2785
+ Reversible = _alias(collections.abc.Reversible, 1)
2786
+ Sized = _alias(collections.abc.Sized, 0) # Not generic.
2787
+ Container = _alias(collections.abc.Container, 1)
2788
+ Collection = _alias(collections.abc.Collection, 1)
2789
+ Callable = _CallableType(collections.abc.Callable, 2)
2790
+ Callable.__doc__ = \
2791
+ """Deprecated alias to collections.abc.Callable.
2792
+
2793
+ Callable[[int], str] signifies a function that takes a single
2794
+ parameter of type int and returns a str.
2795
+
2796
+ The subscription syntax must always be used with exactly two
2797
+ values: the argument list and the return type.
2798
+ The argument list must be a list of types, a ParamSpec,
2799
+ Concatenate or ellipsis. The return type must be a single type.
2800
+
2801
+ There is no syntax to indicate optional or keyword arguments;
2802
+ such function types are rarely used as callback types.
2803
+ """
2804
+ AbstractSet = _alias(collections.abc.Set, 1, name='AbstractSet')
2805
+ MutableSet = _alias(collections.abc.MutableSet, 1)
2806
+ # NOTE: Mapping is only covariant in the value type.
2807
+ Mapping = _alias(collections.abc.Mapping, 2)
2808
+ MutableMapping = _alias(collections.abc.MutableMapping, 2)
2809
+ Sequence = _alias(collections.abc.Sequence, 1)
2810
+ MutableSequence = _alias(collections.abc.MutableSequence, 1)
2811
+ ByteString = _DeprecatedGenericAlias(
2812
+ collections.abc.ByteString, 0, removal_version=(3, 17) # Not generic.
2813
+ )
2814
+ # Tuple accepts variable number of parameters.
2815
+ Tuple = _TupleType(tuple, -1, inst=False, name='Tuple')
2816
+ Tuple.__doc__ = \
2817
+ """Deprecated alias to builtins.tuple.
2818
+
2819
+ Tuple[X, Y] is the cross-product type of X and Y.
2820
+
2821
+ Example: Tuple[T1, T2] is a tuple of two elements corresponding
2822
+ to type variables T1 and T2. Tuple[int, float, str] is a tuple
2823
+ of an int, a float and a string.
2824
+
2825
+ To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
2826
+ """
2827
+ List = _alias(list, 1, inst=False, name='List')
2828
+ Deque = _alias(collections.deque, 1, name='Deque')
2829
+ Set = _alias(set, 1, inst=False, name='Set')
2830
+ FrozenSet = _alias(frozenset, 1, inst=False, name='FrozenSet')
2831
+ MappingView = _alias(collections.abc.MappingView, 1)
2832
+ KeysView = _alias(collections.abc.KeysView, 1)
2833
+ ItemsView = _alias(collections.abc.ItemsView, 2)
2834
+ ValuesView = _alias(collections.abc.ValuesView, 1)
2835
+ Dict = _alias(dict, 2, inst=False, name='Dict')
2836
+ DefaultDict = _alias(collections.defaultdict, 2, name='DefaultDict')
2837
+ OrderedDict = _alias(collections.OrderedDict, 2)
2838
+ Counter = _alias(collections.Counter, 1)
2839
+ ChainMap = _alias(collections.ChainMap, 2)
2840
+ Generator = _alias(collections.abc.Generator, 3, defaults=(types.NoneType, types.NoneType))
2841
+ AsyncGenerator = _alias(collections.abc.AsyncGenerator, 2, defaults=(types.NoneType,))
2842
+ Type = _alias(type, 1, inst=False, name='Type')
2843
+ Type.__doc__ = \
2844
+ """Deprecated alias to builtins.type.
2845
+
2846
+ builtins.type or typing.Type can be used to annotate class objects.
2847
+ For example, suppose we have the following classes::
2848
+
2849
+ class User: ... # Abstract base for User classes
2850
+ class BasicUser(User): ...
2851
+ class ProUser(User): ...
2852
+ class TeamUser(User): ...
2853
+
2854
+ And a function that takes a class argument that's a subclass of
2855
+ User and returns an instance of the corresponding class::
2856
+
2857
+ def new_user[U](user_class: type[U]) -> U:
2858
+ user = user_class()
2859
+ # (Here we could write the user object to a database)
2860
+ return user
2861
+
2862
+ joe = new_user(BasicUser)
2863
+
2864
+ At this point the type checker knows that joe has type BasicUser.
2865
+ """
2866
+
2867
+
2868
+ @runtime_checkable
2869
+ class SupportsInt(Protocol):
2870
+ """A protocol with one abstract method __int__."""
2871
+
2872
+ __slots__ = ()
2873
+
2874
+ @abstractmethod
2875
+ def __int__(self) -> int:
2876
+ pass
2877
+
2878
+
2879
+ @runtime_checkable
2880
+ class SupportsFloat(Protocol):
2881
+ """A protocol with one abstract method __float__."""
2882
+
2883
+ __slots__ = ()
2884
+
2885
+ @abstractmethod
2886
+ def __float__(self) -> float:
2887
+ pass
2888
+
2889
+
2890
+ @runtime_checkable
2891
+ class SupportsComplex(Protocol):
2892
+ """A protocol with one abstract method __complex__."""
2893
+
2894
+ __slots__ = ()
2895
+
2896
+ @abstractmethod
2897
+ def __complex__(self) -> complex:
2898
+ pass
2899
+
2900
+
2901
+ @runtime_checkable
2902
+ class SupportsBytes(Protocol):
2903
+ """A protocol with one abstract method __bytes__."""
2904
+
2905
+ __slots__ = ()
2906
+
2907
+ @abstractmethod
2908
+ def __bytes__(self) -> bytes:
2909
+ pass
2910
+
2911
+
2912
+ @runtime_checkable
2913
+ class SupportsIndex(Protocol):
2914
+ """A protocol with one abstract method __index__."""
2915
+
2916
+ __slots__ = ()
2917
+
2918
+ @abstractmethod
2919
+ def __index__(self) -> int:
2920
+ pass
2921
+
2922
+
2923
+ @runtime_checkable
2924
+ class SupportsAbs[T](Protocol):
2925
+ """A protocol with one abstract method __abs__ that is covariant in its return type."""
2926
+
2927
+ __slots__ = ()
2928
+
2929
+ @abstractmethod
2930
+ def __abs__(self) -> T:
2931
+ pass
2932
+
2933
+
2934
+ @runtime_checkable
2935
+ class SupportsRound[T](Protocol):
2936
+ """A protocol with one abstract method __round__ that is covariant in its return type."""
2937
+
2938
+ __slots__ = ()
2939
+
2940
+ @abstractmethod
2941
+ def __round__(self, ndigits: int = 0) -> T:
2942
+ pass
2943
+
2944
+
2945
+ def _make_nmtuple(name, fields, annotate_func, module, defaults = ()):
2946
+ nm_tpl = collections.namedtuple(name, fields,
2947
+ defaults=defaults, module=module)
2948
+ nm_tpl.__annotate__ = nm_tpl.__new__.__annotate__ = annotate_func
2949
+ return nm_tpl
2950
+
2951
+
2952
+ def _make_eager_annotate(types):
2953
+ checked_types = {key: _type_check(val, f"field {key} annotation must be a type")
2954
+ for key, val in types.items()}
2955
+ def annotate(format):
2956
+ match format:
2957
+ case _lazy_annotationlib.Format.VALUE | _lazy_annotationlib.Format.FORWARDREF:
2958
+ return checked_types
2959
+ case _lazy_annotationlib.Format.STRING:
2960
+ return _lazy_annotationlib.annotations_to_string(types)
2961
+ case _:
2962
+ raise NotImplementedError(format)
2963
+ return annotate
2964
+
2965
+
2966
+ # attributes prohibited to set in NamedTuple class syntax
2967
+ _prohibited = frozenset({'__new__', '__init__', '__slots__', '__getnewargs__',
2968
+ '_fields', '_field_defaults',
2969
+ '_make', '_replace', '_asdict', '_source'})
2970
+
2971
+ _special = frozenset({'__module__', '__name__', '__annotations__', '__annotate__',
2972
+ '__annotate_func__', '__annotations_cache__'})
2973
+
2974
+
2975
+ class NamedTupleMeta(type):
2976
+ def __new__(cls, typename, bases, ns):
2977
+ assert _NamedTuple in bases
2978
+ if "__classcell__" in ns:
2979
+ raise TypeError(
2980
+ "uses of super() and __class__ are unsupported in methods of NamedTuple subclasses")
2981
+ for base in bases:
2982
+ if base is not _NamedTuple and base is not Generic:
2983
+ raise TypeError(
2984
+ 'can only inherit from a NamedTuple type and Generic')
2985
+ bases = tuple(tuple if base is _NamedTuple else base for base in bases)
2986
+ if "__annotations__" in ns:
2987
+ types = ns["__annotations__"]
2988
+ field_names = list(types)
2989
+ annotate = _make_eager_annotate(types)
2990
+ elif (original_annotate := _lazy_annotationlib.get_annotate_from_class_namespace(ns)) is not None:
2991
+ types = _lazy_annotationlib.call_annotate_function(
2992
+ original_annotate, _lazy_annotationlib.Format.FORWARDREF)
2993
+ field_names = list(types)
2994
+
2995
+ # For backward compatibility, type-check all the types at creation time
2996
+ for typ in types.values():
2997
+ _type_check(typ, "field annotation must be a type")
2998
+
2999
+ def annotate(format):
3000
+ annos = _lazy_annotationlib.call_annotate_function(
3001
+ original_annotate, format)
3002
+ if format != _lazy_annotationlib.Format.STRING:
3003
+ return {key: _type_check(val, f"field {key} annotation must be a type")
3004
+ for key, val in annos.items()}
3005
+ return annos
3006
+ else:
3007
+ # Empty NamedTuple
3008
+ field_names = []
3009
+ annotate = lambda format: {}
3010
+ default_names = []
3011
+ for field_name in field_names:
3012
+ if field_name in ns:
3013
+ default_names.append(field_name)
3014
+ elif default_names:
3015
+ raise TypeError(f"Non-default namedtuple field {field_name} "
3016
+ f"cannot follow default field"
3017
+ f"{'s' if len(default_names) > 1 else ''} "
3018
+ f"{', '.join(default_names)}")
3019
+ nm_tpl = _make_nmtuple(typename, field_names, annotate,
3020
+ defaults=[ns[n] for n in default_names],
3021
+ module=ns['__module__'])
3022
+ nm_tpl.__bases__ = bases
3023
+ if Generic in bases:
3024
+ class_getitem = _generic_class_getitem
3025
+ nm_tpl.__class_getitem__ = classmethod(class_getitem)
3026
+ # update from user namespace without overriding special namedtuple attributes
3027
+ for key, val in ns.items():
3028
+ if key in _prohibited:
3029
+ raise AttributeError("Cannot overwrite NamedTuple attribute " + key)
3030
+ elif key not in _special:
3031
+ if key not in nm_tpl._fields:
3032
+ setattr(nm_tpl, key, val)
3033
+ try:
3034
+ set_name = type(val).__set_name__
3035
+ except AttributeError:
3036
+ pass
3037
+ else:
3038
+ try:
3039
+ set_name(val, nm_tpl, key)
3040
+ except BaseException as e:
3041
+ e.add_note(
3042
+ f"Error calling __set_name__ on {type(val).__name__!r} "
3043
+ f"instance {key!r} in {typename!r}"
3044
+ )
3045
+ raise
3046
+
3047
+ if Generic in bases:
3048
+ nm_tpl.__init_subclass__()
3049
+ return nm_tpl
3050
+
3051
+
3052
+ def NamedTuple(typename, fields=_sentinel, /, **kwargs):
3053
+ """Typed version of collections.namedtuple.
3054
+
3055
+ Usage::
3056
+
3057
+ class Employee(NamedTuple):
3058
+ name: str
3059
+ id: int
3060
+
3061
+ This is equivalent to::
3062
+
3063
+ Employee = collections.namedtuple('Employee', ['name', 'id'])
3064
+
3065
+ The types for each field name can be retrieved by calling
3066
+ annotationlib.get_annotations(Employee). (The field names are also in
3067
+ the _fields attribute, which is part of the namedtuple API.)
3068
+ An alternative equivalent functional syntax is also accepted::
3069
+
3070
+ Employee = NamedTuple('Employee', [('name', str), ('id', int)])
3071
+ """
3072
+ if fields is _sentinel:
3073
+ if kwargs:
3074
+ deprecated_thing = "Creating NamedTuple classes using keyword arguments"
3075
+ deprecation_msg = (
3076
+ "{name} is deprecated and will be disallowed in Python {remove}. "
3077
+ "Use the class-based or functional syntax instead."
3078
+ )
3079
+ else:
3080
+ deprecated_thing = "Failing to pass a value for the 'fields' parameter"
3081
+ example = f"`{typename} = NamedTuple({typename!r}, [])`"
3082
+ deprecation_msg = (
3083
+ "{name} is deprecated and will be disallowed in Python {remove}. "
3084
+ "To create a NamedTuple class with 0 fields "
3085
+ "using the functional syntax, "
3086
+ "pass an empty list, e.g. "
3087
+ ) + example + "."
3088
+ elif fields is None:
3089
+ if kwargs:
3090
+ raise TypeError(
3091
+ "Cannot pass `None` as the 'fields' parameter "
3092
+ "and also specify fields using keyword arguments"
3093
+ )
3094
+ else:
3095
+ deprecated_thing = "Passing `None` as the 'fields' parameter"
3096
+ example = f"`{typename} = NamedTuple({typename!r}, [])`"
3097
+ deprecation_msg = (
3098
+ "{name} is deprecated and will be disallowed in Python {remove}. "
3099
+ "To create a NamedTuple class with 0 fields "
3100
+ "using the functional syntax, "
3101
+ "pass an empty list, e.g. "
3102
+ ) + example + "."
3103
+ elif kwargs:
3104
+ raise TypeError("Either list of fields or keywords"
3105
+ " can be provided to NamedTuple, not both")
3106
+ if fields is _sentinel or fields is None:
3107
+ import warnings
3108
+ warnings._deprecated(deprecated_thing, message=deprecation_msg, remove=(3, 15))
3109
+ fields = kwargs.items()
3110
+ types = {n: _type_check(t, f"field {n} annotation must be a type")
3111
+ for n, t in fields}
3112
+ field_names = [n for n, _ in fields]
3113
+
3114
+ nt = _make_nmtuple(typename, field_names, _make_eager_annotate(types), module=_caller())
3115
+ nt.__orig_bases__ = (NamedTuple,)
3116
+ return nt
3117
+
3118
+ _NamedTuple = type.__new__(NamedTupleMeta, 'NamedTuple', (), {})
3119
+
3120
+ def _namedtuple_mro_entries(bases):
3121
+ assert NamedTuple in bases
3122
+ return (_NamedTuple,)
3123
+
3124
+ NamedTuple.__mro_entries__ = _namedtuple_mro_entries
3125
+
3126
+
3127
+ def _get_typeddict_qualifiers(annotation_type):
3128
+ while True:
3129
+ annotation_origin = get_origin(annotation_type)
3130
+ if annotation_origin is Annotated:
3131
+ annotation_args = get_args(annotation_type)
3132
+ if annotation_args:
3133
+ annotation_type = annotation_args[0]
3134
+ else:
3135
+ break
3136
+ elif annotation_origin is Required:
3137
+ yield Required
3138
+ (annotation_type,) = get_args(annotation_type)
3139
+ elif annotation_origin is NotRequired:
3140
+ yield NotRequired
3141
+ (annotation_type,) = get_args(annotation_type)
3142
+ elif annotation_origin is ReadOnly:
3143
+ yield ReadOnly
3144
+ (annotation_type,) = get_args(annotation_type)
3145
+ else:
3146
+ break
3147
+
3148
+
3149
+ class _TypedDictMeta(type):
3150
+ def __new__(cls, name, bases, ns, total=True):
3151
+ """Create a new typed dict class object.
3152
+
3153
+ This method is called when TypedDict is subclassed,
3154
+ or when TypedDict is instantiated. This way
3155
+ TypedDict classes can be created through both class-based and functional syntax.
3156
+ Subclasses and instances of TypedDict return actual dictionaries.
3157
+ """
3158
+ for base in bases:
3159
+ if type(base) is not _TypedDictMeta and base is not Generic:
3160
+ raise TypeError('cannot inherit from both a TypedDict type '
3161
+ 'and a non-TypedDict base class')
3162
+
3163
+ if any(issubclass(b, Generic) for b in bases):
3164
+ generic_base = (Generic,)
3165
+ else:
3166
+ generic_base = ()
3167
+
3168
+ ns_annotations = ns.pop('__annotations__', None)
3169
+
3170
+ tp_dict = type.__new__(_TypedDictMeta, name, (*generic_base, dict), ns)
3171
+
3172
+ if not hasattr(tp_dict, '__orig_bases__'):
3173
+ tp_dict.__orig_bases__ = bases
3174
+
3175
+ if ns_annotations is not None:
3176
+ own_annotate = None
3177
+ own_annotations = ns_annotations
3178
+ elif (own_annotate := _lazy_annotationlib.get_annotate_from_class_namespace(ns)) is not None:
3179
+ own_annotations = _lazy_annotationlib.call_annotate_function(
3180
+ own_annotate, _lazy_annotationlib.Format.FORWARDREF, owner=tp_dict
3181
+ )
3182
+ else:
3183
+ own_annotate = None
3184
+ own_annotations = {}
3185
+ msg = "TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a type"
3186
+ own_checked_annotations = {
3187
+ n: _type_check(tp, msg, owner=tp_dict, module=tp_dict.__module__)
3188
+ for n, tp in own_annotations.items()
3189
+ }
3190
+ required_keys = set()
3191
+ optional_keys = set()
3192
+ readonly_keys = set()
3193
+ mutable_keys = set()
3194
+
3195
+ for base in bases:
3196
+ base_required = base.__dict__.get('__required_keys__', set())
3197
+ required_keys |= base_required
3198
+ optional_keys -= base_required
3199
+
3200
+ base_optional = base.__dict__.get('__optional_keys__', set())
3201
+ required_keys -= base_optional
3202
+ optional_keys |= base_optional
3203
+
3204
+ readonly_keys.update(base.__dict__.get('__readonly_keys__', ()))
3205
+ mutable_keys.update(base.__dict__.get('__mutable_keys__', ()))
3206
+
3207
+ for annotation_key, annotation_type in own_checked_annotations.items():
3208
+ qualifiers = set(_get_typeddict_qualifiers(annotation_type))
3209
+ if Required in qualifiers:
3210
+ is_required = True
3211
+ elif NotRequired in qualifiers:
3212
+ is_required = False
3213
+ else:
3214
+ is_required = total
3215
+
3216
+ if is_required:
3217
+ required_keys.add(annotation_key)
3218
+ optional_keys.discard(annotation_key)
3219
+ else:
3220
+ optional_keys.add(annotation_key)
3221
+ required_keys.discard(annotation_key)
3222
+
3223
+ if ReadOnly in qualifiers:
3224
+ if annotation_key in mutable_keys:
3225
+ raise TypeError(
3226
+ f"Cannot override mutable key {annotation_key!r}"
3227
+ " with read-only key"
3228
+ )
3229
+ readonly_keys.add(annotation_key)
3230
+ else:
3231
+ mutable_keys.add(annotation_key)
3232
+ readonly_keys.discard(annotation_key)
3233
+
3234
+ assert required_keys.isdisjoint(optional_keys), (
3235
+ f"Required keys overlap with optional keys in {name}:"
3236
+ f" {required_keys=}, {optional_keys=}"
3237
+ )
3238
+
3239
+ def __annotate__(format):
3240
+ annos = {}
3241
+ for base in bases:
3242
+ if base is Generic:
3243
+ continue
3244
+ base_annotate = base.__annotate__
3245
+ if base_annotate is None:
3246
+ continue
3247
+ base_annos = _lazy_annotationlib.call_annotate_function(
3248
+ base_annotate, format, owner=base)
3249
+ annos.update(base_annos)
3250
+ if own_annotate is not None:
3251
+ own = _lazy_annotationlib.call_annotate_function(
3252
+ own_annotate, format, owner=tp_dict)
3253
+ if format != _lazy_annotationlib.Format.STRING:
3254
+ own = {
3255
+ n: _type_check(tp, msg, module=tp_dict.__module__)
3256
+ for n, tp in own.items()
3257
+ }
3258
+ elif format == _lazy_annotationlib.Format.STRING:
3259
+ own = _lazy_annotationlib.annotations_to_string(own_annotations)
3260
+ elif format in (_lazy_annotationlib.Format.FORWARDREF, _lazy_annotationlib.Format.VALUE):
3261
+ own = own_checked_annotations
3262
+ else:
3263
+ raise NotImplementedError(format)
3264
+ annos.update(own)
3265
+ return annos
3266
+
3267
+ tp_dict.__annotate__ = __annotate__
3268
+ tp_dict.__required_keys__ = frozenset(required_keys)
3269
+ tp_dict.__optional_keys__ = frozenset(optional_keys)
3270
+ tp_dict.__readonly_keys__ = frozenset(readonly_keys)
3271
+ tp_dict.__mutable_keys__ = frozenset(mutable_keys)
3272
+ tp_dict.__total__ = total
3273
+ return tp_dict
3274
+
3275
+ __call__ = dict # static method
3276
+
3277
+ def __subclasscheck__(cls, other):
3278
+ # Typed dicts are only for static structural subtyping.
3279
+ raise TypeError('TypedDict does not support instance and class checks')
3280
+
3281
+ __instancecheck__ = __subclasscheck__
3282
+
3283
+
3284
+ def TypedDict(typename, fields=_sentinel, /, *, total=True):
3285
+ """A simple typed namespace. At runtime it is equivalent to a plain dict.
3286
+
3287
+ TypedDict creates a dictionary type such that a type checker will expect all
3288
+ instances to have a certain set of keys, where each key is
3289
+ associated with a value of a consistent type. This expectation
3290
+ is not checked at runtime.
3291
+
3292
+ Usage::
3293
+
3294
+ >>> class Point2D(TypedDict):
3295
+ ... x: int
3296
+ ... y: int
3297
+ ... label: str
3298
+ ...
3299
+ >>> a: Point2D = {'x': 1, 'y': 2, 'label': 'good'} # OK
3300
+ >>> b: Point2D = {'z': 3, 'label': 'bad'} # Fails type check
3301
+ >>> Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')
3302
+ True
3303
+
3304
+ The type info can be accessed by calling annotationlib.get_annotations(Point2D), and
3305
+ via the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets.
3306
+ TypedDict supports an additional equivalent form::
3307
+
3308
+ Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})
3309
+
3310
+ By default, all keys must be present in a TypedDict. It is possible
3311
+ to override this by using the NotRequired and Required special forms::
3312
+
3313
+ class Point2D(TypedDict):
3314
+ x: int # the "x" key must always be present (Required is the default)
3315
+ y: NotRequired[int] # the "y" key can be omitted
3316
+
3317
+ This means that a Point2D TypedDict can have the "y" key omitted, but the "x" key must be present.
3318
+ Items are required by default, so the Required special form is not necessary in this example.
3319
+ In addition, the total argument to the TypedDict function can be used to make all items not required::
3320
+
3321
+ class Point2D(TypedDict, total=False):
3322
+ x: int
3323
+ y: int
3324
+
3325
+ This means that a Point2D TypedDict can have any of the keys omitted. A type
3326
+ checker is only expected to support a literal False or True as the value of
3327
+ the total argument. True is the default, and makes all items defined in the
3328
+ class body be required. The Required special form can be used to mark individual
3329
+ keys as required in a total=False TypedDict.
3330
+
3331
+ The ReadOnly special form can be used
3332
+ to mark individual keys as immutable for type checkers::
3333
+
3334
+ class DatabaseUser(TypedDict):
3335
+ id: ReadOnly[int] # the "id" key must not be modified
3336
+ username: str # the "username" key can be changed
3337
+
3338
+ See PEPs 589, 655, and 705 for more information.
3339
+ """
3340
+ if fields is _sentinel or fields is None:
3341
+ import warnings
3342
+
3343
+ if fields is _sentinel:
3344
+ deprecated_thing = "Failing to pass a value for the 'fields' parameter"
3345
+ else:
3346
+ deprecated_thing = "Passing `None` as the 'fields' parameter"
3347
+
3348
+ example = f"`{typename} = TypedDict({typename!r}, {{{{}}}})`"
3349
+ deprecation_msg = (
3350
+ "{name} is deprecated and will be disallowed in Python {remove}. "
3351
+ "To create a TypedDict class with 0 fields "
3352
+ "using the functional syntax, "
3353
+ "pass an empty dictionary, e.g. "
3354
+ ) + example + "."
3355
+ warnings._deprecated(deprecated_thing, message=deprecation_msg, remove=(3, 15))
3356
+ fields = {}
3357
+
3358
+ ns = {'__annotations__': dict(fields)}
3359
+ module = _caller()
3360
+ if module is not None:
3361
+ # Setting correct module is necessary to make typed dict classes pickleable.
3362
+ ns['__module__'] = module
3363
+
3364
+ td = _TypedDictMeta(typename, (), ns, total=total)
3365
+ td.__orig_bases__ = (TypedDict,)
3366
+ return td
3367
+
3368
+ _TypedDict = type.__new__(_TypedDictMeta, 'TypedDict', (), {})
3369
+ TypedDict.__mro_entries__ = lambda bases: (_TypedDict,)
3370
+
3371
+
3372
+ @_SpecialForm
3373
+ def Required(self, parameters):
3374
+ """Special typing construct to mark a TypedDict key as required.
3375
+
3376
+ This is mainly useful for total=False TypedDicts.
3377
+
3378
+ For example::
3379
+
3380
+ class Movie(TypedDict, total=False):
3381
+ title: Required[str]
3382
+ year: int
3383
+
3384
+ m = Movie(
3385
+ title='The Matrix', # type checker error if key is omitted
3386
+ year=1999,
3387
+ )
3388
+
3389
+ There is no runtime checking that a required key is actually provided
3390
+ when instantiating a related TypedDict.
3391
+ """
3392
+ item = _type_check(parameters, f'{self._name} accepts only a single type.')
3393
+ return _GenericAlias(self, (item,))
3394
+
3395
+
3396
+ @_SpecialForm
3397
+ def NotRequired(self, parameters):
3398
+ """Special typing construct to mark a TypedDict key as potentially missing.
3399
+
3400
+ For example::
3401
+
3402
+ class Movie(TypedDict):
3403
+ title: str
3404
+ year: NotRequired[int]
3405
+
3406
+ m = Movie(
3407
+ title='The Matrix', # type checker error if key is omitted
3408
+ year=1999,
3409
+ )
3410
+ """
3411
+ item = _type_check(parameters, f'{self._name} accepts only a single type.')
3412
+ return _GenericAlias(self, (item,))
3413
+
3414
+
3415
+ @_SpecialForm
3416
+ def ReadOnly(self, parameters):
3417
+ """A special typing construct to mark an item of a TypedDict as read-only.
3418
+
3419
+ For example::
3420
+
3421
+ class Movie(TypedDict):
3422
+ title: ReadOnly[str]
3423
+ year: int
3424
+
3425
+ def mutate_movie(m: Movie) -> None:
3426
+ m["year"] = 1992 # allowed
3427
+ m["title"] = "The Matrix" # type checker error
3428
+
3429
+ There is no runtime checking for this property.
3430
+ """
3431
+ item = _type_check(parameters, f'{self._name} accepts only a single type.')
3432
+ return _GenericAlias(self, (item,))
3433
+
3434
+
3435
+ class NewType:
3436
+ """NewType creates simple unique types with almost zero runtime overhead.
3437
+
3438
+ NewType(name, tp) is considered a subtype of tp
3439
+ by static type checkers. At runtime, NewType(name, tp) returns
3440
+ a dummy callable that simply returns its argument.
3441
+
3442
+ Usage::
3443
+
3444
+ UserId = NewType('UserId', int)
3445
+
3446
+ def name_by_id(user_id: UserId) -> str:
3447
+ ...
3448
+
3449
+ UserId('user') # Fails type check
3450
+
3451
+ name_by_id(42) # Fails type check
3452
+ name_by_id(UserId(42)) # OK
3453
+
3454
+ num = UserId(5) + 1 # type: int
3455
+ """
3456
+
3457
+ __call__ = _idfunc
3458
+
3459
+ def __init__(self, name, tp):
3460
+ self.__qualname__ = name
3461
+ if '.' in name:
3462
+ name = name.rpartition('.')[-1]
3463
+ self.__name__ = name
3464
+ self.__supertype__ = tp
3465
+ def_mod = _caller()
3466
+ if def_mod != 'typing':
3467
+ self.__module__ = def_mod
3468
+
3469
+ def __mro_entries__(self, bases):
3470
+ # We defined __mro_entries__ to get a better error message
3471
+ # if a user attempts to subclass a NewType instance. bpo-46170
3472
+ superclass_name = self.__name__
3473
+
3474
+ class Dummy:
3475
+ def __init_subclass__(cls):
3476
+ subclass_name = cls.__name__
3477
+ raise TypeError(
3478
+ f"Cannot subclass an instance of NewType. Perhaps you were looking for: "
3479
+ f"`{subclass_name} = NewType({subclass_name!r}, {superclass_name})`"
3480
+ )
3481
+
3482
+ return (Dummy,)
3483
+
3484
+ def __repr__(self):
3485
+ return f'{self.__module__}.{self.__qualname__}'
3486
+
3487
+ def __reduce__(self):
3488
+ return self.__qualname__
3489
+
3490
+ def __or__(self, other):
3491
+ return Union[self, other]
3492
+
3493
+ def __ror__(self, other):
3494
+ return Union[other, self]
3495
+
3496
+
3497
+ # Python-version-specific alias (Python 2: unicode; Python 3: str)
3498
+ Text = str
3499
+
3500
+
3501
+ # Constant that's True when type checking, but False here.
3502
+ TYPE_CHECKING = False
3503
+
3504
+
3505
+ class IO(Generic[AnyStr]):
3506
+ """Generic base class for TextIO and BinaryIO.
3507
+
3508
+ This is an abstract, generic version of the return of open().
3509
+
3510
+ NOTE: This does not distinguish between the different possible
3511
+ classes (text vs. binary, read vs. write vs. read/write,
3512
+ append-only, unbuffered). The TextIO and BinaryIO subclasses
3513
+ below capture the distinctions between text vs. binary, which is
3514
+ pervasive in the interface. For more precise types, define a custom
3515
+ Protocol.
3516
+ """
3517
+
3518
+ __slots__ = ()
3519
+
3520
+ @property
3521
+ @abstractmethod
3522
+ def mode(self) -> str:
3523
+ pass
3524
+
3525
+ @property
3526
+ @abstractmethod
3527
+ def name(self) -> str:
3528
+ pass
3529
+
3530
+ @abstractmethod
3531
+ def close(self) -> None:
3532
+ pass
3533
+
3534
+ @property
3535
+ @abstractmethod
3536
+ def closed(self) -> bool:
3537
+ pass
3538
+
3539
+ @abstractmethod
3540
+ def fileno(self) -> int:
3541
+ pass
3542
+
3543
+ @abstractmethod
3544
+ def flush(self) -> None:
3545
+ pass
3546
+
3547
+ @abstractmethod
3548
+ def isatty(self) -> bool:
3549
+ pass
3550
+
3551
+ @abstractmethod
3552
+ def read(self, n: int = -1) -> AnyStr:
3553
+ pass
3554
+
3555
+ @abstractmethod
3556
+ def readable(self) -> bool:
3557
+ pass
3558
+
3559
+ @abstractmethod
3560
+ def readline(self, limit: int = -1) -> AnyStr:
3561
+ pass
3562
+
3563
+ @abstractmethod
3564
+ def readlines(self, hint: int = -1) -> list[AnyStr]:
3565
+ pass
3566
+
3567
+ @abstractmethod
3568
+ def seek(self, offset: int, whence: int = 0) -> int:
3569
+ pass
3570
+
3571
+ @abstractmethod
3572
+ def seekable(self) -> bool:
3573
+ pass
3574
+
3575
+ @abstractmethod
3576
+ def tell(self) -> int:
3577
+ pass
3578
+
3579
+ @abstractmethod
3580
+ def truncate(self, size: int | None = None) -> int:
3581
+ pass
3582
+
3583
+ @abstractmethod
3584
+ def writable(self) -> bool:
3585
+ pass
3586
+
3587
+ @abstractmethod
3588
+ def write(self, s: AnyStr) -> int:
3589
+ pass
3590
+
3591
+ @abstractmethod
3592
+ def writelines(self, lines: list[AnyStr]) -> None:
3593
+ pass
3594
+
3595
+ @abstractmethod
3596
+ def __enter__(self) -> IO[AnyStr]:
3597
+ pass
3598
+
3599
+ @abstractmethod
3600
+ def __exit__(self, type, value, traceback) -> None:
3601
+ pass
3602
+
3603
+
3604
+ class BinaryIO(IO[bytes]):
3605
+ """Typed approximation of the return of open() in binary mode."""
3606
+
3607
+ __slots__ = ()
3608
+
3609
+ @abstractmethod
3610
+ def write(self, s: bytes | bytearray) -> int:
3611
+ pass
3612
+
3613
+ @abstractmethod
3614
+ def __enter__(self) -> BinaryIO:
3615
+ pass
3616
+
3617
+
3618
+ class TextIO(IO[str]):
3619
+ """Typed approximation of the return of open() in text mode."""
3620
+
3621
+ __slots__ = ()
3622
+
3623
+ @property
3624
+ @abstractmethod
3625
+ def buffer(self) -> BinaryIO:
3626
+ pass
3627
+
3628
+ @property
3629
+ @abstractmethod
3630
+ def encoding(self) -> str:
3631
+ pass
3632
+
3633
+ @property
3634
+ @abstractmethod
3635
+ def errors(self) -> str | None:
3636
+ pass
3637
+
3638
+ @property
3639
+ @abstractmethod
3640
+ def line_buffering(self) -> bool:
3641
+ pass
3642
+
3643
+ @property
3644
+ @abstractmethod
3645
+ def newlines(self) -> Any:
3646
+ pass
3647
+
3648
+ @abstractmethod
3649
+ def __enter__(self) -> TextIO:
3650
+ pass
3651
+
3652
+
3653
+ def reveal_type[T](obj: T, /) -> T:
3654
+ """Ask a static type checker to reveal the inferred type of an expression.
3655
+
3656
+ When a static type checker encounters a call to ``reveal_type()``,
3657
+ it will emit the inferred type of the argument::
3658
+
3659
+ x: int = 1
3660
+ reveal_type(x)
3661
+
3662
+ Running a static type checker (e.g., mypy) on this example
3663
+ will produce output similar to 'Revealed type is "builtins.int"'.
3664
+
3665
+ At runtime, the function prints the runtime type of the
3666
+ argument and returns the argument unchanged.
3667
+ """
3668
+ print(f"Runtime type is {type(obj).__name__!r}", file=sys.stderr)
3669
+ return obj
3670
+
3671
+
3672
+ class _IdentityCallable(Protocol):
3673
+ def __call__[T](self, arg: T, /) -> T:
3674
+ ...
3675
+
3676
+
3677
+ def dataclass_transform(
3678
+ *,
3679
+ eq_default: bool = True,
3680
+ order_default: bool = False,
3681
+ kw_only_default: bool = False,
3682
+ frozen_default: bool = False,
3683
+ field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = (),
3684
+ **kwargs: Any,
3685
+ ) -> _IdentityCallable:
3686
+ """Decorator to mark an object as providing dataclass-like behavior.
3687
+
3688
+ The decorator can be applied to a function, class, or metaclass.
3689
+
3690
+ Example usage with a decorator function::
3691
+
3692
+ @dataclass_transform()
3693
+ def create_model[T](cls: type[T]) -> type[T]:
3694
+ ...
3695
+ return cls
3696
+
3697
+ @create_model
3698
+ class CustomerModel:
3699
+ id: int
3700
+ name: str
3701
+
3702
+ On a base class::
3703
+
3704
+ @dataclass_transform()
3705
+ class ModelBase: ...
3706
+
3707
+ class CustomerModel(ModelBase):
3708
+ id: int
3709
+ name: str
3710
+
3711
+ On a metaclass::
3712
+
3713
+ @dataclass_transform()
3714
+ class ModelMeta(type): ...
3715
+
3716
+ class ModelBase(metaclass=ModelMeta): ...
3717
+
3718
+ class CustomerModel(ModelBase):
3719
+ id: int
3720
+ name: str
3721
+
3722
+ The ``CustomerModel`` classes defined above will
3723
+ be treated by type checkers similarly to classes created with
3724
+ ``@dataclasses.dataclass``.
3725
+ For example, type checkers will assume these classes have
3726
+ ``__init__`` methods that accept ``id`` and ``name``.
3727
+
3728
+ The arguments to this decorator can be used to customize this behavior:
3729
+ - ``eq_default`` indicates whether the ``eq`` parameter is assumed to be
3730
+ ``True`` or ``False`` if it is omitted by the caller.
3731
+ - ``order_default`` indicates whether the ``order`` parameter is
3732
+ assumed to be True or False if it is omitted by the caller.
3733
+ - ``kw_only_default`` indicates whether the ``kw_only`` parameter is
3734
+ assumed to be True or False if it is omitted by the caller.
3735
+ - ``frozen_default`` indicates whether the ``frozen`` parameter is
3736
+ assumed to be True or False if it is omitted by the caller.
3737
+ - ``field_specifiers`` specifies a static list of supported classes
3738
+ or functions that describe fields, similar to ``dataclasses.field()``.
3739
+ - Arbitrary other keyword arguments are accepted in order to allow for
3740
+ possible future extensions.
3741
+
3742
+ At runtime, this decorator records its arguments in the
3743
+ ``__dataclass_transform__`` attribute on the decorated object.
3744
+ It has no other runtime effect.
3745
+
3746
+ See PEP 681 for more details.
3747
+ """
3748
+ def decorator(cls_or_fn):
3749
+ cls_or_fn.__dataclass_transform__ = {
3750
+ "eq_default": eq_default,
3751
+ "order_default": order_default,
3752
+ "kw_only_default": kw_only_default,
3753
+ "frozen_default": frozen_default,
3754
+ "field_specifiers": field_specifiers,
3755
+ "kwargs": kwargs,
3756
+ }
3757
+ return cls_or_fn
3758
+ return decorator
3759
+
3760
+
3761
+ type _Func = Callable[..., Any]
3762
+
3763
+
3764
+ def override[F: _Func](method: F, /) -> F:
3765
+ """Indicate that a method is intended to override a method in a base class.
3766
+
3767
+ Usage::
3768
+
3769
+ class Base:
3770
+ def method(self) -> None:
3771
+ pass
3772
+
3773
+ class Child(Base):
3774
+ @override
3775
+ def method(self) -> None:
3776
+ super().method()
3777
+
3778
+ When this decorator is applied to a method, the type checker will
3779
+ validate that it overrides a method or attribute with the same name on a
3780
+ base class. This helps prevent bugs that may occur when a base class is
3781
+ changed without an equivalent change to a child class.
3782
+
3783
+ There is no runtime checking of this property. The decorator attempts to
3784
+ set the ``__override__`` attribute to ``True`` on the decorated object to
3785
+ allow runtime introspection.
3786
+
3787
+ See PEP 698 for details.
3788
+ """
3789
+ try:
3790
+ method.__override__ = True
3791
+ except (AttributeError, TypeError):
3792
+ # Skip the attribute silently if it is not writable.
3793
+ # AttributeError happens if the object has __slots__ or a
3794
+ # read-only property, TypeError if it's a builtin class.
3795
+ pass
3796
+ return method
3797
+
3798
+
3799
+ def is_protocol(tp: type, /) -> bool:
3800
+ """Return True if the given type is a Protocol.
3801
+
3802
+ Example::
3803
+
3804
+ >>> from typing import Protocol, is_protocol
3805
+ >>> class P(Protocol):
3806
+ ... def a(self) -> str: ...
3807
+ ... b: int
3808
+ >>> is_protocol(P)
3809
+ True
3810
+ >>> is_protocol(int)
3811
+ False
3812
+ """
3813
+ return (
3814
+ isinstance(tp, type)
3815
+ and getattr(tp, '_is_protocol', False)
3816
+ and tp != Protocol
3817
+ )
3818
+
3819
+
3820
+ def get_protocol_members(tp: type, /) -> frozenset[str]:
3821
+ """Return the set of members defined in a Protocol.
3822
+
3823
+ Example::
3824
+
3825
+ >>> from typing import Protocol, get_protocol_members
3826
+ >>> class P(Protocol):
3827
+ ... def a(self) -> str: ...
3828
+ ... b: int
3829
+ >>> get_protocol_members(P) == frozenset({'a', 'b'})
3830
+ True
3831
+
3832
+ Raise a TypeError for arguments that are not Protocols.
3833
+ """
3834
+ if not is_protocol(tp):
3835
+ raise TypeError(f'{tp!r} is not a Protocol')
3836
+ return frozenset(tp.__protocol_attrs__)
3837
+
3838
+
3839
+ def __getattr__(attr):
3840
+ """Improve the import time of the typing module.
3841
+
3842
+ Soft-deprecated objects which are costly to create
3843
+ are only created on-demand here.
3844
+ """
3845
+ if attr == "ForwardRef":
3846
+ obj = _lazy_annotationlib.ForwardRef
3847
+ elif attr in {"Pattern", "Match"}:
3848
+ import re
3849
+ obj = _alias(getattr(re, attr), 1)
3850
+ elif attr in {"ContextManager", "AsyncContextManager"}:
3851
+ import contextlib
3852
+ obj = _alias(getattr(contextlib, f"Abstract{attr}"), 2, name=attr, defaults=(bool | None,))
3853
+ elif attr == "_collect_parameters":
3854
+ import warnings
3855
+
3856
+ depr_message = (
3857
+ "The private _collect_parameters function is deprecated and will be"
3858
+ " removed in a future version of Python. Any use of private functions"
3859
+ " is discouraged and may break in the future."
3860
+ )
3861
+ warnings.warn(depr_message, category=DeprecationWarning, stacklevel=2)
3862
+ obj = _collect_type_parameters
3863
+ else:
3864
+ raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
3865
+ globals()[attr] = obj
3866
+ return obj