Cython 3.3.0a1__cp315-cp315-win_amd64.whl

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 (335) hide show
  1. Cython/Build/BuildExecutable.py +156 -0
  2. Cython/Build/Cache.py +199 -0
  3. Cython/Build/Cythonize.py +349 -0
  4. Cython/Build/Dependencies.py +1276 -0
  5. Cython/Build/Distutils.py +1 -0
  6. Cython/Build/Inline.py +467 -0
  7. Cython/Build/IpythonMagic.py +559 -0
  8. Cython/Build/SharedModule.py +84 -0
  9. Cython/Build/Tests/TestCyCache.py +195 -0
  10. Cython/Build/Tests/TestCythonizeArgsParser.py +480 -0
  11. Cython/Build/Tests/TestDependencies.py +133 -0
  12. Cython/Build/Tests/TestInline.py +177 -0
  13. Cython/Build/Tests/TestIpythonMagic.py +303 -0
  14. Cython/Build/Tests/TestRecythonize.py +212 -0
  15. Cython/Build/Tests/TestStripLiterals.py +155 -0
  16. Cython/Build/Tests/__init__.py +1 -0
  17. Cython/Build/__init__.py +11 -0
  18. Cython/CodeWriter.py +815 -0
  19. Cython/Compiler/AnalysedTreeTransforms.py +97 -0
  20. Cython/Compiler/Annotate.py +328 -0
  21. Cython/Compiler/AutoDocTransforms.py +320 -0
  22. Cython/Compiler/Buffer.py +680 -0
  23. Cython/Compiler/Builtin.py +997 -0
  24. Cython/Compiler/CmdLine.py +263 -0
  25. Cython/Compiler/Code.cp315-win_amd64.pyd +0 -0
  26. Cython/Compiler/Code.pxd +152 -0
  27. Cython/Compiler/Code.py +3907 -0
  28. Cython/Compiler/CodeGeneration.py +33 -0
  29. Cython/Compiler/CythonScope.py +194 -0
  30. Cython/Compiler/Dataclass.py +890 -0
  31. Cython/Compiler/DebugFlags.py +24 -0
  32. Cython/Compiler/Errors.py +310 -0
  33. Cython/Compiler/ExprNodes.py +15983 -0
  34. Cython/Compiler/FlowControl.cp315-win_amd64.pyd +0 -0
  35. Cython/Compiler/FlowControl.pxd +99 -0
  36. Cython/Compiler/FlowControl.py +1571 -0
  37. Cython/Compiler/FusedNode.cp315-win_amd64.pyd +0 -0
  38. Cython/Compiler/FusedNode.py +976 -0
  39. Cython/Compiler/Future.py +16 -0
  40. Cython/Compiler/Interpreter.py +57 -0
  41. Cython/Compiler/Lexicon.py +422 -0
  42. Cython/Compiler/LineTable.cp315-win_amd64.pyd +0 -0
  43. Cython/Compiler/LineTable.py +114 -0
  44. Cython/Compiler/Main.py +856 -0
  45. Cython/Compiler/MatchCaseNodes.py +2197 -0
  46. Cython/Compiler/MemoryView.py +930 -0
  47. Cython/Compiler/ModuleNode.py +4517 -0
  48. Cython/Compiler/Naming.py +367 -0
  49. Cython/Compiler/Nodes.py +10941 -0
  50. Cython/Compiler/Optimize.py +5455 -0
  51. Cython/Compiler/Options.py +838 -0
  52. Cython/Compiler/ParseTreeTransforms.pxd +79 -0
  53. Cython/Compiler/ParseTreeTransforms.py +4744 -0
  54. Cython/Compiler/Parsing.cp315-win_amd64.pyd +0 -0
  55. Cython/Compiler/Parsing.pxd +9 -0
  56. Cython/Compiler/Parsing.py +4792 -0
  57. Cython/Compiler/Pipeline.py +439 -0
  58. Cython/Compiler/PyrexTypes.py +6111 -0
  59. Cython/Compiler/Pythran.py +232 -0
  60. Cython/Compiler/Scanning.cp315-win_amd64.pyd +0 -0
  61. Cython/Compiler/Scanning.pxd +70 -0
  62. Cython/Compiler/Scanning.py +720 -0
  63. Cython/Compiler/StringEncoding.py +297 -0
  64. Cython/Compiler/Symtab.py +3092 -0
  65. Cython/Compiler/Tests/TestBuffer.py +105 -0
  66. Cython/Compiler/Tests/TestBuiltin.py +117 -0
  67. Cython/Compiler/Tests/TestCmdLine.py +587 -0
  68. Cython/Compiler/Tests/TestCode.py +145 -0
  69. Cython/Compiler/Tests/TestFlowControl.py +65 -0
  70. Cython/Compiler/Tests/TestGrammar.py +202 -0
  71. Cython/Compiler/Tests/TestMemView.py +71 -0
  72. Cython/Compiler/Tests/TestParseTreeTransforms.py +285 -0
  73. Cython/Compiler/Tests/TestScanning.py +132 -0
  74. Cython/Compiler/Tests/TestSignatureMatching.py +73 -0
  75. Cython/Compiler/Tests/TestStringEncoding.py +20 -0
  76. Cython/Compiler/Tests/TestTreeFragment.py +63 -0
  77. Cython/Compiler/Tests/TestTreePath.py +103 -0
  78. Cython/Compiler/Tests/TestTypes.py +118 -0
  79. Cython/Compiler/Tests/TestUtilityLoad.py +112 -0
  80. Cython/Compiler/Tests/TestVisitor.py +61 -0
  81. Cython/Compiler/Tests/Utils.py +36 -0
  82. Cython/Compiler/Tests/__init__.py +1 -0
  83. Cython/Compiler/TreeFragment.py +278 -0
  84. Cython/Compiler/TreePath.py +303 -0
  85. Cython/Compiler/TypeInference.py +611 -0
  86. Cython/Compiler/TypeSlots.py +1329 -0
  87. Cython/Compiler/UFuncs.py +311 -0
  88. Cython/Compiler/UtilNodes.py +413 -0
  89. Cython/Compiler/UtilityCode.py +348 -0
  90. Cython/Compiler/Version.py +8 -0
  91. Cython/Compiler/Visitor.cp315-win_amd64.pyd +0 -0
  92. Cython/Compiler/Visitor.pxd +53 -0
  93. Cython/Compiler/Visitor.py +864 -0
  94. Cython/Compiler/__init__.py +1 -0
  95. Cython/Coverage.py +448 -0
  96. Cython/Debugger/Cygdb.py +177 -0
  97. Cython/Debugger/DebugWriter.py +82 -0
  98. Cython/Debugger/Tests/TestLibCython.py +280 -0
  99. Cython/Debugger/Tests/__init__.py +1 -0
  100. Cython/Debugger/Tests/cfuncs.c +8 -0
  101. Cython/Debugger/Tests/codefile +49 -0
  102. Cython/Debugger/Tests/test_libcython_in_gdb.py +580 -0
  103. Cython/Debugger/Tests/test_libpython_in_gdb.py +90 -0
  104. Cython/Debugger/__init__.py +1 -0
  105. Cython/Debugger/libcython.py +1548 -0
  106. Cython/Debugger/libpython.py +2821 -0
  107. Cython/Debugging.py +20 -0
  108. Cython/Distutils/__init__.py +2 -0
  109. Cython/Distutils/build_ext.py +139 -0
  110. Cython/Distutils/extension.py +96 -0
  111. Cython/Distutils/old_build_ext.py +351 -0
  112. Cython/Includes/cpython/__init__.pxd +173 -0
  113. Cython/Includes/cpython/array.pxd +152 -0
  114. Cython/Includes/cpython/bool.pxd +37 -0
  115. Cython/Includes/cpython/buffer.pxd +112 -0
  116. Cython/Includes/cpython/bytearray.pxd +33 -0
  117. Cython/Includes/cpython/bytes.pxd +200 -0
  118. Cython/Includes/cpython/cellobject.pxd +35 -0
  119. Cython/Includes/cpython/ceval.pxd +8 -0
  120. Cython/Includes/cpython/codecs.pxd +121 -0
  121. Cython/Includes/cpython/complex.pxd +60 -0
  122. Cython/Includes/cpython/contextvars.pxd +145 -0
  123. Cython/Includes/cpython/conversion.pxd +36 -0
  124. Cython/Includes/cpython/datetime.pxd +395 -0
  125. Cython/Includes/cpython/descr.pxd +26 -0
  126. Cython/Includes/cpython/dict.pxd +268 -0
  127. Cython/Includes/cpython/exc.pxd +263 -0
  128. Cython/Includes/cpython/fileobject.pxd +57 -0
  129. Cython/Includes/cpython/float.pxd +56 -0
  130. Cython/Includes/cpython/frozendict.pxd +37 -0
  131. Cython/Includes/cpython/function.pxd +65 -0
  132. Cython/Includes/cpython/genobject.pxd +25 -0
  133. Cython/Includes/cpython/getargs.pxd +12 -0
  134. Cython/Includes/cpython/instance.pxd +25 -0
  135. Cython/Includes/cpython/iterator.pxd +36 -0
  136. Cython/Includes/cpython/iterobject.pxd +24 -0
  137. Cython/Includes/cpython/list.pxd +144 -0
  138. Cython/Includes/cpython/long.pxd +180 -0
  139. Cython/Includes/cpython/longintrepr.pxd +14 -0
  140. Cython/Includes/cpython/mapping.pxd +63 -0
  141. Cython/Includes/cpython/marshal.pxd +66 -0
  142. Cython/Includes/cpython/mem.pxd +120 -0
  143. Cython/Includes/cpython/memoryview.pxd +50 -0
  144. Cython/Includes/cpython/method.pxd +49 -0
  145. Cython/Includes/cpython/module.pxd +208 -0
  146. Cython/Includes/cpython/number.pxd +258 -0
  147. Cython/Includes/cpython/object.pxd +430 -0
  148. Cython/Includes/cpython/pycapsule.pxd +143 -0
  149. Cython/Includes/cpython/pylifecycle.pxd +68 -0
  150. Cython/Includes/cpython/pyport.pxd +8 -0
  151. Cython/Includes/cpython/pystate.pxd +95 -0
  152. Cython/Includes/cpython/pythread.pxd +53 -0
  153. Cython/Includes/cpython/ref.pxd +141 -0
  154. Cython/Includes/cpython/sentinel.pxd +17 -0
  155. Cython/Includes/cpython/sequence.pxd +134 -0
  156. Cython/Includes/cpython/set.pxd +119 -0
  157. Cython/Includes/cpython/slice.pxd +70 -0
  158. Cython/Includes/cpython/time.pxd +129 -0
  159. Cython/Includes/cpython/tuple.pxd +72 -0
  160. Cython/Includes/cpython/type.pxd +146 -0
  161. Cython/Includes/cpython/unicode.pxd +639 -0
  162. Cython/Includes/cpython/version.pxd +32 -0
  163. Cython/Includes/cpython/weakref.pxd +78 -0
  164. Cython/Includes/libc/__init__.pxd +1 -0
  165. Cython/Includes/libc/complex.pxd +35 -0
  166. Cython/Includes/libc/errno.pxd +127 -0
  167. Cython/Includes/libc/float.pxd +43 -0
  168. Cython/Includes/libc/limits.pxd +28 -0
  169. Cython/Includes/libc/locale.pxd +46 -0
  170. Cython/Includes/libc/math.pxd +209 -0
  171. Cython/Includes/libc/setjmp.pxd +10 -0
  172. Cython/Includes/libc/signal.pxd +64 -0
  173. Cython/Includes/libc/stddef.pxd +9 -0
  174. Cython/Includes/libc/stdint.pxd +105 -0
  175. Cython/Includes/libc/stdio.pxd +80 -0
  176. Cython/Includes/libc/stdlib.pxd +72 -0
  177. Cython/Includes/libc/string.pxd +50 -0
  178. Cython/Includes/libc/threads.pxd +234 -0
  179. Cython/Includes/libc/time.pxd +52 -0
  180. Cython/Includes/libcpp/__init__.pxd +4 -0
  181. Cython/Includes/libcpp/algorithm.pxd +320 -0
  182. Cython/Includes/libcpp/any.pxd +16 -0
  183. Cython/Includes/libcpp/atomic.pxd +59 -0
  184. Cython/Includes/libcpp/barrier.pxd +22 -0
  185. Cython/Includes/libcpp/bit.pxd +29 -0
  186. Cython/Includes/libcpp/cast.pxd +12 -0
  187. Cython/Includes/libcpp/cmath.pxd +518 -0
  188. Cython/Includes/libcpp/complex.pxd +106 -0
  189. Cython/Includes/libcpp/condition_variable.pxd +322 -0
  190. Cython/Includes/libcpp/deque.pxd +165 -0
  191. Cython/Includes/libcpp/exception.pxd +216 -0
  192. Cython/Includes/libcpp/execution.pxd +15 -0
  193. Cython/Includes/libcpp/forward_list.pxd +63 -0
  194. Cython/Includes/libcpp/functional.pxd +26 -0
  195. Cython/Includes/libcpp/future.pxd +103 -0
  196. Cython/Includes/libcpp/iterator.pxd +34 -0
  197. Cython/Includes/libcpp/latch.pxd +17 -0
  198. Cython/Includes/libcpp/limits.pxd +61 -0
  199. Cython/Includes/libcpp/list.pxd +117 -0
  200. Cython/Includes/libcpp/map.pxd +252 -0
  201. Cython/Includes/libcpp/memory.pxd +115 -0
  202. Cython/Includes/libcpp/mutex.pxd +387 -0
  203. Cython/Includes/libcpp/numbers.pxd +15 -0
  204. Cython/Includes/libcpp/numeric.pxd +131 -0
  205. Cython/Includes/libcpp/optional.pxd +34 -0
  206. Cython/Includes/libcpp/pair.pxd +1 -0
  207. Cython/Includes/libcpp/queue.pxd +25 -0
  208. Cython/Includes/libcpp/random.pxd +166 -0
  209. Cython/Includes/libcpp/semaphore.pxd +43 -0
  210. Cython/Includes/libcpp/set.pxd +228 -0
  211. Cython/Includes/libcpp/shared_mutex.pxd +96 -0
  212. Cython/Includes/libcpp/span.pxd +87 -0
  213. Cython/Includes/libcpp/stack.pxd +11 -0
  214. Cython/Includes/libcpp/stop_token.pxd +117 -0
  215. Cython/Includes/libcpp/string.pxd +355 -0
  216. Cython/Includes/libcpp/string_view.pxd +183 -0
  217. Cython/Includes/libcpp/typeindex.pxd +15 -0
  218. Cython/Includes/libcpp/typeinfo.pxd +10 -0
  219. Cython/Includes/libcpp/unordered_map.pxd +193 -0
  220. Cython/Includes/libcpp/unordered_set.pxd +152 -0
  221. Cython/Includes/libcpp/utility.pxd +30 -0
  222. Cython/Includes/libcpp/vector.pxd +186 -0
  223. Cython/Includes/numpy/math.pxd +150 -0
  224. Cython/Includes/openmp.pxd +50 -0
  225. Cython/Includes/posix/__init__.pxd +1 -0
  226. Cython/Includes/posix/dlfcn.pxd +14 -0
  227. Cython/Includes/posix/fcntl.pxd +86 -0
  228. Cython/Includes/posix/ioctl.pxd +4 -0
  229. Cython/Includes/posix/mman.pxd +101 -0
  230. Cython/Includes/posix/resource.pxd +57 -0
  231. Cython/Includes/posix/select.pxd +21 -0
  232. Cython/Includes/posix/signal.pxd +73 -0
  233. Cython/Includes/posix/stat.pxd +98 -0
  234. Cython/Includes/posix/stdio.pxd +37 -0
  235. Cython/Includes/posix/stdlib.pxd +29 -0
  236. Cython/Includes/posix/strings.pxd +9 -0
  237. Cython/Includes/posix/time.pxd +71 -0
  238. Cython/Includes/posix/types.pxd +30 -0
  239. Cython/Includes/posix/uio.pxd +26 -0
  240. Cython/Includes/posix/unistd.pxd +271 -0
  241. Cython/Includes/posix/wait.pxd +38 -0
  242. Cython/LZSS.py +170 -0
  243. Cython/Plex/Actions.cp315-win_amd64.pyd +0 -0
  244. Cython/Plex/Actions.pxd +24 -0
  245. Cython/Plex/Actions.py +119 -0
  246. Cython/Plex/DFA.cp315-win_amd64.pyd +0 -0
  247. Cython/Plex/DFA.pxd +14 -0
  248. Cython/Plex/DFA.py +164 -0
  249. Cython/Plex/Errors.py +48 -0
  250. Cython/Plex/Lexicons.py +178 -0
  251. Cython/Plex/Machines.cp315-win_amd64.pyd +0 -0
  252. Cython/Plex/Machines.pxd +36 -0
  253. Cython/Plex/Machines.py +238 -0
  254. Cython/Plex/Regexps.py +535 -0
  255. Cython/Plex/Scanners.cp315-win_amd64.pyd +0 -0
  256. Cython/Plex/Scanners.pxd +45 -0
  257. Cython/Plex/Scanners.py +328 -0
  258. Cython/Plex/Transitions.cp315-win_amd64.pyd +0 -0
  259. Cython/Plex/Transitions.pxd +14 -0
  260. Cython/Plex/Transitions.py +239 -0
  261. Cython/Plex/__init__.py +34 -0
  262. Cython/Runtime/__init__.py +1 -0
  263. Cython/Runtime/refnanny.cp315-win_amd64.pyd +0 -0
  264. Cython/Runtime/refnanny.pyx +237 -0
  265. Cython/Shadow.py +1167 -0
  266. Cython/StringIOTree.cp315-win_amd64.pyd +0 -0
  267. Cython/StringIOTree.py +169 -0
  268. Cython/Tempita/__init__.py +4 -0
  269. Cython/Tempita/_looper.py +154 -0
  270. Cython/Tempita/_tempita.cp315-win_amd64.pyd +0 -0
  271. Cython/Tempita/_tempita.py +1087 -0
  272. Cython/TestUtils.py +464 -0
  273. Cython/Tests/TestCodeWriter.py +128 -0
  274. Cython/Tests/TestCythonUtils.py +202 -0
  275. Cython/Tests/TestJediTyper.py +223 -0
  276. Cython/Tests/TestShadow.py +110 -0
  277. Cython/Tests/TestStringIOTree.py +68 -0
  278. Cython/Tests/TestTestUtils.py +89 -0
  279. Cython/Tests/__init__.py +1 -0
  280. Cython/Tests/xmlrunner.py +390 -0
  281. Cython/Utility/AsyncGen.c +1073 -0
  282. Cython/Utility/Buffer.c +866 -0
  283. Cython/Utility/BufferFormatFromTypeInfo.pxd +2 -0
  284. Cython/Utility/Builtins.c +933 -0
  285. Cython/Utility/CConvert.pyx +149 -0
  286. Cython/Utility/CMath.c +104 -0
  287. Cython/Utility/CommonStructures.c +244 -0
  288. Cython/Utility/Complex.c +378 -0
  289. Cython/Utility/Coroutine.c +2337 -0
  290. Cython/Utility/CpdefEnums.pyx +107 -0
  291. Cython/Utility/CppConvert.pyx +282 -0
  292. Cython/Utility/CppSupport.cpp +151 -0
  293. Cython/Utility/CythonFunction.c +2072 -0
  294. Cython/Utility/Dataclasses.c +101 -0
  295. Cython/Utility/Embed.c +129 -0
  296. Cython/Utility/Exceptions.c +1038 -0
  297. Cython/Utility/ExtensionTypes.c +1158 -0
  298. Cython/Utility/FunctionArguments.c +1045 -0
  299. Cython/Utility/FusedFunction.pyx +44 -0
  300. Cython/Utility/ImportExport.c +930 -0
  301. Cython/Utility/MatchCase.c +979 -0
  302. Cython/Utility/MatchCase_Cy.pyx +12 -0
  303. Cython/Utility/MemoryView.pxd +108 -0
  304. Cython/Utility/MemoryView.pyx +1499 -0
  305. Cython/Utility/MemoryView_C.c +1056 -0
  306. Cython/Utility/ModuleSetupCode.c +3352 -0
  307. Cython/Utility/NumpyImportArray.c +46 -0
  308. Cython/Utility/ObjectHandling.c +3372 -0
  309. Cython/Utility/Optimize.c +2563 -0
  310. Cython/Utility/Overflow.c +378 -0
  311. Cython/Utility/Profile.c +736 -0
  312. Cython/Utility/StringTools.c +1414 -0
  313. Cython/Utility/Synchronization.c +438 -0
  314. Cython/Utility/TString.c +369 -0
  315. Cython/Utility/TestCyUtilityLoader.pyx +8 -0
  316. Cython/Utility/TestCythonScope.pyx +75 -0
  317. Cython/Utility/TestUtilityLoader.c +12 -0
  318. Cython/Utility/TypeConversion.c +1556 -0
  319. Cython/Utility/UFuncs.pyx +50 -0
  320. Cython/Utility/UFuncs_C.c +89 -0
  321. Cython/Utility/__init__.py +28 -0
  322. Cython/Utility/arrayarray.h +172 -0
  323. Cython/Utils.cp315-win_amd64.pyd +0 -0
  324. Cython/Utils.py +677 -0
  325. Cython/__init__.py +12 -0
  326. Cython/py.typed +0 -0
  327. cython-3.3.0a1.dist-info/METADATA +394 -0
  328. cython-3.3.0a1.dist-info/RECORD +335 -0
  329. cython-3.3.0a1.dist-info/WHEEL +5 -0
  330. cython-3.3.0a1.dist-info/entry_points.txt +4 -0
  331. cython-3.3.0a1.dist-info/top_level.txt +3 -0
  332. cython.py +29 -0
  333. pyximport/__init__.py +4 -0
  334. pyximport/pyxbuild.py +160 -0
  335. pyximport/pyximport.py +482 -0
@@ -0,0 +1,933 @@
1
+ /*
2
+ * Special implementations of built-in functions and methods.
3
+ *
4
+ * Optional optimisations for builtins are in Optimize.c.
5
+ *
6
+ * General object operations and protocols are in ObjectHandling.c.
7
+ */
8
+
9
+ //////////////////// Globals.proto ////////////////////
10
+
11
+ static PyObject* __Pyx_Globals(void); /*proto*/
12
+
13
+ //////////////////// Globals ////////////////////
14
+ //@requires: ObjectHandling.c::GetAttr
15
+
16
+ // This is a stub implementation until we have something more complete.
17
+ // Currently, we only handle the most common case of a read-only dict
18
+ // of Python names. Supporting cdef names in the module and write
19
+ // access requires a rewrite as a dedicated class.
20
+
21
+ static PyObject* __Pyx_Globals(void) {
22
+ return __Pyx_NewRef(NAMED_CGLOBAL(moddict_cname));
23
+ }
24
+
25
+ //////////////////// PyExecGlobals.proto ////////////////////
26
+
27
+ static PyObject* __Pyx_PyExecGlobals(PyObject*);
28
+
29
+ //////////////////// PyExecGlobals ////////////////////
30
+ //@requires: PyExec
31
+
32
+ static PyObject* __Pyx_PyExecGlobals(PyObject* code) {
33
+ return __Pyx_PyExec2(code, NAMED_CGLOBAL(moddict_cname));
34
+ }
35
+
36
+ //////////////////// PyExec.proto ////////////////////
37
+
38
+ static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*);
39
+ static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*);
40
+
41
+ //////////////////// PyExec ////////////////////
42
+ //@requires: ObjectHandling.c::RaiseErrorWithObjectType
43
+
44
+ static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) {
45
+ return __Pyx_PyExec3(o, globals, NULL);
46
+ }
47
+
48
+ static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) {
49
+ PyObject* result;
50
+ #if !CYTHON_COMPILING_IN_LIMITED_API
51
+ PyObject* s = 0;
52
+ char *code = 0;
53
+ #endif
54
+
55
+ if (!globals || globals == Py_None) {
56
+ globals = NAMED_CGLOBAL(moddict_cname);
57
+ }
58
+ #if !CYTHON_COMPILING_IN_LIMITED_API
59
+ // In Limited API we just use exec builtin which already has this
60
+ else if (unlikely(!PyDict_Check(globals))) {
61
+ __Pyx_RaiseTypeErrorWithObjectType(
62
+ "exec() arg 2 must be a dict, not " __Pyx_FMT_TYPENAME, globals);
63
+ goto bad;
64
+ }
65
+ #endif
66
+ if (!locals || locals == Py_None) {
67
+ locals = globals;
68
+ }
69
+
70
+ #if !CYTHON_COMPILING_IN_LIMITED_API
71
+ if (__Pyx_PyDict_GetItemStr(globals, PYIDENT("__builtins__")) == NULL) {
72
+ if (unlikely(PyDict_SetItem(globals, PYIDENT("__builtins__"), PyEval_GetBuiltins()) < 0))
73
+ goto bad;
74
+ }
75
+
76
+ if (PyCode_Check(o)) {
77
+ if (unlikely(__Pyx_PyCode_HasFreeVars((PyCodeObject *)o))) {
78
+ PyErr_SetString(PyExc_TypeError,
79
+ "code object passed to exec() may not contain free variables");
80
+ goto bad;
81
+ }
82
+ #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400
83
+ result = PyEval_EvalCode((PyCodeObject *)o, globals, locals);
84
+ #else
85
+ result = PyEval_EvalCode(o, globals, locals);
86
+ #endif
87
+ } else {
88
+ PyCompilerFlags cf;
89
+ cf.cf_flags = 0;
90
+ cf.cf_feature_version = PY_MINOR_VERSION;
91
+ if (PyUnicode_Check(o)) {
92
+ cf.cf_flags = PyCF_SOURCE_IS_UTF8;
93
+ s = PyUnicode_AsUTF8String(o);
94
+ if (unlikely(!s)) goto bad;
95
+ o = s;
96
+ } else if (unlikely(!PyBytes_Check(o))) {
97
+ __Pyx_RaiseTypeErrorWithObjectType(
98
+ "exec: arg 1 must be string, bytes or code object, got " __Pyx_FMT_TYPENAME, o);
99
+ goto bad;
100
+ }
101
+ code = PyBytes_AS_STRING(o);
102
+ if (PyEval_MergeCompilerFlags(&cf)) {
103
+ result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf);
104
+ } else {
105
+ result = PyRun_String(code, Py_file_input, globals, locals);
106
+ }
107
+ Py_XDECREF(s);
108
+ }
109
+
110
+ return result;
111
+ bad:
112
+ Py_XDECREF(s);
113
+ return 0;
114
+ #else // CYTHON_COMPILING_IN_LIMITED_API
115
+ {
116
+ // For the limited API we just defer to the actual builtin
117
+ // (after setting up globals and locals) - there's too much we can't do otherwise
118
+ PyObject *builtins, *exec, *exec_str;
119
+ builtins = PyEval_GetBuiltins();
120
+ if (!builtins) return NULL;
121
+ exec_str = PyUnicode_FromStringAndSize("exec", 4);
122
+ if (!exec_str) return NULL;
123
+ exec = PyObject_GetItem(builtins, exec_str);
124
+ Py_DECREF(exec_str);
125
+ if (!exec) return NULL;
126
+ result = PyObject_CallFunctionObjArgs(exec, o, globals, locals, NULL);
127
+ Py_DECREF(exec);
128
+ return result;
129
+ }
130
+ #endif
131
+ }
132
+
133
+ //////////////////// GetAttr3.proto ////////////////////
134
+
135
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/
136
+
137
+ //////////////////// GetAttr3 ////////////////////
138
+ //@requires: ObjectHandling.c::PyObjectGetAttrStr
139
+ //@requires: Exceptions.c::PyThreadStateGet
140
+ //@requires: Exceptions.c::PyErrFetchRestore
141
+ //@requires: Exceptions.c::PyErrExceptionMatches
142
+
143
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
144
+ static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
145
+ __Pyx_PyThreadState_declare
146
+ __Pyx_PyThreadState_assign
147
+ if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
148
+ return NULL;
149
+ __Pyx_PyErr_Clear();
150
+ Py_INCREF(d);
151
+ return d;
152
+ }
153
+ #endif
154
+
155
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
156
+ PyObject *r;
157
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
158
+ int res = PyObject_GetOptionalAttr(o, n, &r);
159
+ // On failure (res == -1), r is set to NULL.
160
+ return (res != 0) ? r : __Pyx_NewRef(d);
161
+ #else
162
+ #if CYTHON_USE_TYPE_SLOTS
163
+ if (likely(PyUnicode_Check(n))) {
164
+ r = __Pyx_PyObject_GetAttrStrNoError(o, n);
165
+ if (unlikely(!r) && likely(!PyErr_Occurred())) {
166
+ r = __Pyx_NewRef(d);
167
+ }
168
+ return r;
169
+ }
170
+ #endif
171
+ r = PyObject_GetAttr(o, n);
172
+ return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
173
+ #endif
174
+ }
175
+
176
+ //////////////////// HasAttr.proto ////////////////////
177
+
178
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
179
+ #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
180
+ #else
181
+ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /*proto*/
182
+ #endif
183
+
184
+ //////////////////// HasAttr ////////////////////
185
+ //@requires: ObjectHandling.c::PyObjectGetAttrStrNoError
186
+
187
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
188
+ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
189
+ PyObject *r;
190
+ if (unlikely(!PyUnicode_Check(n))) {
191
+ PyErr_SetString(PyExc_TypeError,
192
+ "hasattr(): attribute name must be string");
193
+ return -1;
194
+ }
195
+ r = __Pyx_PyObject_GetAttrStrNoError(o, n);
196
+ if (!r) {
197
+ return (unlikely(PyErr_Occurred())) ? -1 : 0;
198
+ } else {
199
+ Py_DECREF(r);
200
+ return 1;
201
+ }
202
+ }
203
+ #endif
204
+
205
+ //////////////////// Intern.proto ////////////////////
206
+
207
+ static PyObject* __Pyx_Intern(PyObject* s); /* proto */
208
+
209
+ //////////////////// Intern ////////////////////
210
+ //@requires: ObjectHandling.c::RaiseUnexpectedTypeError
211
+
212
+ static PyObject* __Pyx_Intern(PyObject* s) {
213
+ if (unlikely(!PyUnicode_CheckExact(s))) {
214
+ __Pyx_RaiseUnexpectedTypeError("str", s);
215
+ return NULL;
216
+ }
217
+ Py_INCREF(s);
218
+ PyUnicode_InternInPlace(&s);
219
+ return s;
220
+ }
221
+
222
+ //////////////////// abs_longlong.proto ////////////////////
223
+ //@requires: ModuleSetupCode.c::IncludeStdlibH
224
+
225
+ static CYTHON_INLINE PY_LONG_LONG __Pyx_abs_longlong(PY_LONG_LONG x) {
226
+ #if defined (__cplusplus) && __cplusplus >= 201103L
227
+ return std::abs(x);
228
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
229
+ return llabs(x);
230
+ #elif defined (_MSC_VER)
231
+ // abs() is defined for long, but 64-bits type on MSVC is long long.
232
+ // Use MS-specific _abs64() instead, which returns the original (negative) value for abs(-MAX-1)
233
+ return _abs64(x);
234
+ #elif defined (__GNUC__)
235
+ // gcc or clang on 64 bit windows.
236
+ return __builtin_llabs(x);
237
+ #else
238
+ if (sizeof(PY_LONG_LONG) <= sizeof(Py_ssize_t))
239
+ return __Pyx_sst_abs(x);
240
+ return (x<0) ? -x : x;
241
+ #endif
242
+ }
243
+
244
+
245
+ //////////////////// py_abs.proto ////////////////////
246
+
247
+ #if CYTHON_USE_PYLONG_INTERNALS
248
+ static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);/*proto*/
249
+
250
+ #define __Pyx_PyNumber_Absolute(x) \
251
+ ((likely(PyLong_CheckExact(x))) ? \
252
+ (likely(__Pyx_PyLong_IsNonNeg(x)) ? __Pyx_NewRef(x) : __Pyx_PyLong_AbsNeg(x)) : \
253
+ PyNumber_Absolute(x))
254
+
255
+ #else
256
+ #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x)
257
+ #endif
258
+
259
+ //////////////////// py_abs ////////////////////
260
+
261
+ #if CYTHON_USE_PYLONG_INTERNALS
262
+ static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
263
+ #if PY_VERSION_HEX >= 0x030C00A7
264
+ if (likely(__Pyx_PyLong_IsCompact(n))) {
265
+ return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n));
266
+ }
267
+ #else
268
+ if (likely(Py_SIZE(n) == -1)) {
269
+ // digits are unsigned
270
+ return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]);
271
+ }
272
+ #endif
273
+ #if CYTHON_COMPILING_IN_CPYTHON
274
+ {
275
+ PyObject *copy = _PyLong_Copy((PyLongObject*)n);
276
+ if (likely(copy)) {
277
+ #if PY_VERSION_HEX >= 0x030C00A7
278
+ // clear the sign bits to set the sign from SIGN_NEGATIVE (2) to positive (0)
279
+ ((PyLongObject*)copy)->long_value.lv_tag ^= ((PyLongObject*)copy)->long_value.lv_tag & _PyLong_SIGN_MASK;
280
+ #else
281
+ // negate the size to swap the sign
282
+ Py_SET_SIZE(copy, -Py_SIZE(copy));
283
+ #endif
284
+ }
285
+ return copy;
286
+ }
287
+ #else
288
+ return PyNumber_Negative(n);
289
+ #endif
290
+ }
291
+ #endif
292
+
293
+
294
+ //////////////////// pow2.proto ////////////////////
295
+
296
+ #define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None)
297
+
298
+
299
+ //////////////////// divmod_int.proto //////////////////
300
+
301
+ static const {{RETURN_TYPE}} __Pyx_divmod_ERROR_VALUE_{{CFUNC_SUFFIX}} = {-1, -1};
302
+
303
+ static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b); /*proto*/
304
+
305
+
306
+ //////////////////// divmod_int //////////////////
307
+
308
+ static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b) {
309
+ // Python and C/C++ use different algorithms in calculating quotients and remainders.
310
+ // This results in different answers between Python and C/C++
311
+ // when the dividend is negative and the divisor is positive and vice versa.
312
+ {{TYPE}} q, r;
313
+ if (unlikely(b == 0)) {
314
+ {{if NOGIL}}PyGILState_STATE gilstate = PyGILState_Ensure();{{endif}}
315
+ PyErr_SetString(PyExc_ZeroDivisionError, "division by zero");
316
+ {{if NOGIL}}PyGILState_Release(gilstate);{{endif}}
317
+ return __Pyx_divmod_ERROR_VALUE_{{CFUNC_SUFFIX}};
318
+ } else if (a == 0) {
319
+ q = 0;
320
+ r = 0;
321
+ } else if ((a < 0) != (b < 0)) {
322
+ // see CMath.c :: DivInt and ModInt utility code
323
+ q = a / b;
324
+ r = a - q * b;
325
+ {{TYPE}} adapt_python = ((r != 0) & ((r < 0) ^ (b < 0)));
326
+ q -= adapt_python;
327
+ r += adapt_python * b;
328
+ }
329
+ else {
330
+ q = a / b;
331
+ r = a % b;
332
+ }
333
+
334
+ {{RETURN_TYPE}} c_result = {q, r};
335
+ return c_result;
336
+ }
337
+
338
+
339
+ //////////////////// divmod_float.proto //////////////////
340
+
341
+ static const {{RETURN_TYPE}} __Pyx_divmod_ERROR_VALUE_{{CFUNC_SUFFIX}} = {-1.0, -1.0};
342
+
343
+ static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b); /*proto*/
344
+
345
+
346
+ //////////////////// divmod_float //////////////////
347
+
348
+ static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b) {
349
+ // Python and C/C++ use different algorithms in calculating quotients and remainders.
350
+ // This results in different answers between Python and C/C++
351
+ // when the dividend is negative and the divisor is positive and vice versa.
352
+
353
+ // Adapted from CPython 3.14: floatobject.c / _float_div_mod()
354
+
355
+ {{TYPE}} q, r, div;
356
+
357
+ if (unlikely(b == 0.0)) {
358
+ {{if NOGIL}}PyGILState_STATE gilstate = PyGILState_Ensure();{{endif}}
359
+ PyErr_SetString(PyExc_ZeroDivisionError, "division by zero");
360
+ {{if NOGIL}}PyGILState_Release(gilstate);{{endif}}
361
+ return __Pyx_divmod_ERROR_VALUE_{{CFUNC_SUFFIX}};
362
+ }
363
+
364
+ r = fmod{{MATH_SUFFIX}}(a, b);
365
+ // fmod is typically exact, so a-mod is *mathematically* an
366
+ // exact multiple of b. But this is fp arithmetic, and fp
367
+ // a - mod is an approximation; the result is that div may
368
+ // not be an exact integral value after the division, although
369
+ // it will always be very close to one.
370
+ div = (a - r) / b;
371
+ if (r) {
372
+ // ensure the remainder has the same sign as the denominator
373
+ if ((b < 0) != (r < 0)) {
374
+ r += b;
375
+ div -= 1.0;
376
+ }
377
+ }
378
+ else {
379
+ // the remainder is zero, and in the presence of signed zeroes
380
+ // fmod returns different results across platforms; ensure
381
+ // it has the same sign as the denominator.
382
+ r = copysign{{MATH_SUFFIX}}(0.0, b);
383
+ }
384
+ // snap quotient to nearest integral value
385
+ if (div) {
386
+ q = floor{{MATH_SUFFIX}}(div);
387
+ if (div - q > 0.5) {
388
+ q += 1.0;
389
+ }
390
+ }
391
+ else {
392
+ // div is zero - get the same sign as the true quotient
393
+ q = copysign{{MATH_SUFFIX}}(0.0, a / b); /* zero w/ sign of a/b */
394
+ }
395
+
396
+ {{RETURN_TYPE}} c_result = {q, r};
397
+ return c_result;
398
+ }
399
+
400
+
401
+ //////////////////// int_pyucs4.proto ////////////////////
402
+
403
+ static CYTHON_INLINE int __Pyx_int_from_UCS4(Py_UCS4 uchar);
404
+
405
+ //////////////////// int_pyucs4 ////////////////////
406
+
407
+ static int __Pyx_int_from_UCS4(Py_UCS4 uchar) {
408
+ // Fast path for ascii digits
409
+ if (likely(uchar >= (Py_UCS4)'0' && uchar <= (Py_UCS4)'9')) {
410
+ return uchar - (Py_UCS4)'0';
411
+ }
412
+ #if CYTHON_COMPILING_IN_LIMITED_API
413
+ PyObject *u = PyUnicode_FromOrdinal(uchar);
414
+ if (unlikely(!u)) return -1;
415
+ PyObject *l = PyObject_CallFunctionObjArgs((PyObject*)(&PyLong_Type), u, NULL);
416
+ Py_DECREF(u);
417
+ if (unlikely(!l)) return -1;
418
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
419
+ int result = PyLong_AsInt(l);
420
+ #else
421
+ // just don't handle overflow - it's very difficult to see how we'll get it from
422
+ // a single digit.
423
+ int result = (int)PyLong_AsLong(l);
424
+ #endif
425
+ Py_DECREF(l);
426
+ return result;
427
+ #else
428
+ int digit = Py_UNICODE_TODECIMAL(uchar);
429
+ if (unlikely(digit < 0)) {
430
+ PyErr_Format(PyExc_ValueError,
431
+ "invalid literal for int() with base 10: '%c'",
432
+ (int) uchar);
433
+ return -1;
434
+ }
435
+ return digit;
436
+ #endif
437
+ }
438
+
439
+
440
+ //////////////////// float_pyucs4.proto ////////////////////
441
+
442
+ static CYTHON_INLINE double __Pyx_double_from_UCS4(Py_UCS4 uchar);
443
+
444
+ //////////////////// float_pyucs4 ////////////////////
445
+
446
+ static double __Pyx_double_from_UCS4(Py_UCS4 uchar) {
447
+ // fast path for "just an ascii digit"
448
+ if (likely(uchar >= (Py_UCS4)'0' && uchar <= (Py_UCS4)'9')) {
449
+ return uchar - (Py_UCS4)'0';
450
+ }
451
+ #if CYTHON_COMPILING_IN_LIMITED_API
452
+ PyObject *u = PyUnicode_FromOrdinal(uchar);
453
+ if (unlikely(!u)) return -1.0;
454
+ PyObject *f = PyFloat_FromString(u);
455
+ Py_DECREF(u);
456
+ if (unlikely(!f)) return -1.0;
457
+ double result = PyFloat_AsDouble(f);
458
+ Py_DECREF(f);
459
+ return result;
460
+ #else
461
+ // ...TONUMERIC would initially seem to be a better fit.
462
+ // However, that accepts things like the "half" symbol, while
463
+ // float(string) rejects those.
464
+ double digit = Py_UNICODE_TODECIMAL(uchar);
465
+ if (unlikely(digit < 0.0)) {
466
+ PyErr_Format(PyExc_ValueError,
467
+ "could not convert string to float: '%c'",
468
+ (int) uchar);
469
+ return -1.0;
470
+ }
471
+ return digit;
472
+ #endif
473
+ }
474
+
475
+
476
+ //////////////////// object_ord.proto ////////////////////
477
+ //@requires: TypeConversion.c::UnicodeAsUCS4
478
+
479
+ #define __Pyx_PyObject_Ord(c) \
480
+ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
481
+ static long __Pyx__PyObject_Ord(PyObject* c); /*proto*/
482
+
483
+ //////////////////// object_ord ////////////////////
484
+ //@requires: ObjectHandling.c::RaiseErrorWithObjectType
485
+
486
+ static long __Pyx__PyObject_Ord(PyObject* c) {
487
+ Py_ssize_t size;
488
+ if (PyBytes_Check(c)) {
489
+ size = __Pyx_PyBytes_GET_SIZE(c);
490
+ if (likely(size == 1)) {
491
+ #if CYTHON_ASSUME_SAFE_MACROS
492
+ return (unsigned char) PyBytes_AS_STRING(c)[0];
493
+ #else
494
+ char *data = PyBytes_AsString(c);
495
+ if (unlikely(!data)) return -1;
496
+ return (unsigned char) data[0];
497
+ #endif
498
+ }
499
+ #if !CYTHON_ASSUME_SAFE_SIZE
500
+ else if (unlikely(size < 0)) return -1;
501
+ #endif
502
+ } else if (PyByteArray_Check(c)) {
503
+ size = __Pyx_PyByteArray_GET_SIZE(c);
504
+ if (likely(size == 1)) {
505
+ #if CYTHON_ASSUME_SAFE_MACROS
506
+ return (unsigned char) PyByteArray_AS_STRING(c)[0];
507
+ #else
508
+ char *data = PyByteArray_AsString(c);
509
+ if (unlikely(!data)) return -1;
510
+ return (unsigned char) data[0];
511
+ #endif
512
+ }
513
+ #if !CYTHON_ASSUME_SAFE_SIZE
514
+ else if (unlikely(size < 0)) return -1;
515
+ #endif
516
+ } else {
517
+ // FIXME: support character buffers - but CPython doesn't support them either
518
+ __Pyx_RaiseTypeErrorWithObjectType(
519
+ "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", c);
520
+ return (long)(Py_UCS4)-1;
521
+ }
522
+ PyErr_Format(PyExc_TypeError,
523
+ "ord() expected a character, but string of length %zd found", size);
524
+ return (long)(Py_UCS4)-1;
525
+ }
526
+
527
+
528
+ //////////////////// py_dict_keys.proto ////////////////////
529
+
530
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); /*proto*/
531
+
532
+ //////////////////// py_dict_keys ////////////////////
533
+
534
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
535
+ return CALL_UNBOUND_METHOD(PyDict_Type, "keys", d);
536
+ }
537
+
538
+ //////////////////// py_frozendict_keys.proto ////////////////////
539
+
540
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_Keys(PyObject* d); /*proto*/
541
+
542
+ //////////////////// py_frozendict_keys ////////////////////
543
+
544
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_Keys(PyObject* d) {
545
+ return CALL_UNBOUND_METHOD_TYPEPTR(__Pyx_PyFrozenDict_TypePtr, "keys", d);
546
+ }
547
+
548
+ //////////////////// py_dict_values.proto ////////////////////
549
+
550
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); /*proto*/
551
+
552
+ //////////////////// py_dict_values ////////////////////
553
+
554
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
555
+ return CALL_UNBOUND_METHOD(PyDict_Type, "values", d);
556
+ }
557
+
558
+ //////////////////// py_frozendict_values.proto ////////////////////
559
+
560
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_Values(PyObject* d); /*proto*/
561
+
562
+ //////////////////// py_frozendict_values ////////////////////
563
+
564
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_Values(PyObject* d) {
565
+ return CALL_UNBOUND_METHOD_TYPEPTR(__Pyx_PyFrozenDict_TypePtr, "values", d);
566
+ }
567
+
568
+ //////////////////// py_dict_items.proto ////////////////////
569
+
570
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /*proto*/
571
+
572
+ //////////////////// py_dict_items ////////////////////
573
+
574
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
575
+ return CALL_UNBOUND_METHOD(PyDict_Type, "items", d);
576
+ }
577
+
578
+ //////////////////// py_frozendict_items.proto ////////////////////
579
+
580
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_Items(PyObject* d); /*proto*/
581
+
582
+ //////////////////// py_frozendict_items ////////////////////
583
+
584
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_Items(PyObject* d) {
585
+ return CALL_UNBOUND_METHOD_TYPEPTR(__Pyx_PyFrozenDict_TypePtr, "items", d);
586
+ }
587
+
588
+ //////////////////// py_dict_iterkeys.proto ////////////////////
589
+
590
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterKeys(PyObject* d); /*proto*/
591
+
592
+ //////////////////// py_dict_iterkeys ////////////////////
593
+
594
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterKeys(PyObject* d) {
595
+ return CALL_UNBOUND_METHOD(PyDict_Type, "keys", d);
596
+ }
597
+
598
+ //////////////////// py_dict_itervalues.proto ////////////////////
599
+
600
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterValues(PyObject* d); /*proto*/
601
+
602
+ //////////////////// py_dict_itervalues ////////////////////
603
+
604
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterValues(PyObject* d) {
605
+ return CALL_UNBOUND_METHOD(PyDict_Type, "values", d);
606
+ }
607
+
608
+ //////////////////// py_dict_iteritems.proto ////////////////////
609
+
610
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterItems(PyObject* d); /*proto*/
611
+
612
+ //////////////////// py_dict_iteritems ////////////////////
613
+
614
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterItems(PyObject* d) {
615
+ return CALL_UNBOUND_METHOD(PyDict_Type, "items", d);
616
+ }
617
+
618
+ //////////////////// py_dict_viewkeys.proto ////////////////////
619
+
620
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewKeys(PyObject* d); /*proto*/
621
+
622
+ //////////////////// py_dict_viewkeys ////////////////////
623
+
624
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewKeys(PyObject* d) {
625
+ return CALL_UNBOUND_METHOD(PyDict_Type, "keys", d);
626
+ }
627
+
628
+ //////////////////// py_dict_viewvalues.proto ////////////////////
629
+
630
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewValues(PyObject* d); /*proto*/
631
+
632
+ //////////////////// py_dict_viewvalues ////////////////////
633
+
634
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewValues(PyObject* d) {
635
+ return CALL_UNBOUND_METHOD(PyDict_Type, "values", d);
636
+ }
637
+
638
+ //////////////////// py_dict_viewitems.proto ////////////////////
639
+
640
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewItems(PyObject* d); /*proto*/
641
+
642
+ //////////////////// py_dict_viewitems ////////////////////
643
+
644
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewItems(PyObject* d) {
645
+ return CALL_UNBOUND_METHOD(PyDict_Type, "items", d);
646
+ }
647
+
648
+
649
+ /////////////// dict_setdefault.proto ///////////////
650
+
651
+ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); /*proto*/
652
+
653
+ /////////////// dict_setdefault ///////////////
654
+
655
+ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
656
+ PyObject* value;
657
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
658
+ PyDict_SetDefaultRef(d, key, default_value, &value);
659
+ #elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
660
+ PyObject *args[] = {d, key, default_value};
661
+ value = PyObject_VectorcallMethod(PYIDENT("setdefault"), args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
662
+ #elif CYTHON_COMPILING_IN_LIMITED_API
663
+ value = PyObject_CallMethodObjArgs(d, PYIDENT("setdefault"), key, default_value, NULL);
664
+ #else
665
+ value = PyDict_SetDefault(d, key, default_value);
666
+ if (unlikely(!value)) return NULL;
667
+ Py_INCREF(value);
668
+ #endif
669
+ return value;
670
+ }
671
+
672
+
673
+ //////////////////// pyfrozenset_new.proto ////////////////////
674
+
675
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);
676
+
677
+ //////////////////// pyfrozenset_new ////////////////////
678
+ //@requires: ObjectHandling.c::PyObjectCallNoArg
679
+
680
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
681
+ if (it) {
682
+ PyObject* result;
683
+ #if CYTHON_COMPILING_IN_PYPY
684
+ // PyPy currently lacks PyFrozenSet_CheckExact() and PyFrozenSet_New()
685
+ PyObject* args;
686
+ args = PyTuple_Pack(1, it);
687
+ if (unlikely(!args))
688
+ return NULL;
689
+ result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
690
+ Py_DECREF(args);
691
+ return result;
692
+ #else
693
+ if (PyFrozenSet_CheckExact(it)) {
694
+ Py_INCREF(it);
695
+ return it;
696
+ }
697
+ result = PyFrozenSet_New(it);
698
+ if (unlikely(!result))
699
+ return NULL;
700
+ if ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
701
+ #if CYTHON_COMPILING_IN_LIMITED_API
702
+ || __Pyx_get_runtime_version() >= 0x030A0000
703
+ #endif
704
+ )
705
+ return result;
706
+ {
707
+ Py_ssize_t size = __Pyx_PySet_GET_SIZE(result);
708
+ if (likely(size > 0))
709
+ return result;
710
+ #if !CYTHON_ASSUME_SAFE_SIZE
711
+ if (unlikely(size < 0)) {
712
+ Py_DECREF(result);
713
+ return NULL;
714
+ }
715
+ #endif
716
+ }
717
+ // empty frozenset is a singleton (on Python <3.10)
718
+ // seems wasteful, but CPython does the same
719
+ Py_DECREF(result);
720
+ #endif
721
+ }
722
+ return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type);
723
+ }
724
+
725
+
726
+ //////////////////// PySet_Update.proto ////////////////////
727
+
728
+ static CYTHON_INLINE int __Pyx_PySet_Update(PyObject* set, PyObject* it); /*proto*/
729
+
730
+ //////////////////// PySet_Update ////////////////////
731
+
732
+ static CYTHON_INLINE int __Pyx_PySet_Update(PyObject* set, PyObject* it) {
733
+ PyObject *retval;
734
+ #if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
735
+ if (PyAnySet_Check(it)) {
736
+ Py_ssize_t size = __Pyx_PySet_GET_SIZE(it);
737
+ #if !CYTHON_ASSUME_SAFE_SIZE
738
+ if (unlikely(size < 0)) return -1;
739
+ #endif
740
+ if (size == 0)
741
+ return 0;
742
+ // fast and safe case: CPython will update our result set and return it
743
+ retval = PySet_Type.tp_as_number->nb_inplace_or(set, it);
744
+ if (likely(retval == set)) {
745
+ Py_DECREF(retval);
746
+ return 0;
747
+ }
748
+ if (unlikely(!retval))
749
+ return -1;
750
+ // unusual result, fall through to set.update() call below
751
+ Py_DECREF(retval);
752
+ }
753
+ #endif
754
+ retval = CALL_UNBOUND_METHOD(PySet_Type, "update", set, it);
755
+ if (unlikely(!retval)) return -1;
756
+ Py_DECREF(retval);
757
+ return 0;
758
+ }
759
+
760
+ //////////////////// PyRange_Check.proto ////////////////////
761
+
762
+ #if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check)
763
+ #define PyRange_Check(obj) __Pyx_TypeCheck((obj), &PyRange_Type)
764
+ #endif
765
+
766
+
767
+ ///////////////// memoryview_get_from_buffer.proto ////////////////////
768
+
769
+ #if !CYTHON_COMPILING_IN_LIMITED_API
770
+ #define __Pyx_PyMemoryView_Get_{{name}}(o) PyMemoryView_GET_BUFFER(o)->{{name}}
771
+ #else
772
+ {{py:
773
+ out_types = dict(
774
+ ndim='int', readonly='int',
775
+ len='Py_ssize_t', itemsize='Py_ssize_t')
776
+ }} // can't get format like this unfortunately. It's unicode via getattr
777
+ {{py: out_type = out_types[name]}}
778
+ static {{out_type}} __Pyx_PyMemoryView_Get_{{name}}(PyObject *obj); /* proto */
779
+ #endif
780
+
781
+ ////////////// memoryview_get_from_buffer /////////////////////////
782
+
783
+ #if !CYTHON_COMPILING_IN_LIMITED_API
784
+ #else
785
+ {{py:
786
+ out_types = dict(
787
+ ndim='int', readonly='int',
788
+ len='Py_ssize_t', itemsize='Py_ssize_t')
789
+ }}
790
+ {{py: out_type = out_types[name]}}
791
+ static {{out_type}} __Pyx_PyMemoryView_Get_{{name}}(PyObject *obj) {
792
+ {{out_type}} result;
793
+ PyObject *attr = PyObject_GetAttr(obj, PYIDENT("{{name}}"));
794
+ if (!attr) {
795
+ goto bad;
796
+ }
797
+ {{if out_type == 'int'}}
798
+ // I'm not worrying about overflow here because
799
+ // ultimately it comes from a C struct that's an int
800
+ result = PyLong_AsLong(attr);
801
+ {{elif out_type == 'Py_ssize_t'}}
802
+ result = PyLong_AsSsize_t(attr);
803
+ {{endif}}
804
+ Py_DECREF(attr);
805
+ return result;
806
+
807
+ bad:
808
+ Py_XDECREF(attr);
809
+ return -1;
810
+ }
811
+ #endif
812
+
813
+ ////////////// PySliceAccessors.proto /////////////////////////
814
+
815
+ #if CYTHON_COMPILING_IN_LIMITED_API
816
+ #define __Pyx_PySlice_Start(o) PyObject_GetAttr(o, PYIDENT("start"))
817
+ #define __Pyx_PySlice_Stop(o) PyObject_GetAttr(o, PYIDENT("stop"))
818
+ #define __Pyx_PySlice_Step(o) PyObject_GetAttr(o, PYIDENT("step"))
819
+ #elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
820
+ // Graal defines it's own accessor functions
821
+ #define __Pyx_PySlice_Start(o) GraalPySlice_Start(o)
822
+ #define __Pyx_PySlice_Stop(o) GraalPySlice_Stop(o)
823
+ #define __Pyx_PySlice_Step(o) GraalPySlice_Step(o)
824
+ #elif CYTHON_COMPILING_IN_GRAAL
825
+ // Remove when GraalPy 24 goes EOL
826
+ #define __Pyx_PySlice_Start(o) __Pyx_NewRef(PySlice_Start((PySliceObject*)o))
827
+ #define __Pyx_PySlice_Stop(o) __Pyx_NewRef(PySlice_Stop((PySliceObject*)o))
828
+ #define __Pyx_PySlice_Step(o) __Pyx_NewRef(PySlice_Step((PySliceObject*)o))
829
+ #else
830
+ #define __Pyx_PySlice_Start(o) __Pyx_NewRef(((PySliceObject*)o)->start)
831
+ #define __Pyx_PySlice_Stop(o) __Pyx_NewRef(((PySliceObject*)o)->stop)
832
+ #define __Pyx_PySlice_Step(o) __Pyx_NewRef(((PySliceObject*)o)->step)
833
+ #endif
834
+
835
+
836
+ ////////////// PyFrozenDict.proto /////////////////////////
837
+
838
+ #if CYTHON_COMPILING_IN_LIMITED_API
839
+ // PyFrozenDict is not currently in the Limited API.
840
+
841
+ #define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) CGLOBAL(__Pyx_PyFrozenDictType))
842
+
843
+ #define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(CGLOBAL(__Pyx_PyFrozenDictType), it)
844
+ static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it); /*proto*/
845
+
846
+ #define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
847
+ #define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
848
+ #define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
849
+
850
+ #define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
851
+ static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
852
+ return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
853
+ }
854
+ #define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
855
+ static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
856
+ return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
857
+ }
858
+
859
+ #elif PY_VERSION_HEX >= 0x030f00a6 || \
860
+ (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
861
+ #define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
862
+ #define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
863
+ #define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
864
+ #define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
865
+ #define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
866
+ #define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
867
+ #define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
868
+
869
+ #else
870
+ // Replacing PyFrozenDict with PyDict for older Python versions seems reasonable and helpful.
871
+ #define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
872
+
873
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
874
+ if (!it) {
875
+ return PyDict_New();
876
+ } else if (PyDict_Check(it)) {
877
+ return PyDict_Copy(it);
878
+ } else {
879
+ PyObject *dict = PyDict_New();
880
+ if (!dict) return NULL;
881
+ // PyDict_Merge() and friends do not handle arbitrary iterables. '|' does.
882
+ PyObject *result = PyNumber_InPlaceOr(dict, it);
883
+ Py_DECREF(dict);
884
+ return result;
885
+ }
886
+ }
887
+ #define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
888
+ #define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
889
+ #define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
890
+ #define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
891
+ #define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
892
+ #endif
893
+
894
+ /////////////////// PyFrozenDict.module_state_decls //////////
895
+
896
+ #if CYTHON_COMPILING_IN_LIMITED_API
897
+ PyObject *__Pyx_PyFrozenDictType;
898
+ #endif
899
+
900
+ ////////////// PyFrozenDict /////////////////////////
901
+
902
+ #if CYTHON_COMPILING_IN_LIMITED_API
903
+ static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
904
+ return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
905
+ }
906
+ #endif
907
+
908
+ ////////////////// PyFrozenDict.init ////////////////
909
+
910
+ #if CYTHON_COMPILING_IN_LIMITED_API
911
+ {
912
+ PyObject *builtins = PyEval_GetBuiltins(); // borrowed
913
+ if (likely(builtins)) {
914
+ PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
915
+ if (likely(type_name)) {
916
+ PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
917
+ Py_DECREF(type_name);
918
+ if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
919
+ PyErr_Clear();
920
+ frozendict_type = (PyObject*) &PyDict_Type;
921
+ Py_INCREF(frozendict_type);
922
+ }
923
+ CGLOBAL(__Pyx_PyFrozenDictType) = frozendict_type;
924
+ }
925
+ }
926
+ } // error handling follows
927
+ #endif
928
+
929
+ /////////////// PyFrozenDict.cleanup ////////////////
930
+
931
+ #if CYTHON_COMPILING_IN_LIMITED_API
932
+ Py_CLEAR(CGLOBAL(__Pyx_PyFrozenDictType));
933
+ #endif