Nuitka-winsvc 2.7.7__cp313-cp313-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.

Potentially problematic release.


This version of Nuitka-winsvc might be problematic. Click here for more details.

Files changed (995) hide show
  1. nuitka/Builtins.py +259 -0
  2. nuitka/BytecodeCaching.py +184 -0
  3. nuitka/Bytecodes.py +109 -0
  4. nuitka/CacheCleanup.py +54 -0
  5. nuitka/Constants.py +425 -0
  6. nuitka/Errors.py +93 -0
  7. nuitka/HardImportRegistry.py +408 -0
  8. nuitka/MainControl.py +1201 -0
  9. nuitka/ModuleRegistry.py +364 -0
  10. nuitka/OptionParsing.py +2473 -0
  11. nuitka/Options.py +2948 -0
  12. nuitka/OutputDirectories.py +201 -0
  13. nuitka/PostProcessing.py +551 -0
  14. nuitka/Progress.py +252 -0
  15. nuitka/PythonFlavors.py +426 -0
  16. nuitka/PythonOperators.py +146 -0
  17. nuitka/PythonVersions.py +513 -0
  18. nuitka/Serialization.py +291 -0
  19. nuitka/SourceCodeReferences.py +176 -0
  20. nuitka/Tracing.py +579 -0
  21. nuitka/TreeXML.py +141 -0
  22. nuitka/Variables.py +515 -0
  23. nuitka/Version.py +88 -0
  24. nuitka/__init__.py +19 -0
  25. nuitka/__main__.py +224 -0
  26. nuitka/__past__.py +217 -0
  27. nuitka/build/Backend.scons +1111 -0
  28. nuitka/build/CCompilerVersion.scons +281 -0
  29. nuitka/build/DataComposerInterface.py +116 -0
  30. nuitka/build/Offsets.scons +626 -0
  31. nuitka/build/Onefile.scons +564 -0
  32. nuitka/build/SconsCaching.py +451 -0
  33. nuitka/build/SconsCompilerSettings.py +1133 -0
  34. nuitka/build/SconsHacks.py +215 -0
  35. nuitka/build/SconsInterface.py +664 -0
  36. nuitka/build/SconsProgress.py +100 -0
  37. nuitka/build/SconsSpawn.py +436 -0
  38. nuitka/build/SconsUtils.py +939 -0
  39. nuitka/build/__init__.py +19 -0
  40. nuitka/build/include/nuitka/allocator.h +450 -0
  41. nuitka/build/include/nuitka/builtins.h +97 -0
  42. nuitka/build/include/nuitka/calling.h +123 -0
  43. nuitka/build/include/nuitka/checkers.h +39 -0
  44. nuitka/build/include/nuitka/checksum_tools.h +28 -0
  45. nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
  46. nuitka/build/include/nuitka/compiled_cell.h +64 -0
  47. nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
  48. nuitka/build/include/nuitka/compiled_frame.h +502 -0
  49. nuitka/build/include/nuitka/compiled_function.h +170 -0
  50. nuitka/build/include/nuitka/compiled_generator.h +287 -0
  51. nuitka/build/include/nuitka/compiled_method.h +54 -0
  52. nuitka/build/include/nuitka/constants.h +251 -0
  53. nuitka/build/include/nuitka/constants_blob.h +34 -0
  54. nuitka/build/include/nuitka/debug_settings.h +60 -0
  55. nuitka/build/include/nuitka/environment_variables.h +30 -0
  56. nuitka/build/include/nuitka/environment_variables_system.h +51 -0
  57. nuitka/build/include/nuitka/exception_groups.h +167 -0
  58. nuitka/build/include/nuitka/exceptions.h +1458 -0
  59. nuitka/build/include/nuitka/filesystem_paths.h +117 -0
  60. nuitka/build/include/nuitka/freelists.h +92 -0
  61. nuitka/build/include/nuitka/hedley.h +1774 -0
  62. nuitka/build/include/nuitka/helper/attributes.h +90 -0
  63. nuitka/build/include/nuitka/helper/boolean.h +86 -0
  64. nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
  65. nuitka/build/include/nuitka/helper/bytes.h +28 -0
  66. nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
  67. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  68. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  69. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  70. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  71. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  72. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  73. nuitka/build/include/nuitka/helper/comparisons_eq.h +247 -0
  74. nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
  75. nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
  76. nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
  77. nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
  78. nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
  79. nuitka/build/include/nuitka/helper/complex.h +46 -0
  80. nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
  81. nuitka/build/include/nuitka/helper/floats.h +32 -0
  82. nuitka/build/include/nuitka/helper/import_hard.h +121 -0
  83. nuitka/build/include/nuitka/helper/indexes.h +47 -0
  84. nuitka/build/include/nuitka/helper/ints.h +165 -0
  85. nuitka/build/include/nuitka/helper/iterators.h +376 -0
  86. nuitka/build/include/nuitka/helper/lists.h +94 -0
  87. nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
  88. nuitka/build/include/nuitka/helper/mappings.h +39 -0
  89. nuitka/build/include/nuitka/helper/operations.h +114 -0
  90. nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
  91. nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
  92. nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
  93. nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
  94. nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
  95. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  96. nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
  97. nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
  98. nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
  99. nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
  100. nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
  101. nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
  102. nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
  103. nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
  104. nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
  105. nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
  106. nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
  107. nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
  108. nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
  109. nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
  110. nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
  111. nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
  112. nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
  113. nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
  114. nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
  115. nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
  116. nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
  117. nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
  118. nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
  119. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
  120. nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
  121. nuitka/build/include/nuitka/helper/raising.h +114 -0
  122. nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
  123. nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
  124. nuitka/build/include/nuitka/helper/sequences.h +33 -0
  125. nuitka/build/include/nuitka/helper/sets.h +25 -0
  126. nuitka/build/include/nuitka/helper/slices.h +314 -0
  127. nuitka/build/include/nuitka/helper/strings.h +30 -0
  128. nuitka/build/include/nuitka/helper/subscripts.h +390 -0
  129. nuitka/build/include/nuitka/helper/tuples.h +187 -0
  130. nuitka/build/include/nuitka/helpers.h +417 -0
  131. nuitka/build/include/nuitka/importing.h +149 -0
  132. nuitka/build/include/nuitka/incbin.h +402 -0
  133. nuitka/build/include/nuitka/jit_sources.h +25 -0
  134. nuitka/build/include/nuitka/prelude.h +626 -0
  135. nuitka/build/include/nuitka/printing.h +84 -0
  136. nuitka/build/include/nuitka/python_pgo.h +57 -0
  137. nuitka/build/include/nuitka/safe_string_ops.h +57 -0
  138. nuitka/build/include/nuitka/threading.h +142 -0
  139. nuitka/build/include/nuitka/tracing.h +82 -0
  140. nuitka/build/include/nuitka/type_aliases.h +30 -0
  141. nuitka/build/include/nuitka/unfreezing.h +91 -0
  142. nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
  143. nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
  144. nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
  145. nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
  146. nuitka/build/inline_copy/bin/scons.py +58 -0
  147. nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
  148. nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
  149. nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
  150. nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
  151. nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
  152. nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
  153. nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
  154. nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
  155. nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
  156. nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
  157. nuitka/build/inline_copy/glob2/LICENSE +27 -0
  158. nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
  159. nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
  160. nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
  161. nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
  162. nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
  163. nuitka/build/inline_copy/jinja2/README.rst +2 -0
  164. nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
  165. nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
  166. nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
  167. nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
  168. nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
  169. nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
  170. nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
  171. nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
  172. nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
  173. nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
  174. nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
  175. nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
  176. nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
  177. nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
  178. nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
  179. nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
  180. nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
  181. nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
  182. nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
  183. nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
  184. nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
  185. nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
  186. nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
  187. nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
  188. nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
  189. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
  190. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
  191. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
  192. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
  193. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
  194. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
  195. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
  196. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
  197. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
  198. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
  199. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
  200. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
  201. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
  202. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
  203. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
  204. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
  205. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
  206. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
  207. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
  208. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
  209. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
  210. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
  211. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
  212. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
  213. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
  214. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
  215. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
  216. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
  217. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
  218. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
  219. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
  220. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
  221. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
  222. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
  223. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
  224. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
  225. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
  226. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
  227. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
  228. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
  229. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
  230. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
  231. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
  232. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
  233. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
  234. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
  235. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
  236. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
  237. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
  238. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
  239. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
  240. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
  241. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
  242. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
  243. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
  244. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
  245. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
  246. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
  247. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
  248. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
  249. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
  250. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
  251. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
  252. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
  253. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
  254. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
  255. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
  256. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
  257. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
  258. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
  259. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
  260. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
  261. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
  262. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
  263. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
  264. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
  265. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
  266. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
  267. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
  268. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
  269. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
  270. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
  271. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
  272. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
  273. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
  274. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
  275. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
  276. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
  277. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
  278. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
  279. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
  280. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
  281. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
  282. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
  283. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
  284. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
  285. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
  286. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
  287. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
  288. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
  289. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
  290. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
  291. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
  292. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
  293. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
  294. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
  295. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
  296. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
  297. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
  298. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
  299. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
  300. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
  301. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
  302. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
  303. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
  304. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
  305. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
  306. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
  307. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
  308. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
  309. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
  310. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
  311. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
  312. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
  313. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
  314. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
  315. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
  316. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
  317. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
  318. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
  319. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
  320. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
  321. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
  322. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
  323. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
  324. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
  325. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
  326. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
  327. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
  328. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
  329. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
  330. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
  331. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
  332. nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
  333. nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
  334. nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
  335. nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
  336. nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
  337. nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
  338. nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
  339. nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
  340. nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
  341. nuitka/build/inline_copy/pefile/pefile.py +8034 -0
  342. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
  343. nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
  344. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  345. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  346. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  347. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  348. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  349. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  350. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  351. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  352. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  353. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  354. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  355. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  356. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  357. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  358. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  359. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  360. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  361. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  362. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  363. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  364. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  365. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  366. nuitka/build/inline_copy/stubgen/six.py +998 -0
  367. nuitka/build/inline_copy/stubgen/stubgen.py +484 -0
  368. nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
  369. nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
  370. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
  371. nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
  372. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
  373. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
  374. nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
  375. nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
  376. nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
  377. nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
  378. nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
  379. nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
  380. nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
  381. nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
  382. nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
  383. nuitka/build/inline_copy/yaml/LICENSE +20 -0
  384. nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
  385. nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
  386. nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
  387. nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
  388. nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
  389. nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
  390. nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
  391. nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
  392. nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
  393. nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
  394. nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
  395. nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
  396. nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
  397. nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
  398. nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
  399. nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
  400. nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
  401. nuitka/build/inline_copy/zlib/LICENSE +22 -0
  402. nuitka/build/inline_copy/zlib/crc32.c +1049 -0
  403. nuitka/build/inline_copy/zlib/crc32.h +9446 -0
  404. nuitka/build/inline_copy/zlib/zconf.h +551 -0
  405. nuitka/build/inline_copy/zlib/zlib.h +1938 -0
  406. nuitka/build/inline_copy/zlib/zutil.h +275 -0
  407. nuitka/build/inline_copy/zstd/LICENSE.txt +30 -0
  408. nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
  409. nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
  410. nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
  411. nuitka/build/inline_copy/zstd/common/debug.h +107 -0
  412. nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
  413. nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
  414. nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
  415. nuitka/build/inline_copy/zstd/common/fse.h +715 -0
  416. nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
  417. nuitka/build/inline_copy/zstd/common/huf.h +361 -0
  418. nuitka/build/inline_copy/zstd/common/mem.h +426 -0
  419. nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
  420. nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
  421. nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
  422. nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
  423. nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
  424. nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
  425. nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
  426. nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
  427. nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
  428. nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
  429. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
  430. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
  431. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
  432. nuitka/build/inline_copy/zstd/zstd.h +2391 -0
  433. nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
  434. nuitka/build/static_src/CompiledCellType.c +300 -0
  435. nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
  436. nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
  437. nuitka/build/static_src/CompiledFrameType.c +1337 -0
  438. nuitka/build/static_src/CompiledFunctionType.c +3320 -0
  439. nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
  440. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
  441. nuitka/build/static_src/CompiledMethodType.c +614 -0
  442. nuitka/build/static_src/GenerateHeadersMain.c +30 -0
  443. nuitka/build/static_src/HelpersAllocator.c +939 -0
  444. nuitka/build/static_src/HelpersAttributes.c +1241 -0
  445. nuitka/build/static_src/HelpersBuiltin.c +901 -0
  446. nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
  447. nuitka/build/static_src/HelpersBytes.c +107 -0
  448. nuitka/build/static_src/HelpersCalling.c +397 -0
  449. nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
  450. nuitka/build/static_src/HelpersChecksumTools.c +59 -0
  451. nuitka/build/static_src/HelpersClasses.c +91 -0
  452. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  453. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  454. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  455. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  456. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  457. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  458. nuitka/build/static_src/HelpersComparisonEq.c +12070 -0
  459. nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
  460. nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
  461. nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
  462. nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
  463. nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
  464. nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
  465. nuitka/build/static_src/HelpersConsole.c +124 -0
  466. nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
  467. nuitka/build/static_src/HelpersDeepcopy.c +636 -0
  468. nuitka/build/static_src/HelpersDictionaries.c +1739 -0
  469. nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
  470. nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
  471. nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
  472. nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
  473. nuitka/build/static_src/HelpersExceptions.c +298 -0
  474. nuitka/build/static_src/HelpersFiles.c +353 -0
  475. nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
  476. nuitka/build/static_src/HelpersFloats.c +92 -0
  477. nuitka/build/static_src/HelpersHeapStorage.c +68 -0
  478. nuitka/build/static_src/HelpersImport.c +506 -0
  479. nuitka/build/static_src/HelpersImportHard.c +526 -0
  480. nuitka/build/static_src/HelpersJitSources.c +48 -0
  481. nuitka/build/static_src/HelpersLists.c +899 -0
  482. nuitka/build/static_src/HelpersListsGenerated.c +564 -0
  483. nuitka/build/static_src/HelpersMappings.c +46 -0
  484. nuitka/build/static_src/HelpersMatching.c +192 -0
  485. nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
  486. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
  487. nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
  488. nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
  489. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
  490. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
  491. nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
  492. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  493. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
  494. nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
  495. nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
  496. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
  497. nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
  498. nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
  499. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
  500. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
  501. nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
  502. nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
  503. nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
  504. nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
  505. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
  506. nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
  507. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
  508. nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
  509. nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
  510. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
  511. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
  512. nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
  513. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
  514. nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
  515. nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
  516. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
  517. nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
  518. nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
  519. nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
  520. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
  521. nuitka/build/static_src/HelpersProfiling.c +104 -0
  522. nuitka/build/static_src/HelpersPythonPgo.c +113 -0
  523. nuitka/build/static_src/HelpersRaising.c +447 -0
  524. nuitka/build/static_src/HelpersSafeStrings.c +185 -0
  525. nuitka/build/static_src/HelpersSequences.c +134 -0
  526. nuitka/build/static_src/HelpersSlices.c +73 -0
  527. nuitka/build/static_src/HelpersStrings.c +998 -0
  528. nuitka/build/static_src/HelpersTuples.c +148 -0
  529. nuitka/build/static_src/HelpersTypes.c +329 -0
  530. nuitka/build/static_src/InspectPatcher.c +439 -0
  531. nuitka/build/static_src/MainProgram.c +2060 -0
  532. nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
  533. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
  534. nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
  535. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
  536. nuitka/build/static_src/OnefileBootstrap.c +1580 -0
  537. nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
  538. nuitka/code_generation/AsyncgenCodes.py +186 -0
  539. nuitka/code_generation/AttributeCodes.py +357 -0
  540. nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
  541. nuitka/code_generation/BranchCodes.py +67 -0
  542. nuitka/code_generation/BuiltinCodes.py +529 -0
  543. nuitka/code_generation/CallCodes.py +1186 -0
  544. nuitka/code_generation/ClassCodes.py +156 -0
  545. nuitka/code_generation/CodeGeneration.py +1078 -0
  546. nuitka/code_generation/CodeHelperSelection.py +81 -0
  547. nuitka/code_generation/CodeHelpers.py +455 -0
  548. nuitka/code_generation/CodeObjectCodes.py +165 -0
  549. nuitka/code_generation/ComparisonCodes.py +569 -0
  550. nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
  551. nuitka/code_generation/ConditionalCodes.py +236 -0
  552. nuitka/code_generation/ConstantCodes.py +243 -0
  553. nuitka/code_generation/Contexts.py +1248 -0
  554. nuitka/code_generation/CoroutineCodes.py +253 -0
  555. nuitka/code_generation/CtypesCodes.py +46 -0
  556. nuitka/code_generation/DictCodes.py +918 -0
  557. nuitka/code_generation/Emission.py +75 -0
  558. nuitka/code_generation/ErrorCodes.py +281 -0
  559. nuitka/code_generation/EvalCodes.py +444 -0
  560. nuitka/code_generation/ExceptionCodes.py +337 -0
  561. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
  562. nuitka/code_generation/ExpressionCodes.py +61 -0
  563. nuitka/code_generation/FrameCodes.py +518 -0
  564. nuitka/code_generation/FunctionCodes.py +858 -0
  565. nuitka/code_generation/GeneratorCodes.py +218 -0
  566. nuitka/code_generation/GlobalConstants.py +249 -0
  567. nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
  568. nuitka/code_generation/IdCodes.py +53 -0
  569. nuitka/code_generation/ImportCodes.py +468 -0
  570. nuitka/code_generation/Indentation.py +45 -0
  571. nuitka/code_generation/IndexCodes.py +50 -0
  572. nuitka/code_generation/InjectCCodes.py +28 -0
  573. nuitka/code_generation/IntegerCodes.py +110 -0
  574. nuitka/code_generation/IteratorCodes.py +378 -0
  575. nuitka/code_generation/JitCodes.py +44 -0
  576. nuitka/code_generation/LabelCodes.py +68 -0
  577. nuitka/code_generation/LineNumberCodes.py +91 -0
  578. nuitka/code_generation/ListCodes.py +502 -0
  579. nuitka/code_generation/LoaderCodes.py +193 -0
  580. nuitka/code_generation/LocalsDictCodes.py +359 -0
  581. nuitka/code_generation/LoopCodes.py +88 -0
  582. nuitka/code_generation/MatchCodes.py +67 -0
  583. nuitka/code_generation/ModuleCodes.py +247 -0
  584. nuitka/code_generation/Namify.py +260 -0
  585. nuitka/code_generation/NetworkxCodes.py +51 -0
  586. nuitka/code_generation/OperationCodes.py +398 -0
  587. nuitka/code_generation/PackageResourceCodes.py +986 -0
  588. nuitka/code_generation/PrintCodes.py +93 -0
  589. nuitka/code_generation/PythonAPICodes.py +215 -0
  590. nuitka/code_generation/RaisingCodes.py +481 -0
  591. nuitka/code_generation/Reports.py +115 -0
  592. nuitka/code_generation/ReturnCodes.py +143 -0
  593. nuitka/code_generation/SetCodes.py +196 -0
  594. nuitka/code_generation/SliceCodes.py +465 -0
  595. nuitka/code_generation/StringCodes.py +303 -0
  596. nuitka/code_generation/SubscriptCodes.py +263 -0
  597. nuitka/code_generation/TensorflowCodes.py +54 -0
  598. nuitka/code_generation/TryCodes.py +326 -0
  599. nuitka/code_generation/TupleCodes.py +115 -0
  600. nuitka/code_generation/TypeAliasCodes.py +120 -0
  601. nuitka/code_generation/VariableCodes.py +519 -0
  602. nuitka/code_generation/VariableDeclarations.py +279 -0
  603. nuitka/code_generation/YieldCodes.py +253 -0
  604. nuitka/code_generation/__init__.py +19 -0
  605. nuitka/code_generation/c_types/CTypeBases.py +177 -0
  606. nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
  607. nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
  608. nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
  609. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
  610. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
  611. nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
  612. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
  613. nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
  614. nuitka/code_generation/c_types/CTypeVoids.py +92 -0
  615. nuitka/code_generation/c_types/__init__.py +19 -0
  616. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
  617. nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
  618. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
  619. nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
  620. nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
  621. nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
  622. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
  623. nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
  624. nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
  625. nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
  626. nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
  627. nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
  628. nuitka/code_generation/templates/__init__.py +19 -0
  629. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
  630. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
  631. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
  632. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
  633. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
  634. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
  635. nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
  636. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
  637. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
  638. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
  639. nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
  640. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
  641. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  642. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
  643. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
  644. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  645. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
  646. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
  647. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
  648. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
  649. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
  650. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
  651. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
  652. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
  653. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
  654. nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
  655. nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
  656. nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
  657. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
  658. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
  659. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
  660. nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
  661. nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
  662. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
  663. nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
  664. nuitka/containers/Namedtuples.py +51 -0
  665. nuitka/containers/OrderedDicts.py +191 -0
  666. nuitka/containers/OrderedSets.py +123 -0
  667. nuitka/containers/OrderedSetsFallback.py +139 -0
  668. nuitka/containers/__init__.py +19 -0
  669. nuitka/distutils/Build.py +76 -0
  670. nuitka/distutils/DistutilCommands.py +438 -0
  671. nuitka/distutils/__init__.py +19 -0
  672. nuitka/finalizations/Finalization.py +35 -0
  673. nuitka/finalizations/FinalizeMarkups.py +136 -0
  674. nuitka/finalizations/__init__.py +19 -0
  675. nuitka/freezer/DependsExe.py +257 -0
  676. nuitka/freezer/DllDependenciesCommon.py +97 -0
  677. nuitka/freezer/DllDependenciesMacOS.py +444 -0
  678. nuitka/freezer/DllDependenciesPosix.py +242 -0
  679. nuitka/freezer/DllDependenciesWin32.py +315 -0
  680. nuitka/freezer/ImportDetection.py +359 -0
  681. nuitka/freezer/IncludedDataFiles.py +689 -0
  682. nuitka/freezer/IncludedEntryPoints.py +376 -0
  683. nuitka/freezer/Onefile.py +296 -0
  684. nuitka/freezer/Standalone.py +520 -0
  685. nuitka/freezer/__init__.py +19 -0
  686. nuitka/importing/IgnoreListing.py +449 -0
  687. nuitka/importing/ImportCache.py +95 -0
  688. nuitka/importing/ImportResolving.py +186 -0
  689. nuitka/importing/Importing.py +1200 -0
  690. nuitka/importing/PreloadedPackages.py +164 -0
  691. nuitka/importing/Recursion.py +611 -0
  692. nuitka/importing/StandardLibrary.py +429 -0
  693. nuitka/importing/__init__.py +19 -0
  694. nuitka/nodes/AsyncgenNodes.py +107 -0
  695. nuitka/nodes/AttributeLookupNodes.py +124 -0
  696. nuitka/nodes/AttributeNodes.py +386 -0
  697. nuitka/nodes/AttributeNodesGenerated.py +10734 -0
  698. nuitka/nodes/BuiltinAllNodes.py +115 -0
  699. nuitka/nodes/BuiltinAnyNodes.py +124 -0
  700. nuitka/nodes/BuiltinComplexNodes.py +83 -0
  701. nuitka/nodes/BuiltinDecodingNodes.py +52 -0
  702. nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
  703. nuitka/nodes/BuiltinDictNodes.py +140 -0
  704. nuitka/nodes/BuiltinFormatNodes.py +159 -0
  705. nuitka/nodes/BuiltinHashNodes.py +63 -0
  706. nuitka/nodes/BuiltinInputNodes.py +39 -0
  707. nuitka/nodes/BuiltinIntegerNodes.py +170 -0
  708. nuitka/nodes/BuiltinIteratorNodes.py +391 -0
  709. nuitka/nodes/BuiltinLenNodes.py +61 -0
  710. nuitka/nodes/BuiltinNextNodes.py +111 -0
  711. nuitka/nodes/BuiltinOpenNodes.py +148 -0
  712. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
  713. nuitka/nodes/BuiltinRangeNodes.py +690 -0
  714. nuitka/nodes/BuiltinRefNodes.py +314 -0
  715. nuitka/nodes/BuiltinSumNodes.py +104 -0
  716. nuitka/nodes/BuiltinTypeNodes.py +454 -0
  717. nuitka/nodes/BuiltinVarsNodes.py +44 -0
  718. nuitka/nodes/BytesNodes.py +829 -0
  719. nuitka/nodes/CallNodes.py +217 -0
  720. nuitka/nodes/Checkers.py +55 -0
  721. nuitka/nodes/ChildrenHavingMixins.py +21576 -0
  722. nuitka/nodes/ClassNodes.py +286 -0
  723. nuitka/nodes/CodeObjectSpecs.py +230 -0
  724. nuitka/nodes/ComparisonNodes.py +687 -0
  725. nuitka/nodes/ConditionalNodes.py +884 -0
  726. nuitka/nodes/ConstantRefNodes.py +1717 -0
  727. nuitka/nodes/ContainerMakingNodes.py +408 -0
  728. nuitka/nodes/ContainerOperationNodes.py +87 -0
  729. nuitka/nodes/CoroutineNodes.py +144 -0
  730. nuitka/nodes/CtypesNodes.py +51 -0
  731. nuitka/nodes/DictionaryNodes.py +1513 -0
  732. nuitka/nodes/ExceptionNodes.py +393 -0
  733. nuitka/nodes/ExecEvalNodes.py +229 -0
  734. nuitka/nodes/ExpressionBases.py +1301 -0
  735. nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
  736. nuitka/nodes/ExpressionShapeMixins.py +886 -0
  737. nuitka/nodes/FrameNodes.py +413 -0
  738. nuitka/nodes/FunctionAttributeNodes.py +102 -0
  739. nuitka/nodes/FunctionNodes.py +1303 -0
  740. nuitka/nodes/FutureSpecs.py +224 -0
  741. nuitka/nodes/GeneratorNodes.py +201 -0
  742. nuitka/nodes/GlobalsLocalsNodes.py +209 -0
  743. nuitka/nodes/HardImportNodesGenerated.py +3599 -0
  744. nuitka/nodes/ImportHardNodes.py +185 -0
  745. nuitka/nodes/ImportNodes.py +1366 -0
  746. nuitka/nodes/IndicatorMixins.py +79 -0
  747. nuitka/nodes/InjectCNodes.py +51 -0
  748. nuitka/nodes/IterationHandles.py +407 -0
  749. nuitka/nodes/KeyValuePairNodes.py +378 -0
  750. nuitka/nodes/ListOperationNodes.py +525 -0
  751. nuitka/nodes/LocalsDictNodes.py +717 -0
  752. nuitka/nodes/LocalsScopes.py +505 -0
  753. nuitka/nodes/LoopNodes.py +445 -0
  754. nuitka/nodes/MatchNodes.py +60 -0
  755. nuitka/nodes/ModuleAttributeNodes.py +180 -0
  756. nuitka/nodes/ModuleNodes.py +1137 -0
  757. nuitka/nodes/NetworkxNodes.py +45 -0
  758. nuitka/nodes/NodeBases.py +890 -0
  759. nuitka/nodes/NodeMakingHelpers.py +481 -0
  760. nuitka/nodes/NodeMetaClasses.py +172 -0
  761. nuitka/nodes/OperatorNodes.py +944 -0
  762. nuitka/nodes/OperatorNodesUnary.py +403 -0
  763. nuitka/nodes/OsSysNodes.py +215 -0
  764. nuitka/nodes/OutlineNodes.py +372 -0
  765. nuitka/nodes/PackageMetadataNodes.py +982 -0
  766. nuitka/nodes/PackageResourceNodes.py +424 -0
  767. nuitka/nodes/PrintNodes.py +105 -0
  768. nuitka/nodes/ReturnNodes.py +255 -0
  769. nuitka/nodes/SideEffectNodes.py +139 -0
  770. nuitka/nodes/SliceNodes.py +386 -0
  771. nuitka/nodes/StatementBasesGenerated.py +3419 -0
  772. nuitka/nodes/StatementNodes.py +316 -0
  773. nuitka/nodes/StrNodes.py +919 -0
  774. nuitka/nodes/StringConcatenationNodes.py +103 -0
  775. nuitka/nodes/SubscriptNodes.py +245 -0
  776. nuitka/nodes/TensorflowNodes.py +38 -0
  777. nuitka/nodes/TryNodes.py +519 -0
  778. nuitka/nodes/TypeMatchNodes.py +65 -0
  779. nuitka/nodes/TypeNodes.py +390 -0
  780. nuitka/nodes/VariableAssignNodes.py +1177 -0
  781. nuitka/nodes/VariableDelNodes.py +320 -0
  782. nuitka/nodes/VariableNameNodes.py +153 -0
  783. nuitka/nodes/VariableRefNodes.py +895 -0
  784. nuitka/nodes/VariableReleaseNodes.py +153 -0
  785. nuitka/nodes/YieldNodes.py +121 -0
  786. nuitka/nodes/__init__.py +19 -0
  787. nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
  788. nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
  789. nuitka/nodes/shapes/IteratorShapes.py +71 -0
  790. nuitka/nodes/shapes/ShapeMixins.py +255 -0
  791. nuitka/nodes/shapes/StandardShapes.py +1384 -0
  792. nuitka/nodes/shapes/__init__.py +19 -0
  793. nuitka/optimizations/BytecodeDemotion.py +105 -0
  794. nuitka/optimizations/FunctionInlining.py +110 -0
  795. nuitka/optimizations/Graphs.py +70 -0
  796. nuitka/optimizations/Optimization.py +363 -0
  797. nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
  798. nuitka/optimizations/Tags.py +76 -0
  799. nuitka/optimizations/TraceCollections.py +1257 -0
  800. nuitka/optimizations/ValueTraces.py +980 -0
  801. nuitka/optimizations/__init__.py +19 -0
  802. nuitka/pgo/PGO.py +160 -0
  803. nuitka/pgo/__init__.py +19 -0
  804. nuitka/plugins/PluginBase.py +1924 -0
  805. nuitka/plugins/Plugins.py +2007 -0
  806. nuitka/plugins/YamlPluginBase.py +121 -0
  807. nuitka/plugins/__init__.py +19 -0
  808. nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
  809. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
  810. nuitka/plugins/standard/DataFilesPlugin.py +311 -0
  811. nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
  812. nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
  813. nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
  814. nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
  815. nuitka/plugins/standard/DillPlugin.py +137 -0
  816. nuitka/plugins/standard/DllFilesPlugin.py +527 -0
  817. nuitka/plugins/standard/EnumPlugin.py +64 -0
  818. nuitka/plugins/standard/EventletPlugin.py +57 -0
  819. nuitka/plugins/standard/GeventPlugin.py +64 -0
  820. nuitka/plugins/standard/GiPlugin.py +118 -0
  821. nuitka/plugins/standard/GlfwPlugin.py +138 -0
  822. nuitka/plugins/standard/ImplicitImports.py +845 -0
  823. nuitka/plugins/standard/KivyPlugin.py +141 -0
  824. nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
  825. nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
  826. nuitka/plugins/standard/NumpyPlugin.py +35 -0
  827. nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
  828. nuitka/plugins/standard/PbrPlugin.py +62 -0
  829. nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
  830. nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
  831. nuitka/plugins/standard/PmwPlugin.py +248 -0
  832. nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
  833. nuitka/plugins/standard/PywebViewPlugin.py +81 -0
  834. nuitka/plugins/standard/SpacyPlugin.py +137 -0
  835. nuitka/plugins/standard/TensorflowPlugin.py +35 -0
  836. nuitka/plugins/standard/TkinterPlugin.py +416 -0
  837. nuitka/plugins/standard/TorchPlugin.py +35 -0
  838. nuitka/plugins/standard/TransformersPlugin.py +121 -0
  839. nuitka/plugins/standard/TrioPlugin.py +33 -0
  840. nuitka/plugins/standard/UpxPlugin.py +174 -0
  841. nuitka/plugins/standard/__init__.py +19 -0
  842. nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
  843. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
  844. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
  845. nuitka/reports/CompilationReportReader.py +83 -0
  846. nuitka/reports/LicenseReport.rst.j2 +41 -0
  847. nuitka/reports/Reports.py +961 -0
  848. nuitka/reports/__init__.py +19 -0
  849. nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
  850. nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
  851. nuitka/specs/BuiltinListOperationSpecs.py +80 -0
  852. nuitka/specs/BuiltinParameterSpecs.py +831 -0
  853. nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
  854. nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
  855. nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
  856. nuitka/specs/HardImportSpecs.py +236 -0
  857. nuitka/specs/ParameterSpecs.py +630 -0
  858. nuitka/specs/__init__.py +19 -0
  859. nuitka/tools/Basics.py +55 -0
  860. nuitka/tools/__init__.py +19 -0
  861. nuitka/tools/commercial/__init__.py +21 -0
  862. nuitka/tools/data_composer/DataComposer.py +593 -0
  863. nuitka/tools/data_composer/__init__.py +19 -0
  864. nuitka/tools/data_composer/__main__.py +41 -0
  865. nuitka/tools/environments/CreateEnvironment.py +69 -0
  866. nuitka/tools/environments/Virtualenv.py +158 -0
  867. nuitka/tools/environments/__init__.py +19 -0
  868. nuitka/tools/general/__init__.py +19 -0
  869. nuitka/tools/general/dll_report/__init__.py +19 -0
  870. nuitka/tools/general/dll_report/__main__.py +83 -0
  871. nuitka/tools/general/find_module/FindModuleCode.py +127 -0
  872. nuitka/tools/general/find_module/__init__.py +19 -0
  873. nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
  874. nuitka/tools/general/generate_header/__init__.py +19 -0
  875. nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
  876. nuitka/tools/onefile_compressor/__init__.py +19 -0
  877. nuitka/tools/onefile_compressor/__main__.py +41 -0
  878. nuitka/tools/podman/Podman.py +55 -0
  879. nuitka/tools/podman/__init__.py +19 -0
  880. nuitka/tools/podman/__main__.py +425 -0
  881. nuitka/tools/profiler/__init__.py +19 -0
  882. nuitka/tools/profiler/__main__.py +93 -0
  883. nuitka/tools/scanning/DisplayDistributions.py +39 -0
  884. nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
  885. nuitka/tools/scanning/DisplayPackageData.py +73 -0
  886. nuitka/tools/scanning/__init__.py +19 -0
  887. nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
  888. nuitka/tools/specialize/Common.py +380 -0
  889. nuitka/tools/specialize/SpecializeC.py +1483 -0
  890. nuitka/tools/specialize/SpecializePython.py +1151 -0
  891. nuitka/tools/specialize/__init__.py +19 -0
  892. nuitka/tools/testing/Common.py +2007 -0
  893. nuitka/tools/testing/Constructs.py +53 -0
  894. nuitka/tools/testing/DocTests.py +156 -0
  895. nuitka/tools/testing/OutputComparison.py +313 -0
  896. nuitka/tools/testing/Pythons.py +34 -0
  897. nuitka/tools/testing/RuntimeTracing.py +260 -0
  898. nuitka/tools/testing/SearchModes.py +208 -0
  899. nuitka/tools/testing/Valgrind.py +103 -0
  900. nuitka/tools/testing/__init__.py +19 -0
  901. nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
  902. nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
  903. nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
  904. nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
  905. nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
  906. nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
  907. nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
  908. nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
  909. nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
  910. nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
  911. nuitka/tools/watch/AutoStage.py +145 -0
  912. nuitka/tools/watch/Common.py +55 -0
  913. nuitka/tools/watch/Conda.py +125 -0
  914. nuitka/tools/watch/GitHub.py +113 -0
  915. nuitka/tools/watch/Pacman.py +73 -0
  916. nuitka/tools/watch/Pipenv.py +145 -0
  917. nuitka/tools/watch/__init__.py +19 -0
  918. nuitka/tools/watch/__main__.py +615 -0
  919. nuitka/tree/Building.py +1459 -0
  920. nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
  921. nuitka/tree/Extractions.py +48 -0
  922. nuitka/tree/FutureSpecState.py +71 -0
  923. nuitka/tree/InternalModule.py +96 -0
  924. nuitka/tree/Operations.py +45 -0
  925. nuitka/tree/ReformulationAssertStatements.py +97 -0
  926. nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
  927. nuitka/tree/ReformulationBooleanExpressions.py +97 -0
  928. nuitka/tree/ReformulationCallExpressions.py +314 -0
  929. nuitka/tree/ReformulationClasses.py +407 -0
  930. nuitka/tree/ReformulationClasses3.py +1149 -0
  931. nuitka/tree/ReformulationComparisonExpressions.py +174 -0
  932. nuitka/tree/ReformulationContractionExpressions.py +676 -0
  933. nuitka/tree/ReformulationDictionaryCreation.py +304 -0
  934. nuitka/tree/ReformulationExecStatements.py +386 -0
  935. nuitka/tree/ReformulationForLoopStatements.py +215 -0
  936. nuitka/tree/ReformulationFunctionStatements.py +931 -0
  937. nuitka/tree/ReformulationImportStatements.py +333 -0
  938. nuitka/tree/ReformulationLambdaExpressions.py +185 -0
  939. nuitka/tree/ReformulationMatchStatements.py +797 -0
  940. nuitka/tree/ReformulationMultidist.py +80 -0
  941. nuitka/tree/ReformulationNamespacePackages.py +239 -0
  942. nuitka/tree/ReformulationPrintStatements.py +127 -0
  943. nuitka/tree/ReformulationSequenceCreation.py +438 -0
  944. nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
  945. nuitka/tree/ReformulationTryExceptStatements.py +418 -0
  946. nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
  947. nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
  948. nuitka/tree/ReformulationWithStatements.py +382 -0
  949. nuitka/tree/ReformulationYieldExpressions.py +133 -0
  950. nuitka/tree/SourceHandling.py +476 -0
  951. nuitka/tree/SyntaxErrors.py +143 -0
  952. nuitka/tree/TreeHelpers.py +720 -0
  953. nuitka/tree/VariableClosure.py +483 -0
  954. nuitka/tree/__init__.py +19 -0
  955. nuitka/utils/AppDirs.py +104 -0
  956. nuitka/utils/CStrings.py +208 -0
  957. nuitka/utils/CommandLineOptions.py +207 -0
  958. nuitka/utils/Distributions.py +728 -0
  959. nuitka/utils/Download.py +217 -0
  960. nuitka/utils/Execution.py +517 -0
  961. nuitka/utils/FileOperations.py +1587 -0
  962. nuitka/utils/Hashing.py +137 -0
  963. nuitka/utils/Images.py +79 -0
  964. nuitka/utils/Importing.py +335 -0
  965. nuitka/utils/InlineCopies.py +52 -0
  966. nuitka/utils/InstalledPythons.py +254 -0
  967. nuitka/utils/InstanceCounters.py +86 -0
  968. nuitka/utils/Jinja2.py +158 -0
  969. nuitka/utils/Json.py +40 -0
  970. nuitka/utils/MacOSApp.py +134 -0
  971. nuitka/utils/MemoryUsage.py +165 -0
  972. nuitka/utils/ModuleNames.py +317 -0
  973. nuitka/utils/PackageResources.py +44 -0
  974. nuitka/utils/ReExecute.py +152 -0
  975. nuitka/utils/Rest.py +60 -0
  976. nuitka/utils/SharedLibraries.py +1014 -0
  977. nuitka/utils/Shebang.py +113 -0
  978. nuitka/utils/Signing.py +144 -0
  979. nuitka/utils/SlotMetaClasses.py +57 -0
  980. nuitka/utils/StaticLibraries.py +260 -0
  981. nuitka/utils/ThreadedExecutor.py +87 -0
  982. nuitka/utils/Timing.py +102 -0
  983. nuitka/utils/Utils.py +483 -0
  984. nuitka/utils/WindowsFileUsage.py +337 -0
  985. nuitka/utils/WindowsResources.py +652 -0
  986. nuitka/utils/Yaml.py +247 -0
  987. nuitka/utils/__init__.py +19 -0
  988. nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
  989. nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
  990. nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
  991. nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
  992. nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
  993. nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
  994. nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
  995. nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2894 @@
1
+ // Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
3
+ /* WARNING, this code is GENERATED. Modify the template HelperOperationInplace.c.j2 instead! */
4
+
5
+ /* This file is included from another C file, help IDEs to still parse it on its own. */
6
+ #ifdef __IDE_ONLY__
7
+ #include "nuitka/prelude.h"
8
+ #endif
9
+
10
+ /* C helpers for type in-place "-" (SUB) operations */
11
+
12
+ #if PYTHON_VERSION < 0x300
13
+ /* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */
14
+ static inline bool _INPLACE_OPERATION_SUB_INT_INT(PyObject **operand1, PyObject *operand2) {
15
+ assert(operand1); // Pointer must be non-null.
16
+
17
+ CHECK_OBJECT(*operand1);
18
+ assert(PyInt_CheckExact(*operand1));
19
+ CHECK_OBJECT(operand2);
20
+ assert(PyInt_CheckExact(operand2));
21
+
22
+ // Not every code path will make use of all possible results.
23
+ #ifdef _MSC_VER
24
+ #pragma warning(push)
25
+ #pragma warning(disable : 4101)
26
+ #endif
27
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
28
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
29
+ NUITKA_MAY_BE_UNUSED long clong_result;
30
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
31
+ #ifdef _MSC_VER
32
+ #pragma warning(pop)
33
+ #endif
34
+
35
+ CHECK_OBJECT(*operand1);
36
+ assert(PyInt_CheckExact(*operand1));
37
+ CHECK_OBJECT(operand2);
38
+ assert(PyInt_CheckExact(operand2));
39
+
40
+ const long a = PyInt_AS_LONG(*operand1);
41
+ const long b = PyInt_AS_LONG(operand2);
42
+
43
+ const long x = (long)((unsigned long)a - b);
44
+ bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);
45
+ if (likely(no_overflow)) {
46
+ clong_result = x;
47
+ goto exit_result_ok_clong;
48
+ }
49
+
50
+ {
51
+ PyObject *operand1_object = *operand1;
52
+ PyObject *operand2_object = operand2;
53
+
54
+ PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);
55
+ assert(r != Py_NotImplemented);
56
+
57
+ obj_result = r;
58
+ goto exit_result_object;
59
+ }
60
+
61
+ exit_result_ok_clong:
62
+
63
+ // We got an object handed, that we have to release.
64
+ Py_DECREF(*operand1);
65
+
66
+ // That's our return value then. As we use a dedicated variable, it's
67
+ // OK that way.
68
+ *operand1 = Nuitka_PyInt_FromLong(clong_result);
69
+ goto exit_result_ok;
70
+
71
+ exit_result_object:
72
+ if (unlikely(obj_result == NULL)) {
73
+ goto exit_result_exception;
74
+ }
75
+ // We got an object handed, that we have to release.
76
+ Py_DECREF(*operand1);
77
+
78
+ *operand1 = obj_result;
79
+ goto exit_result_ok;
80
+
81
+ exit_result_ok:
82
+ return true;
83
+
84
+ exit_result_exception:
85
+ return false;
86
+ }
87
+
88
+ bool INPLACE_OPERATION_SUB_INT_INT(PyObject **operand1, PyObject *operand2) {
89
+ return _INPLACE_OPERATION_SUB_INT_INT(operand1, operand2);
90
+ }
91
+ #endif
92
+
93
+ #if PYTHON_VERSION < 0x300
94
+ /* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */
95
+ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_OBJECT_INT(PyObject **operand1, PyObject *operand2) {
96
+ PyTypeObject *type1 = Py_TYPE(*operand1);
97
+
98
+ #ifdef _MSC_VER
99
+ #pragma warning(push)
100
+ #pragma warning(disable : 4101)
101
+ #endif
102
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
103
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
104
+ #ifdef _MSC_VER
105
+ #pragma warning(pop)
106
+ #endif
107
+
108
+ binaryfunc islot =
109
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_subtract : NULL;
110
+
111
+ if (islot != NULL) {
112
+ PyObject *x = islot(*operand1, operand2);
113
+
114
+ if (x != Py_NotImplemented) {
115
+ obj_result = x;
116
+ goto exit_inplace_result_object;
117
+ }
118
+
119
+ Py_DECREF_IMMORTAL(x);
120
+ }
121
+
122
+ {
123
+ binaryfunc slot1 =
124
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;
125
+ binaryfunc slot2 = NULL;
126
+
127
+ if (!(type1 == &PyInt_Type)) {
128
+ // Different types, need to consider second value slot.
129
+
130
+ slot2 = PyInt_Type.tp_as_number->nb_subtract;
131
+
132
+ if (slot1 == slot2) {
133
+ slot2 = NULL;
134
+ }
135
+ }
136
+
137
+ if (slot1 != NULL) {
138
+ PyObject *x = slot1(*operand1, operand2);
139
+
140
+ if (x != Py_NotImplemented) {
141
+ obj_result = x;
142
+ goto exit_inplace_result_object;
143
+ }
144
+
145
+ Py_DECREF_IMMORTAL(x);
146
+ }
147
+
148
+ if (slot2 != NULL) {
149
+ PyObject *x = slot2(*operand1, operand2);
150
+
151
+ if (x != Py_NotImplemented) {
152
+ obj_result = x;
153
+ goto exit_inplace_result_object;
154
+ }
155
+
156
+ Py_DECREF_IMMORTAL(x);
157
+ }
158
+
159
+ #if PYTHON_VERSION < 0x300
160
+ if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
161
+ coercion c1 =
162
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
163
+
164
+ if (c1 != NULL) {
165
+ PyObject *coerced1 = *operand1;
166
+ PyObject *coerced2 = operand2;
167
+
168
+ int err = c1(&coerced1, &coerced2);
169
+
170
+ if (unlikely(err < 0)) {
171
+ goto exit_inplace_exception;
172
+ }
173
+
174
+ if (err == 0) {
175
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
176
+
177
+ if (likely(mv == NULL)) {
178
+ binaryfunc slot = mv->nb_subtract;
179
+
180
+ if (likely(slot != NULL)) {
181
+ PyObject *x = slot(coerced1, coerced2);
182
+
183
+ Py_DECREF(coerced1);
184
+ Py_DECREF(coerced2);
185
+
186
+ obj_result = x;
187
+ goto exit_inplace_result_object;
188
+ }
189
+ }
190
+
191
+ // nb_coerce took a reference.
192
+ Py_DECREF(coerced1);
193
+ Py_DECREF(coerced2);
194
+ }
195
+ }
196
+ coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
197
+
198
+ if (c2 != NULL) {
199
+ PyObject *coerced1 = *operand1;
200
+ PyObject *coerced2 = operand2;
201
+
202
+ int err = c2(&coerced2, &coerced1);
203
+
204
+ if (unlikely(err < 0)) {
205
+ goto exit_inplace_exception;
206
+ }
207
+
208
+ if (err == 0) {
209
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
210
+
211
+ if (likely(mv == NULL)) {
212
+ binaryfunc slot = mv->nb_subtract;
213
+
214
+ if (likely(slot != NULL)) {
215
+ PyObject *x = slot(coerced1, coerced2);
216
+
217
+ Py_DECREF(coerced1);
218
+ Py_DECREF(coerced2);
219
+
220
+ obj_result = x;
221
+ goto exit_inplace_result_object;
222
+ }
223
+ }
224
+
225
+ // nb_coerce took a reference.
226
+ Py_DECREF(coerced1);
227
+ Py_DECREF(coerced2);
228
+ }
229
+ }
230
+ }
231
+ #endif
232
+
233
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: '%s' and 'int'", type1->tp_name);
234
+ goto exit_inplace_exception;
235
+ }
236
+
237
+ exit_inplace_result_object:
238
+ if (unlikely(obj_result == NULL)) {
239
+ return false;
240
+ }
241
+
242
+ // We got an object handed, that we have to release.
243
+ Py_DECREF(*operand1);
244
+
245
+ // That's our return value then. As we use a dedicated variable, it's
246
+ // OK that way.
247
+ *operand1 = obj_result;
248
+
249
+ return true;
250
+
251
+ exit_inplace_exception:
252
+ return false;
253
+ }
254
+ static inline bool _INPLACE_OPERATION_SUB_OBJECT_INT(PyObject **operand1, PyObject *operand2) {
255
+ assert(operand1); // Pointer must be non-null.
256
+
257
+ CHECK_OBJECT(*operand1);
258
+ CHECK_OBJECT(operand2);
259
+ assert(PyInt_CheckExact(operand2));
260
+
261
+ PyTypeObject *type1 = Py_TYPE(*operand1);
262
+
263
+ if (type1 == &PyInt_Type) {
264
+ // return _BINARY_OPERATION_SUB_INT_INT_INPLACE(operand1, operand2);
265
+
266
+ // Not every code path will make use of all possible results.
267
+ #ifdef _MSC_VER
268
+ #pragma warning(push)
269
+ #pragma warning(disable : 4101)
270
+ #endif
271
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
272
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
273
+ NUITKA_MAY_BE_UNUSED long clong_result;
274
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
275
+ #ifdef _MSC_VER
276
+ #pragma warning(pop)
277
+ #endif
278
+
279
+ CHECK_OBJECT(*operand1);
280
+ assert(PyInt_CheckExact(*operand1));
281
+ CHECK_OBJECT(operand2);
282
+ assert(PyInt_CheckExact(operand2));
283
+
284
+ const long a = PyInt_AS_LONG(*operand1);
285
+ const long b = PyInt_AS_LONG(operand2);
286
+
287
+ const long x = (long)((unsigned long)a - b);
288
+ bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);
289
+ if (likely(no_overflow)) {
290
+ clong_result = x;
291
+ goto exit_result_ok_clong;
292
+ }
293
+
294
+ {
295
+ PyObject *operand1_object = *operand1;
296
+ PyObject *operand2_object = operand2;
297
+
298
+ PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);
299
+ assert(r != Py_NotImplemented);
300
+
301
+ obj_result = r;
302
+ goto exit_result_object;
303
+ }
304
+
305
+ exit_result_ok_clong:
306
+
307
+ // We got an object handed, that we have to release.
308
+ Py_DECREF(*operand1);
309
+
310
+ // That's our return value then. As we use a dedicated variable, it's
311
+ // OK that way.
312
+ *operand1 = Nuitka_PyInt_FromLong(clong_result);
313
+ goto exit_result_ok;
314
+
315
+ exit_result_object:
316
+ if (unlikely(obj_result == NULL)) {
317
+ goto exit_result_exception;
318
+ }
319
+ // We got an object handed, that we have to release.
320
+ Py_DECREF(*operand1);
321
+
322
+ *operand1 = obj_result;
323
+ goto exit_result_ok;
324
+
325
+ exit_result_ok:
326
+ return true;
327
+
328
+ exit_result_exception:
329
+ return false;
330
+ }
331
+
332
+ return __INPLACE_OPERATION_SUB_OBJECT_INT(operand1, operand2);
333
+ }
334
+
335
+ bool INPLACE_OPERATION_SUB_OBJECT_INT(PyObject **operand1, PyObject *operand2) {
336
+ return _INPLACE_OPERATION_SUB_OBJECT_INT(operand1, operand2);
337
+ }
338
+ #endif
339
+
340
+ #if PYTHON_VERSION < 0x300
341
+ /* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */
342
+ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_INT_OBJECT(PyObject **operand1, PyObject *operand2) {
343
+ PyTypeObject *type2 = Py_TYPE(operand2);
344
+
345
+ #ifdef _MSC_VER
346
+ #pragma warning(push)
347
+ #pragma warning(disable : 4101)
348
+ #endif
349
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
350
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
351
+ #ifdef _MSC_VER
352
+ #pragma warning(pop)
353
+ #endif
354
+
355
+ // No inplace number slot nb_inplace_subtract available for this type.
356
+
357
+ {
358
+ binaryfunc slot1 = PyInt_Type.tp_as_number->nb_subtract;
359
+ binaryfunc slot2 = NULL;
360
+
361
+ if (!(&PyInt_Type == type2)) {
362
+ // Different types, need to consider second value slot.
363
+
364
+ slot2 =
365
+ (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;
366
+
367
+ if (slot1 == slot2) {
368
+ slot2 = NULL;
369
+ }
370
+ }
371
+
372
+ if (slot1 != NULL) {
373
+ if (slot2 != NULL) {
374
+ if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
375
+ PyObject *x = slot2(*operand1, operand2);
376
+
377
+ if (x != Py_NotImplemented) {
378
+ obj_result = x;
379
+ goto exit_inplace_result_object;
380
+ }
381
+
382
+ Py_DECREF_IMMORTAL(x);
383
+ slot2 = NULL;
384
+ }
385
+ }
386
+
387
+ PyObject *x = slot1(*operand1, operand2);
388
+
389
+ if (x != Py_NotImplemented) {
390
+ obj_result = x;
391
+ goto exit_inplace_result_object;
392
+ }
393
+
394
+ Py_DECREF_IMMORTAL(x);
395
+ }
396
+
397
+ if (slot2 != NULL) {
398
+ PyObject *x = slot2(*operand1, operand2);
399
+
400
+ if (x != Py_NotImplemented) {
401
+ obj_result = x;
402
+ goto exit_inplace_result_object;
403
+ }
404
+
405
+ Py_DECREF_IMMORTAL(x);
406
+ }
407
+
408
+ #if PYTHON_VERSION < 0x300
409
+ if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
410
+ coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
411
+
412
+ if (c1 != NULL) {
413
+ PyObject *coerced1 = *operand1;
414
+ PyObject *coerced2 = operand2;
415
+
416
+ int err = c1(&coerced1, &coerced2);
417
+
418
+ if (unlikely(err < 0)) {
419
+ goto exit_inplace_exception;
420
+ }
421
+
422
+ if (err == 0) {
423
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
424
+
425
+ if (likely(mv == NULL)) {
426
+ binaryfunc slot = mv->nb_subtract;
427
+
428
+ if (likely(slot != NULL)) {
429
+ PyObject *x = slot(coerced1, coerced2);
430
+
431
+ Py_DECREF(coerced1);
432
+ Py_DECREF(coerced2);
433
+
434
+ obj_result = x;
435
+ goto exit_inplace_result_object;
436
+ }
437
+ }
438
+
439
+ // nb_coerce took a reference.
440
+ Py_DECREF(coerced1);
441
+ Py_DECREF(coerced2);
442
+ }
443
+ }
444
+ coercion c2 =
445
+ (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
446
+
447
+ if (c2 != NULL) {
448
+ PyObject *coerced1 = *operand1;
449
+ PyObject *coerced2 = operand2;
450
+
451
+ int err = c2(&coerced2, &coerced1);
452
+
453
+ if (unlikely(err < 0)) {
454
+ goto exit_inplace_exception;
455
+ }
456
+
457
+ if (err == 0) {
458
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
459
+
460
+ if (likely(mv == NULL)) {
461
+ binaryfunc slot = mv->nb_subtract;
462
+
463
+ if (likely(slot != NULL)) {
464
+ PyObject *x = slot(coerced1, coerced2);
465
+
466
+ Py_DECREF(coerced1);
467
+ Py_DECREF(coerced2);
468
+
469
+ obj_result = x;
470
+ goto exit_inplace_result_object;
471
+ }
472
+ }
473
+
474
+ // nb_coerce took a reference.
475
+ Py_DECREF(coerced1);
476
+ Py_DECREF(coerced2);
477
+ }
478
+ }
479
+ }
480
+ #endif
481
+
482
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'int' and '%s'", type2->tp_name);
483
+ goto exit_inplace_exception;
484
+ }
485
+
486
+ exit_inplace_result_object:
487
+ if (unlikely(obj_result == NULL)) {
488
+ return false;
489
+ }
490
+
491
+ // We got an object handed, that we have to release.
492
+ Py_DECREF(*operand1);
493
+
494
+ // That's our return value then. As we use a dedicated variable, it's
495
+ // OK that way.
496
+ *operand1 = obj_result;
497
+
498
+ return true;
499
+
500
+ exit_inplace_exception:
501
+ return false;
502
+ }
503
+ static inline bool _INPLACE_OPERATION_SUB_INT_OBJECT(PyObject **operand1, PyObject *operand2) {
504
+ assert(operand1); // Pointer must be non-null.
505
+
506
+ CHECK_OBJECT(*operand1);
507
+ assert(PyInt_CheckExact(*operand1));
508
+ CHECK_OBJECT(operand2);
509
+
510
+ PyTypeObject *type2 = Py_TYPE(operand2);
511
+
512
+ if (&PyInt_Type == type2) {
513
+ // return _BINARY_OPERATION_SUB_INT_INT_INPLACE(operand1, operand2);
514
+
515
+ // Not every code path will make use of all possible results.
516
+ #ifdef _MSC_VER
517
+ #pragma warning(push)
518
+ #pragma warning(disable : 4101)
519
+ #endif
520
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
521
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
522
+ NUITKA_MAY_BE_UNUSED long clong_result;
523
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
524
+ #ifdef _MSC_VER
525
+ #pragma warning(pop)
526
+ #endif
527
+
528
+ CHECK_OBJECT(*operand1);
529
+ assert(PyInt_CheckExact(*operand1));
530
+ CHECK_OBJECT(operand2);
531
+ assert(PyInt_CheckExact(operand2));
532
+
533
+ const long a = PyInt_AS_LONG(*operand1);
534
+ const long b = PyInt_AS_LONG(operand2);
535
+
536
+ const long x = (long)((unsigned long)a - b);
537
+ bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);
538
+ if (likely(no_overflow)) {
539
+ clong_result = x;
540
+ goto exit_result_ok_clong;
541
+ }
542
+
543
+ {
544
+ PyObject *operand1_object = *operand1;
545
+ PyObject *operand2_object = operand2;
546
+
547
+ PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);
548
+ assert(r != Py_NotImplemented);
549
+
550
+ obj_result = r;
551
+ goto exit_result_object;
552
+ }
553
+
554
+ exit_result_ok_clong:
555
+
556
+ // We got an object handed, that we have to release.
557
+ Py_DECREF(*operand1);
558
+
559
+ // That's our return value then. As we use a dedicated variable, it's
560
+ // OK that way.
561
+ *operand1 = Nuitka_PyInt_FromLong(clong_result);
562
+ goto exit_result_ok;
563
+
564
+ exit_result_object:
565
+ if (unlikely(obj_result == NULL)) {
566
+ goto exit_result_exception;
567
+ }
568
+ // We got an object handed, that we have to release.
569
+ Py_DECREF(*operand1);
570
+
571
+ *operand1 = obj_result;
572
+ goto exit_result_ok;
573
+
574
+ exit_result_ok:
575
+ return true;
576
+
577
+ exit_result_exception:
578
+ return false;
579
+ }
580
+
581
+ return __INPLACE_OPERATION_SUB_INT_OBJECT(operand1, operand2);
582
+ }
583
+
584
+ bool INPLACE_OPERATION_SUB_INT_OBJECT(PyObject **operand1, PyObject *operand2) {
585
+ return _INPLACE_OPERATION_SUB_INT_OBJECT(operand1, operand2);
586
+ }
587
+ #endif
588
+
589
+ /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */
590
+ static inline bool _INPLACE_OPERATION_SUB_LONG_LONG(PyObject **operand1, PyObject *operand2) {
591
+ assert(operand1); // Pointer must be non-null.
592
+
593
+ CHECK_OBJECT(*operand1);
594
+ assert(PyLong_CheckExact(*operand1));
595
+ CHECK_OBJECT(operand2);
596
+ assert(PyLong_CheckExact(operand2));
597
+
598
+ // Not every code path will make use of all possible results.
599
+ #ifdef _MSC_VER
600
+ #pragma warning(push)
601
+ #pragma warning(disable : 4101)
602
+ #endif
603
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
604
+ NUITKA_MAY_BE_UNUSED long clong_result;
605
+ #ifdef _MSC_VER
606
+ #pragma warning(pop)
607
+ #endif
608
+
609
+ PyLongObject *operand1_long_object = (PyLongObject *)*operand1;
610
+
611
+ PyLongObject *operand2_long_object = (PyLongObject *)operand2;
612
+
613
+ if (Nuitka_LongGetDigitSize(operand1_long_object) <= 1 && Nuitka_LongGetDigitSize(operand2_long_object) <= 1) {
614
+ long r = (long)(MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object));
615
+
616
+ if (Py_REFCNT(*operand1) == 1) {
617
+ Nuitka_LongUpdateFromCLong(&*operand1, r);
618
+ goto exit_result_ok;
619
+ } else {
620
+ PyObject *obj = Nuitka_LongFromCLong(r);
621
+
622
+ obj_result = obj;
623
+ goto exit_result_object;
624
+ }
625
+ clong_result = r;
626
+ goto exit_result_ok_clong;
627
+ }
628
+
629
+ if (Py_REFCNT(*operand1) == 1) {
630
+ digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);
631
+ Py_ssize_t b_digit_count = Nuitka_LongGetDigitSize(operand2_long_object);
632
+
633
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
634
+ bool b_negative = Nuitka_LongIsNegative(operand2_long_object);
635
+
636
+ if (a_negative) {
637
+ if (b_negative) {
638
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);
639
+ } else {
640
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
641
+ Nuitka_LongSetSignNegative(*operand1);
642
+ }
643
+ } else {
644
+ if (b_negative) {
645
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
646
+ } else {
647
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);
648
+ }
649
+ }
650
+
651
+ goto exit_result_ok;
652
+ }
653
+ {
654
+ PyLongObject *z;
655
+
656
+ digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);
657
+ Py_ssize_t a_digit_count = Nuitka_LongGetDigitSize(operand1_long_object);
658
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
659
+ digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);
660
+ Py_ssize_t b_digit_count = Nuitka_LongGetDigitSize(operand2_long_object);
661
+ bool b_negative = Nuitka_LongIsNegative(operand2_long_object);
662
+
663
+ if (a_negative) {
664
+ if (b_negative) {
665
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
666
+ } else {
667
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
668
+ }
669
+
670
+ Nuitka_LongFlipSign(z);
671
+ } else {
672
+ if (b_negative) {
673
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
674
+ } else {
675
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
676
+ }
677
+ }
678
+
679
+ obj_result = (PyObject *)z;
680
+ goto exit_result_object;
681
+ }
682
+
683
+ exit_result_object:
684
+ if (unlikely(obj_result == NULL)) {
685
+ goto exit_result_exception;
686
+ }
687
+ // We got an object handed, that we have to release.
688
+ Py_DECREF(*operand1);
689
+ *operand1 = obj_result;
690
+ goto exit_result_ok;
691
+
692
+ exit_result_ok_clong:
693
+
694
+ // We got an object handed, that we have to release.
695
+ Py_DECREF(*operand1);
696
+
697
+ // That's our return value then. As we use a dedicated variable, it's
698
+ // OK that way.
699
+ *operand1 = Nuitka_PyLong_FromLong(clong_result);
700
+ goto exit_result_ok;
701
+
702
+ exit_result_ok:
703
+ return true;
704
+
705
+ exit_result_exception:
706
+ return false;
707
+ }
708
+
709
+ bool INPLACE_OPERATION_SUB_LONG_LONG(PyObject **operand1, PyObject *operand2) {
710
+ return _INPLACE_OPERATION_SUB_LONG_LONG(operand1, operand2);
711
+ }
712
+
713
+ /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
714
+ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {
715
+ PyTypeObject *type1 = Py_TYPE(*operand1);
716
+
717
+ #ifdef _MSC_VER
718
+ #pragma warning(push)
719
+ #pragma warning(disable : 4101)
720
+ #endif
721
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
722
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
723
+ #ifdef _MSC_VER
724
+ #pragma warning(pop)
725
+ #endif
726
+
727
+ binaryfunc islot =
728
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_subtract : NULL;
729
+
730
+ if (islot != NULL) {
731
+ PyObject *x = islot(*operand1, operand2);
732
+
733
+ if (x != Py_NotImplemented) {
734
+ obj_result = x;
735
+ goto exit_inplace_result_object;
736
+ }
737
+
738
+ Py_DECREF_IMMORTAL(x);
739
+ }
740
+
741
+ {
742
+ binaryfunc slot1 =
743
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;
744
+ binaryfunc slot2 = NULL;
745
+
746
+ if (!(type1 == &PyLong_Type)) {
747
+ // Different types, need to consider second value slot.
748
+
749
+ slot2 = PyLong_Type.tp_as_number->nb_subtract;
750
+
751
+ if (slot1 == slot2) {
752
+ slot2 = NULL;
753
+ }
754
+ }
755
+
756
+ if (slot1 != NULL) {
757
+ PyObject *x = slot1(*operand1, operand2);
758
+
759
+ if (x != Py_NotImplemented) {
760
+ obj_result = x;
761
+ goto exit_inplace_result_object;
762
+ }
763
+
764
+ Py_DECREF_IMMORTAL(x);
765
+ }
766
+
767
+ if (slot2 != NULL) {
768
+ PyObject *x = slot2(*operand1, operand2);
769
+
770
+ if (x != Py_NotImplemented) {
771
+ obj_result = x;
772
+ goto exit_inplace_result_object;
773
+ }
774
+
775
+ Py_DECREF_IMMORTAL(x);
776
+ }
777
+
778
+ #if PYTHON_VERSION < 0x300
779
+ if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
780
+ coercion c1 =
781
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
782
+
783
+ if (c1 != NULL) {
784
+ PyObject *coerced1 = *operand1;
785
+ PyObject *coerced2 = operand2;
786
+
787
+ int err = c1(&coerced1, &coerced2);
788
+
789
+ if (unlikely(err < 0)) {
790
+ goto exit_inplace_exception;
791
+ }
792
+
793
+ if (err == 0) {
794
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
795
+
796
+ if (likely(mv == NULL)) {
797
+ binaryfunc slot = mv->nb_subtract;
798
+
799
+ if (likely(slot != NULL)) {
800
+ PyObject *x = slot(coerced1, coerced2);
801
+
802
+ Py_DECREF(coerced1);
803
+ Py_DECREF(coerced2);
804
+
805
+ obj_result = x;
806
+ goto exit_inplace_result_object;
807
+ }
808
+ }
809
+
810
+ // nb_coerce took a reference.
811
+ Py_DECREF(coerced1);
812
+ Py_DECREF(coerced2);
813
+ }
814
+ }
815
+ coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
816
+
817
+ if (c2 != NULL) {
818
+ PyObject *coerced1 = *operand1;
819
+ PyObject *coerced2 = operand2;
820
+
821
+ int err = c2(&coerced2, &coerced1);
822
+
823
+ if (unlikely(err < 0)) {
824
+ goto exit_inplace_exception;
825
+ }
826
+
827
+ if (err == 0) {
828
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
829
+
830
+ if (likely(mv == NULL)) {
831
+ binaryfunc slot = mv->nb_subtract;
832
+
833
+ if (likely(slot != NULL)) {
834
+ PyObject *x = slot(coerced1, coerced2);
835
+
836
+ Py_DECREF(coerced1);
837
+ Py_DECREF(coerced2);
838
+
839
+ obj_result = x;
840
+ goto exit_inplace_result_object;
841
+ }
842
+ }
843
+
844
+ // nb_coerce took a reference.
845
+ Py_DECREF(coerced1);
846
+ Py_DECREF(coerced2);
847
+ }
848
+ }
849
+ }
850
+ #endif
851
+
852
+ #if PYTHON_VERSION < 0x300
853
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: '%s' and 'long'", type1->tp_name);
854
+ #else
855
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: '%s' and 'int'", type1->tp_name);
856
+ #endif
857
+ goto exit_inplace_exception;
858
+ }
859
+
860
+ exit_inplace_result_object:
861
+ if (unlikely(obj_result == NULL)) {
862
+ return false;
863
+ }
864
+
865
+ // We got an object handed, that we have to release.
866
+ Py_DECREF(*operand1);
867
+
868
+ // That's our return value then. As we use a dedicated variable, it's
869
+ // OK that way.
870
+ *operand1 = obj_result;
871
+
872
+ return true;
873
+
874
+ exit_inplace_exception:
875
+ return false;
876
+ }
877
+ static inline bool _INPLACE_OPERATION_SUB_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {
878
+ assert(operand1); // Pointer must be non-null.
879
+
880
+ CHECK_OBJECT(*operand1);
881
+ CHECK_OBJECT(operand2);
882
+ assert(PyLong_CheckExact(operand2));
883
+
884
+ PyTypeObject *type1 = Py_TYPE(*operand1);
885
+
886
+ if (type1 == &PyLong_Type) {
887
+ // return _BINARY_OPERATION_SUB_LONG_LONG_INPLACE(operand1, operand2);
888
+
889
+ // Not every code path will make use of all possible results.
890
+ #ifdef _MSC_VER
891
+ #pragma warning(push)
892
+ #pragma warning(disable : 4101)
893
+ #endif
894
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
895
+ NUITKA_MAY_BE_UNUSED long clong_result;
896
+ #ifdef _MSC_VER
897
+ #pragma warning(pop)
898
+ #endif
899
+
900
+ PyLongObject *operand1_long_object = (PyLongObject *)*operand1;
901
+
902
+ PyLongObject *operand2_long_object = (PyLongObject *)operand2;
903
+
904
+ if (Nuitka_LongGetDigitSize(operand1_long_object) <= 1 && Nuitka_LongGetDigitSize(operand2_long_object) <= 1) {
905
+ long r = (long)(MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object));
906
+
907
+ if (Py_REFCNT(*operand1) == 1) {
908
+ Nuitka_LongUpdateFromCLong(&*operand1, r);
909
+ goto exit_result_ok;
910
+ } else {
911
+ PyObject *obj = Nuitka_LongFromCLong(r);
912
+
913
+ obj_result = obj;
914
+ goto exit_result_object;
915
+ }
916
+ clong_result = r;
917
+ goto exit_result_ok_clong;
918
+ }
919
+
920
+ if (Py_REFCNT(*operand1) == 1) {
921
+ digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);
922
+ Py_ssize_t b_digit_count = Nuitka_LongGetDigitSize(operand2_long_object);
923
+
924
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
925
+ bool b_negative = Nuitka_LongIsNegative(operand2_long_object);
926
+
927
+ if (a_negative) {
928
+ if (b_negative) {
929
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);
930
+ } else {
931
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
932
+ Nuitka_LongSetSignNegative(*operand1);
933
+ }
934
+ } else {
935
+ if (b_negative) {
936
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
937
+ } else {
938
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);
939
+ }
940
+ }
941
+
942
+ goto exit_result_ok;
943
+ }
944
+ {
945
+ PyLongObject *z;
946
+
947
+ digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);
948
+ Py_ssize_t a_digit_count = Nuitka_LongGetDigitSize(operand1_long_object);
949
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
950
+ digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);
951
+ Py_ssize_t b_digit_count = Nuitka_LongGetDigitSize(operand2_long_object);
952
+ bool b_negative = Nuitka_LongIsNegative(operand2_long_object);
953
+
954
+ if (a_negative) {
955
+ if (b_negative) {
956
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
957
+ } else {
958
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
959
+ }
960
+
961
+ Nuitka_LongFlipSign(z);
962
+ } else {
963
+ if (b_negative) {
964
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
965
+ } else {
966
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
967
+ }
968
+ }
969
+
970
+ obj_result = (PyObject *)z;
971
+ goto exit_result_object;
972
+ }
973
+
974
+ exit_result_object:
975
+ if (unlikely(obj_result == NULL)) {
976
+ goto exit_result_exception;
977
+ }
978
+ // We got an object handed, that we have to release.
979
+ Py_DECREF(*operand1);
980
+ *operand1 = obj_result;
981
+ goto exit_result_ok;
982
+
983
+ exit_result_ok_clong:
984
+
985
+ // We got an object handed, that we have to release.
986
+ Py_DECREF(*operand1);
987
+
988
+ // That's our return value then. As we use a dedicated variable, it's
989
+ // OK that way.
990
+ *operand1 = Nuitka_PyLong_FromLong(clong_result);
991
+ goto exit_result_ok;
992
+
993
+ exit_result_ok:
994
+ return true;
995
+
996
+ exit_result_exception:
997
+ return false;
998
+ }
999
+
1000
+ return __INPLACE_OPERATION_SUB_OBJECT_LONG(operand1, operand2);
1001
+ }
1002
+
1003
+ bool INPLACE_OPERATION_SUB_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {
1004
+ return _INPLACE_OPERATION_SUB_OBJECT_LONG(operand1, operand2);
1005
+ }
1006
+
1007
+ /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */
1008
+ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {
1009
+ PyTypeObject *type2 = Py_TYPE(operand2);
1010
+
1011
+ #ifdef _MSC_VER
1012
+ #pragma warning(push)
1013
+ #pragma warning(disable : 4101)
1014
+ #endif
1015
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
1016
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1017
+ #ifdef _MSC_VER
1018
+ #pragma warning(pop)
1019
+ #endif
1020
+
1021
+ // No inplace number slot nb_inplace_subtract available for this type.
1022
+
1023
+ {
1024
+ binaryfunc slot1 = PyLong_Type.tp_as_number->nb_subtract;
1025
+ binaryfunc slot2 = NULL;
1026
+
1027
+ if (!(&PyLong_Type == type2)) {
1028
+ // Different types, need to consider second value slot.
1029
+
1030
+ slot2 =
1031
+ (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;
1032
+
1033
+ if (slot1 == slot2) {
1034
+ slot2 = NULL;
1035
+ }
1036
+ }
1037
+
1038
+ if (slot1 != NULL) {
1039
+ if (slot2 != NULL) {
1040
+ if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
1041
+ PyObject *x = slot2(*operand1, operand2);
1042
+
1043
+ if (x != Py_NotImplemented) {
1044
+ obj_result = x;
1045
+ goto exit_inplace_result_object;
1046
+ }
1047
+
1048
+ Py_DECREF_IMMORTAL(x);
1049
+ slot2 = NULL;
1050
+ }
1051
+ }
1052
+
1053
+ PyObject *x = slot1(*operand1, operand2);
1054
+
1055
+ if (x != Py_NotImplemented) {
1056
+ obj_result = x;
1057
+ goto exit_inplace_result_object;
1058
+ }
1059
+
1060
+ Py_DECREF_IMMORTAL(x);
1061
+ }
1062
+
1063
+ if (slot2 != NULL) {
1064
+ PyObject *x = slot2(*operand1, operand2);
1065
+
1066
+ if (x != Py_NotImplemented) {
1067
+ obj_result = x;
1068
+ goto exit_inplace_result_object;
1069
+ }
1070
+
1071
+ Py_DECREF_IMMORTAL(x);
1072
+ }
1073
+
1074
+ #if PYTHON_VERSION < 0x300
1075
+ if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1076
+ coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
1077
+
1078
+ if (c1 != NULL) {
1079
+ PyObject *coerced1 = *operand1;
1080
+ PyObject *coerced2 = operand2;
1081
+
1082
+ int err = c1(&coerced1, &coerced2);
1083
+
1084
+ if (unlikely(err < 0)) {
1085
+ goto exit_inplace_exception;
1086
+ }
1087
+
1088
+ if (err == 0) {
1089
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1090
+
1091
+ if (likely(mv == NULL)) {
1092
+ binaryfunc slot = mv->nb_subtract;
1093
+
1094
+ if (likely(slot != NULL)) {
1095
+ PyObject *x = slot(coerced1, coerced2);
1096
+
1097
+ Py_DECREF(coerced1);
1098
+ Py_DECREF(coerced2);
1099
+
1100
+ obj_result = x;
1101
+ goto exit_inplace_result_object;
1102
+ }
1103
+ }
1104
+
1105
+ // nb_coerce took a reference.
1106
+ Py_DECREF(coerced1);
1107
+ Py_DECREF(coerced2);
1108
+ }
1109
+ }
1110
+ coercion c2 =
1111
+ (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1112
+
1113
+ if (c2 != NULL) {
1114
+ PyObject *coerced1 = *operand1;
1115
+ PyObject *coerced2 = operand2;
1116
+
1117
+ int err = c2(&coerced2, &coerced1);
1118
+
1119
+ if (unlikely(err < 0)) {
1120
+ goto exit_inplace_exception;
1121
+ }
1122
+
1123
+ if (err == 0) {
1124
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1125
+
1126
+ if (likely(mv == NULL)) {
1127
+ binaryfunc slot = mv->nb_subtract;
1128
+
1129
+ if (likely(slot != NULL)) {
1130
+ PyObject *x = slot(coerced1, coerced2);
1131
+
1132
+ Py_DECREF(coerced1);
1133
+ Py_DECREF(coerced2);
1134
+
1135
+ obj_result = x;
1136
+ goto exit_inplace_result_object;
1137
+ }
1138
+ }
1139
+
1140
+ // nb_coerce took a reference.
1141
+ Py_DECREF(coerced1);
1142
+ Py_DECREF(coerced2);
1143
+ }
1144
+ }
1145
+ }
1146
+ #endif
1147
+
1148
+ #if PYTHON_VERSION < 0x300
1149
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'long' and '%s'", type2->tp_name);
1150
+ #else
1151
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'int' and '%s'", type2->tp_name);
1152
+ #endif
1153
+ goto exit_inplace_exception;
1154
+ }
1155
+
1156
+ exit_inplace_result_object:
1157
+ if (unlikely(obj_result == NULL)) {
1158
+ return false;
1159
+ }
1160
+
1161
+ // We got an object handed, that we have to release.
1162
+ Py_DECREF(*operand1);
1163
+
1164
+ // That's our return value then. As we use a dedicated variable, it's
1165
+ // OK that way.
1166
+ *operand1 = obj_result;
1167
+
1168
+ return true;
1169
+
1170
+ exit_inplace_exception:
1171
+ return false;
1172
+ }
1173
+ static inline bool _INPLACE_OPERATION_SUB_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {
1174
+ assert(operand1); // Pointer must be non-null.
1175
+
1176
+ CHECK_OBJECT(*operand1);
1177
+ assert(PyLong_CheckExact(*operand1));
1178
+ CHECK_OBJECT(operand2);
1179
+
1180
+ PyTypeObject *type2 = Py_TYPE(operand2);
1181
+
1182
+ if (&PyLong_Type == type2) {
1183
+ // return _BINARY_OPERATION_SUB_LONG_LONG_INPLACE(operand1, operand2);
1184
+
1185
+ // Not every code path will make use of all possible results.
1186
+ #ifdef _MSC_VER
1187
+ #pragma warning(push)
1188
+ #pragma warning(disable : 4101)
1189
+ #endif
1190
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1191
+ NUITKA_MAY_BE_UNUSED long clong_result;
1192
+ #ifdef _MSC_VER
1193
+ #pragma warning(pop)
1194
+ #endif
1195
+
1196
+ PyLongObject *operand1_long_object = (PyLongObject *)*operand1;
1197
+
1198
+ PyLongObject *operand2_long_object = (PyLongObject *)operand2;
1199
+
1200
+ if (Nuitka_LongGetDigitSize(operand1_long_object) <= 1 && Nuitka_LongGetDigitSize(operand2_long_object) <= 1) {
1201
+ long r = (long)(MEDIUM_VALUE(operand1_long_object) - MEDIUM_VALUE(operand2_long_object));
1202
+
1203
+ if (Py_REFCNT(*operand1) == 1) {
1204
+ Nuitka_LongUpdateFromCLong(&*operand1, r);
1205
+ goto exit_result_ok;
1206
+ } else {
1207
+ PyObject *obj = Nuitka_LongFromCLong(r);
1208
+
1209
+ obj_result = obj;
1210
+ goto exit_result_object;
1211
+ }
1212
+ clong_result = r;
1213
+ goto exit_result_ok_clong;
1214
+ }
1215
+
1216
+ if (Py_REFCNT(*operand1) == 1) {
1217
+ digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);
1218
+ Py_ssize_t b_digit_count = Nuitka_LongGetDigitSize(operand2_long_object);
1219
+
1220
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
1221
+ bool b_negative = Nuitka_LongIsNegative(operand2_long_object);
1222
+
1223
+ if (a_negative) {
1224
+ if (b_negative) {
1225
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);
1226
+ } else {
1227
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
1228
+ Nuitka_LongSetSignNegative(*operand1);
1229
+ }
1230
+ } else {
1231
+ if (b_negative) {
1232
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
1233
+ } else {
1234
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);
1235
+ }
1236
+ }
1237
+
1238
+ goto exit_result_ok;
1239
+ }
1240
+ {
1241
+ PyLongObject *z;
1242
+
1243
+ digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);
1244
+ Py_ssize_t a_digit_count = Nuitka_LongGetDigitSize(operand1_long_object);
1245
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
1246
+ digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);
1247
+ Py_ssize_t b_digit_count = Nuitka_LongGetDigitSize(operand2_long_object);
1248
+ bool b_negative = Nuitka_LongIsNegative(operand2_long_object);
1249
+
1250
+ if (a_negative) {
1251
+ if (b_negative) {
1252
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
1253
+ } else {
1254
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
1255
+ }
1256
+
1257
+ Nuitka_LongFlipSign(z);
1258
+ } else {
1259
+ if (b_negative) {
1260
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
1261
+ } else {
1262
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
1263
+ }
1264
+ }
1265
+
1266
+ obj_result = (PyObject *)z;
1267
+ goto exit_result_object;
1268
+ }
1269
+
1270
+ exit_result_object:
1271
+ if (unlikely(obj_result == NULL)) {
1272
+ goto exit_result_exception;
1273
+ }
1274
+ // We got an object handed, that we have to release.
1275
+ Py_DECREF(*operand1);
1276
+ *operand1 = obj_result;
1277
+ goto exit_result_ok;
1278
+
1279
+ exit_result_ok_clong:
1280
+
1281
+ // We got an object handed, that we have to release.
1282
+ Py_DECREF(*operand1);
1283
+
1284
+ // That's our return value then. As we use a dedicated variable, it's
1285
+ // OK that way.
1286
+ *operand1 = Nuitka_PyLong_FromLong(clong_result);
1287
+ goto exit_result_ok;
1288
+
1289
+ exit_result_ok:
1290
+ return true;
1291
+
1292
+ exit_result_exception:
1293
+ return false;
1294
+ }
1295
+
1296
+ return __INPLACE_OPERATION_SUB_LONG_OBJECT(operand1, operand2);
1297
+ }
1298
+
1299
+ bool INPLACE_OPERATION_SUB_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {
1300
+ return _INPLACE_OPERATION_SUB_LONG_OBJECT(operand1, operand2);
1301
+ }
1302
+
1303
+ /* Code referring to "FLOAT" corresponds to Python 'float' and "FLOAT" to Python 'float'. */
1304
+ static inline bool _INPLACE_OPERATION_SUB_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {
1305
+ assert(operand1); // Pointer must be non-null.
1306
+
1307
+ CHECK_OBJECT(*operand1);
1308
+ assert(PyFloat_CheckExact(*operand1));
1309
+ CHECK_OBJECT(operand2);
1310
+ assert(PyFloat_CheckExact(operand2));
1311
+
1312
+ #ifdef _MSC_VER
1313
+ #pragma warning(push)
1314
+ #pragma warning(disable : 4101)
1315
+ #endif
1316
+ // Not every code path will make use of all possible results.
1317
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1318
+ NUITKA_MAY_BE_UNUSED long clong_result;
1319
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
1320
+ #ifdef _MSC_VER
1321
+ #pragma warning(pop)
1322
+ #endif
1323
+
1324
+ CHECK_OBJECT(*operand1);
1325
+ assert(PyFloat_CheckExact(*operand1));
1326
+ CHECK_OBJECT(operand2);
1327
+ assert(PyFloat_CheckExact(operand2));
1328
+
1329
+ const double a = PyFloat_AS_DOUBLE(*operand1);
1330
+ const double b = PyFloat_AS_DOUBLE(operand2);
1331
+
1332
+ double r = a - b;
1333
+
1334
+ cfloat_result = r;
1335
+ goto exit_result_ok_cfloat;
1336
+
1337
+ exit_result_ok_cfloat:
1338
+ if (Py_REFCNT(*operand1) == 1) {
1339
+ PyFloat_SET_DOUBLE(*operand1, cfloat_result);
1340
+ } else {
1341
+ // We got an object handed, that we have to release.
1342
+ Py_DECREF(*operand1);
1343
+
1344
+ *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
1345
+ }
1346
+ goto exit_result_ok;
1347
+
1348
+ exit_result_ok:
1349
+ return true;
1350
+ }
1351
+
1352
+ bool INPLACE_OPERATION_SUB_FLOAT_FLOAT(PyObject **operand1, PyObject *operand2) {
1353
+ return _INPLACE_OPERATION_SUB_FLOAT_FLOAT(operand1, operand2);
1354
+ }
1355
+
1356
+ /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
1357
+ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {
1358
+ PyTypeObject *type1 = Py_TYPE(*operand1);
1359
+
1360
+ #ifdef _MSC_VER
1361
+ #pragma warning(push)
1362
+ #pragma warning(disable : 4101)
1363
+ #endif
1364
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
1365
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1366
+ #ifdef _MSC_VER
1367
+ #pragma warning(pop)
1368
+ #endif
1369
+
1370
+ binaryfunc islot =
1371
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_subtract : NULL;
1372
+
1373
+ if (islot != NULL) {
1374
+ PyObject *x = islot(*operand1, operand2);
1375
+
1376
+ if (x != Py_NotImplemented) {
1377
+ obj_result = x;
1378
+ goto exit_inplace_result_object;
1379
+ }
1380
+
1381
+ Py_DECREF_IMMORTAL(x);
1382
+ }
1383
+
1384
+ {
1385
+ binaryfunc slot1 =
1386
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;
1387
+ binaryfunc slot2 = NULL;
1388
+
1389
+ if (!(type1 == &PyFloat_Type)) {
1390
+ // Different types, need to consider second value slot.
1391
+
1392
+ slot2 = PyFloat_Type.tp_as_number->nb_subtract;
1393
+
1394
+ if (slot1 == slot2) {
1395
+ slot2 = NULL;
1396
+ }
1397
+ }
1398
+
1399
+ if (slot1 != NULL) {
1400
+ PyObject *x = slot1(*operand1, operand2);
1401
+
1402
+ if (x != Py_NotImplemented) {
1403
+ obj_result = x;
1404
+ goto exit_inplace_result_object;
1405
+ }
1406
+
1407
+ Py_DECREF_IMMORTAL(x);
1408
+ }
1409
+
1410
+ if (slot2 != NULL) {
1411
+ PyObject *x = slot2(*operand1, operand2);
1412
+
1413
+ if (x != Py_NotImplemented) {
1414
+ obj_result = x;
1415
+ goto exit_inplace_result_object;
1416
+ }
1417
+
1418
+ Py_DECREF_IMMORTAL(x);
1419
+ }
1420
+
1421
+ #if PYTHON_VERSION < 0x300
1422
+ if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
1423
+ coercion c1 =
1424
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1425
+
1426
+ if (c1 != NULL) {
1427
+ PyObject *coerced1 = *operand1;
1428
+ PyObject *coerced2 = operand2;
1429
+
1430
+ int err = c1(&coerced1, &coerced2);
1431
+
1432
+ if (unlikely(err < 0)) {
1433
+ goto exit_inplace_exception;
1434
+ }
1435
+
1436
+ if (err == 0) {
1437
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1438
+
1439
+ if (likely(mv == NULL)) {
1440
+ binaryfunc slot = mv->nb_subtract;
1441
+
1442
+ if (likely(slot != NULL)) {
1443
+ PyObject *x = slot(coerced1, coerced2);
1444
+
1445
+ Py_DECREF(coerced1);
1446
+ Py_DECREF(coerced2);
1447
+
1448
+ obj_result = x;
1449
+ goto exit_inplace_result_object;
1450
+ }
1451
+ }
1452
+
1453
+ // nb_coerce took a reference.
1454
+ Py_DECREF(coerced1);
1455
+ Py_DECREF(coerced2);
1456
+ }
1457
+ }
1458
+ coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;
1459
+
1460
+ if (c2 != NULL) {
1461
+ PyObject *coerced1 = *operand1;
1462
+ PyObject *coerced2 = operand2;
1463
+
1464
+ int err = c2(&coerced2, &coerced1);
1465
+
1466
+ if (unlikely(err < 0)) {
1467
+ goto exit_inplace_exception;
1468
+ }
1469
+
1470
+ if (err == 0) {
1471
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1472
+
1473
+ if (likely(mv == NULL)) {
1474
+ binaryfunc slot = mv->nb_subtract;
1475
+
1476
+ if (likely(slot != NULL)) {
1477
+ PyObject *x = slot(coerced1, coerced2);
1478
+
1479
+ Py_DECREF(coerced1);
1480
+ Py_DECREF(coerced2);
1481
+
1482
+ obj_result = x;
1483
+ goto exit_inplace_result_object;
1484
+ }
1485
+ }
1486
+
1487
+ // nb_coerce took a reference.
1488
+ Py_DECREF(coerced1);
1489
+ Py_DECREF(coerced2);
1490
+ }
1491
+ }
1492
+ }
1493
+ #endif
1494
+
1495
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: '%s' and 'float'", type1->tp_name);
1496
+ goto exit_inplace_exception;
1497
+ }
1498
+
1499
+ exit_inplace_result_object:
1500
+ if (unlikely(obj_result == NULL)) {
1501
+ return false;
1502
+ }
1503
+
1504
+ // We got an object handed, that we have to release.
1505
+ Py_DECREF(*operand1);
1506
+
1507
+ // That's our return value then. As we use a dedicated variable, it's
1508
+ // OK that way.
1509
+ *operand1 = obj_result;
1510
+
1511
+ return true;
1512
+
1513
+ exit_inplace_exception:
1514
+ return false;
1515
+ }
1516
+ static inline bool _INPLACE_OPERATION_SUB_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {
1517
+ assert(operand1); // Pointer must be non-null.
1518
+
1519
+ CHECK_OBJECT(*operand1);
1520
+ CHECK_OBJECT(operand2);
1521
+ assert(PyFloat_CheckExact(operand2));
1522
+
1523
+ PyTypeObject *type1 = Py_TYPE(*operand1);
1524
+
1525
+ if (type1 == &PyFloat_Type) {
1526
+ // return _BINARY_OPERATION_SUB_FLOAT_FLOAT_INPLACE(operand1, operand2);
1527
+
1528
+ #ifdef _MSC_VER
1529
+ #pragma warning(push)
1530
+ #pragma warning(disable : 4101)
1531
+ #endif
1532
+ // Not every code path will make use of all possible results.
1533
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1534
+ NUITKA_MAY_BE_UNUSED long clong_result;
1535
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
1536
+ #ifdef _MSC_VER
1537
+ #pragma warning(pop)
1538
+ #endif
1539
+
1540
+ CHECK_OBJECT(*operand1);
1541
+ assert(PyFloat_CheckExact(*operand1));
1542
+ CHECK_OBJECT(operand2);
1543
+ assert(PyFloat_CheckExact(operand2));
1544
+
1545
+ const double a = PyFloat_AS_DOUBLE(*operand1);
1546
+ const double b = PyFloat_AS_DOUBLE(operand2);
1547
+
1548
+ double r = a - b;
1549
+
1550
+ cfloat_result = r;
1551
+ goto exit_result_ok_cfloat;
1552
+
1553
+ exit_result_ok_cfloat:
1554
+ if (Py_REFCNT(*operand1) == 1) {
1555
+ PyFloat_SET_DOUBLE(*operand1, cfloat_result);
1556
+ } else {
1557
+ // We got an object handed, that we have to release.
1558
+ Py_DECREF(*operand1);
1559
+
1560
+ *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
1561
+ }
1562
+ goto exit_result_ok;
1563
+
1564
+ exit_result_ok:
1565
+ return true;
1566
+ }
1567
+
1568
+ return __INPLACE_OPERATION_SUB_OBJECT_FLOAT(operand1, operand2);
1569
+ }
1570
+
1571
+ bool INPLACE_OPERATION_SUB_OBJECT_FLOAT(PyObject **operand1, PyObject *operand2) {
1572
+ return _INPLACE_OPERATION_SUB_OBJECT_FLOAT(operand1, operand2);
1573
+ }
1574
+
1575
+ /* Code referring to "FLOAT" corresponds to Python 'float' and "OBJECT" to any Python object. */
1576
+ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_SUB_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {
1577
+ PyTypeObject *type2 = Py_TYPE(operand2);
1578
+
1579
+ #ifdef _MSC_VER
1580
+ #pragma warning(push)
1581
+ #pragma warning(disable : 4101)
1582
+ #endif
1583
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
1584
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1585
+ #ifdef _MSC_VER
1586
+ #pragma warning(pop)
1587
+ #endif
1588
+
1589
+ // No inplace number slot nb_inplace_subtract available for this type.
1590
+
1591
+ {
1592
+ binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;
1593
+ binaryfunc slot2 = NULL;
1594
+
1595
+ if (!(&PyFloat_Type == type2)) {
1596
+ // Different types, need to consider second value slot.
1597
+
1598
+ slot2 =
1599
+ (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;
1600
+
1601
+ if (slot1 == slot2) {
1602
+ slot2 = NULL;
1603
+ }
1604
+ }
1605
+
1606
+ if (slot1 != NULL) {
1607
+ if (slot2 != NULL) {
1608
+ if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
1609
+ PyObject *x = slot2(*operand1, operand2);
1610
+
1611
+ if (x != Py_NotImplemented) {
1612
+ obj_result = x;
1613
+ goto exit_inplace_result_object;
1614
+ }
1615
+
1616
+ Py_DECREF_IMMORTAL(x);
1617
+ slot2 = NULL;
1618
+ }
1619
+ }
1620
+
1621
+ PyObject *x = slot1(*operand1, operand2);
1622
+
1623
+ if (x != Py_NotImplemented) {
1624
+ obj_result = x;
1625
+ goto exit_inplace_result_object;
1626
+ }
1627
+
1628
+ Py_DECREF_IMMORTAL(x);
1629
+ }
1630
+
1631
+ if (slot2 != NULL) {
1632
+ PyObject *x = slot2(*operand1, operand2);
1633
+
1634
+ if (x != Py_NotImplemented) {
1635
+ obj_result = x;
1636
+ goto exit_inplace_result_object;
1637
+ }
1638
+
1639
+ Py_DECREF_IMMORTAL(x);
1640
+ }
1641
+
1642
+ #if PYTHON_VERSION < 0x300
1643
+ if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1644
+ coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;
1645
+
1646
+ if (c1 != NULL) {
1647
+ PyObject *coerced1 = *operand1;
1648
+ PyObject *coerced2 = operand2;
1649
+
1650
+ int err = c1(&coerced1, &coerced2);
1651
+
1652
+ if (unlikely(err < 0)) {
1653
+ goto exit_inplace_exception;
1654
+ }
1655
+
1656
+ if (err == 0) {
1657
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1658
+
1659
+ if (likely(mv == NULL)) {
1660
+ binaryfunc slot = mv->nb_subtract;
1661
+
1662
+ if (likely(slot != NULL)) {
1663
+ PyObject *x = slot(coerced1, coerced2);
1664
+
1665
+ Py_DECREF(coerced1);
1666
+ Py_DECREF(coerced2);
1667
+
1668
+ obj_result = x;
1669
+ goto exit_inplace_result_object;
1670
+ }
1671
+ }
1672
+
1673
+ // nb_coerce took a reference.
1674
+ Py_DECREF(coerced1);
1675
+ Py_DECREF(coerced2);
1676
+ }
1677
+ }
1678
+ coercion c2 =
1679
+ (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1680
+
1681
+ if (c2 != NULL) {
1682
+ PyObject *coerced1 = *operand1;
1683
+ PyObject *coerced2 = operand2;
1684
+
1685
+ int err = c2(&coerced2, &coerced1);
1686
+
1687
+ if (unlikely(err < 0)) {
1688
+ goto exit_inplace_exception;
1689
+ }
1690
+
1691
+ if (err == 0) {
1692
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1693
+
1694
+ if (likely(mv == NULL)) {
1695
+ binaryfunc slot = mv->nb_subtract;
1696
+
1697
+ if (likely(slot != NULL)) {
1698
+ PyObject *x = slot(coerced1, coerced2);
1699
+
1700
+ Py_DECREF(coerced1);
1701
+ Py_DECREF(coerced2);
1702
+
1703
+ obj_result = x;
1704
+ goto exit_inplace_result_object;
1705
+ }
1706
+ }
1707
+
1708
+ // nb_coerce took a reference.
1709
+ Py_DECREF(coerced1);
1710
+ Py_DECREF(coerced2);
1711
+ }
1712
+ }
1713
+ }
1714
+ #endif
1715
+
1716
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'float' and '%s'", type2->tp_name);
1717
+ goto exit_inplace_exception;
1718
+ }
1719
+
1720
+ exit_inplace_result_object:
1721
+ if (unlikely(obj_result == NULL)) {
1722
+ return false;
1723
+ }
1724
+
1725
+ // We got an object handed, that we have to release.
1726
+ Py_DECREF(*operand1);
1727
+
1728
+ // That's our return value then. As we use a dedicated variable, it's
1729
+ // OK that way.
1730
+ *operand1 = obj_result;
1731
+
1732
+ return true;
1733
+
1734
+ exit_inplace_exception:
1735
+ return false;
1736
+ }
1737
+ static inline bool _INPLACE_OPERATION_SUB_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {
1738
+ assert(operand1); // Pointer must be non-null.
1739
+
1740
+ CHECK_OBJECT(*operand1);
1741
+ assert(PyFloat_CheckExact(*operand1));
1742
+ CHECK_OBJECT(operand2);
1743
+
1744
+ PyTypeObject *type2 = Py_TYPE(operand2);
1745
+
1746
+ if (&PyFloat_Type == type2) {
1747
+ // return _BINARY_OPERATION_SUB_FLOAT_FLOAT_INPLACE(operand1, operand2);
1748
+
1749
+ #ifdef _MSC_VER
1750
+ #pragma warning(push)
1751
+ #pragma warning(disable : 4101)
1752
+ #endif
1753
+ // Not every code path will make use of all possible results.
1754
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1755
+ NUITKA_MAY_BE_UNUSED long clong_result;
1756
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
1757
+ #ifdef _MSC_VER
1758
+ #pragma warning(pop)
1759
+ #endif
1760
+
1761
+ CHECK_OBJECT(*operand1);
1762
+ assert(PyFloat_CheckExact(*operand1));
1763
+ CHECK_OBJECT(operand2);
1764
+ assert(PyFloat_CheckExact(operand2));
1765
+
1766
+ const double a = PyFloat_AS_DOUBLE(*operand1);
1767
+ const double b = PyFloat_AS_DOUBLE(operand2);
1768
+
1769
+ double r = a - b;
1770
+
1771
+ cfloat_result = r;
1772
+ goto exit_result_ok_cfloat;
1773
+
1774
+ exit_result_ok_cfloat:
1775
+ if (Py_REFCNT(*operand1) == 1) {
1776
+ PyFloat_SET_DOUBLE(*operand1, cfloat_result);
1777
+ } else {
1778
+ // We got an object handed, that we have to release.
1779
+ Py_DECREF(*operand1);
1780
+
1781
+ *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
1782
+ }
1783
+ goto exit_result_ok;
1784
+
1785
+ exit_result_ok:
1786
+ return true;
1787
+ }
1788
+
1789
+ return __INPLACE_OPERATION_SUB_FLOAT_OBJECT(operand1, operand2);
1790
+ }
1791
+
1792
+ bool INPLACE_OPERATION_SUB_FLOAT_OBJECT(PyObject **operand1, PyObject *operand2) {
1793
+ return _INPLACE_OPERATION_SUB_FLOAT_OBJECT(operand1, operand2);
1794
+ }
1795
+
1796
+ /* Code referring to "FLOAT" corresponds to Python 'float' and "LONG" to Python2 'long', Python3 'int'. */
1797
+ static inline bool _INPLACE_OPERATION_SUB_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {
1798
+ assert(operand1); // Pointer must be non-null.
1799
+
1800
+ CHECK_OBJECT(*operand1);
1801
+ assert(PyFloat_CheckExact(*operand1));
1802
+ CHECK_OBJECT(operand2);
1803
+ assert(PyLong_CheckExact(operand2));
1804
+
1805
+ #ifdef _MSC_VER
1806
+ #pragma warning(push)
1807
+ #pragma warning(disable : 4101)
1808
+ #endif
1809
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
1810
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1811
+ #ifdef _MSC_VER
1812
+ #pragma warning(pop)
1813
+ #endif
1814
+
1815
+ // No inplace number slot nb_inplace_subtract available for this type.
1816
+
1817
+ {
1818
+ binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;
1819
+ // Slot2 ignored on purpose, type1 takes precedence.
1820
+
1821
+ if (slot1 != NULL) {
1822
+ PyObject *x = slot1(*operand1, operand2);
1823
+
1824
+ if (x != Py_NotImplemented) {
1825
+ obj_result = x;
1826
+ goto exit_inplace_result_object;
1827
+ }
1828
+
1829
+ Py_DECREF_IMMORTAL(x);
1830
+ }
1831
+
1832
+ // Statically recognized that coercion is not possible with these types
1833
+
1834
+ #if PYTHON_VERSION < 0x300
1835
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'float' and 'long'");
1836
+ #else
1837
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'float' and 'int'");
1838
+ #endif
1839
+ goto exit_inplace_exception;
1840
+ }
1841
+
1842
+ exit_inplace_result_object:
1843
+ if (unlikely(obj_result == NULL)) {
1844
+ return false;
1845
+ }
1846
+
1847
+ // We got an object handed, that we have to release.
1848
+ Py_DECREF(*operand1);
1849
+
1850
+ // That's our return value then. As we use a dedicated variable, it's
1851
+ // OK that way.
1852
+ *operand1 = obj_result;
1853
+
1854
+ return true;
1855
+
1856
+ exit_inplace_exception:
1857
+ return false;
1858
+ }
1859
+
1860
+ bool INPLACE_OPERATION_SUB_FLOAT_LONG(PyObject **operand1, PyObject *operand2) {
1861
+ return _INPLACE_OPERATION_SUB_FLOAT_LONG(operand1, operand2);
1862
+ }
1863
+
1864
+ /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "FLOAT" to Python 'float'. */
1865
+ static inline bool _INPLACE_OPERATION_SUB_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {
1866
+ assert(operand1); // Pointer must be non-null.
1867
+
1868
+ CHECK_OBJECT(*operand1);
1869
+ assert(PyLong_CheckExact(*operand1));
1870
+ CHECK_OBJECT(operand2);
1871
+ assert(PyFloat_CheckExact(operand2));
1872
+
1873
+ #ifdef _MSC_VER
1874
+ #pragma warning(push)
1875
+ #pragma warning(disable : 4101)
1876
+ #endif
1877
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
1878
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1879
+ #ifdef _MSC_VER
1880
+ #pragma warning(pop)
1881
+ #endif
1882
+
1883
+ // No inplace number slot nb_inplace_subtract available for this type.
1884
+
1885
+ {
1886
+ // Slot1 ignored on purpose, type2 takes precedence.
1887
+ binaryfunc slot2 = NULL;
1888
+
1889
+ if (!(0)) {
1890
+ // Different types, need to consider second value slot.
1891
+
1892
+ slot2 = PyFloat_Type.tp_as_number->nb_subtract;
1893
+ }
1894
+
1895
+ if (slot2 != NULL) {
1896
+ PyObject *x = slot2(*operand1, operand2);
1897
+
1898
+ if (x != Py_NotImplemented) {
1899
+ obj_result = x;
1900
+ goto exit_inplace_result_object;
1901
+ }
1902
+
1903
+ Py_DECREF_IMMORTAL(x);
1904
+ }
1905
+
1906
+ // Statically recognized that coercion is not possible with these types
1907
+
1908
+ #if PYTHON_VERSION < 0x300
1909
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'long' and 'float'");
1910
+ #else
1911
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'int' and 'float'");
1912
+ #endif
1913
+ goto exit_inplace_exception;
1914
+ }
1915
+
1916
+ exit_inplace_result_object:
1917
+ if (unlikely(obj_result == NULL)) {
1918
+ return false;
1919
+ }
1920
+
1921
+ // We got an object handed, that we have to release.
1922
+ Py_DECREF(*operand1);
1923
+
1924
+ // That's our return value then. As we use a dedicated variable, it's
1925
+ // OK that way.
1926
+ *operand1 = obj_result;
1927
+
1928
+ return true;
1929
+
1930
+ exit_inplace_exception:
1931
+ return false;
1932
+ }
1933
+
1934
+ bool INPLACE_OPERATION_SUB_LONG_FLOAT(PyObject **operand1, PyObject *operand2) {
1935
+ return _INPLACE_OPERATION_SUB_LONG_FLOAT(operand1, operand2);
1936
+ }
1937
+
1938
+ #if PYTHON_VERSION < 0x300
1939
+ /* Code referring to "FLOAT" corresponds to Python 'float' and "INT" to Python2 'int'. */
1940
+ static inline bool _INPLACE_OPERATION_SUB_FLOAT_INT(PyObject **operand1, PyObject *operand2) {
1941
+ assert(operand1); // Pointer must be non-null.
1942
+
1943
+ CHECK_OBJECT(*operand1);
1944
+ assert(PyFloat_CheckExact(*operand1));
1945
+ CHECK_OBJECT(operand2);
1946
+ assert(PyInt_CheckExact(operand2));
1947
+
1948
+ #ifdef _MSC_VER
1949
+ #pragma warning(push)
1950
+ #pragma warning(disable : 4101)
1951
+ #endif
1952
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
1953
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1954
+ #ifdef _MSC_VER
1955
+ #pragma warning(pop)
1956
+ #endif
1957
+
1958
+ // No inplace number slot nb_inplace_subtract available for this type.
1959
+
1960
+ {
1961
+ binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_subtract;
1962
+ // Slot2 ignored on purpose, type1 takes precedence.
1963
+
1964
+ if (slot1 != NULL) {
1965
+ PyObject *x = slot1(*operand1, operand2);
1966
+
1967
+ if (x != Py_NotImplemented) {
1968
+ obj_result = x;
1969
+ goto exit_inplace_result_object;
1970
+ }
1971
+
1972
+ Py_DECREF_IMMORTAL(x);
1973
+ }
1974
+
1975
+ // Statically recognized that coercion is not possible with these types
1976
+
1977
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'float' and 'int'");
1978
+ goto exit_inplace_exception;
1979
+ }
1980
+
1981
+ exit_inplace_result_object:
1982
+ if (unlikely(obj_result == NULL)) {
1983
+ return false;
1984
+ }
1985
+
1986
+ // We got an object handed, that we have to release.
1987
+ Py_DECREF(*operand1);
1988
+
1989
+ // That's our return value then. As we use a dedicated variable, it's
1990
+ // OK that way.
1991
+ *operand1 = obj_result;
1992
+
1993
+ return true;
1994
+
1995
+ exit_inplace_exception:
1996
+ return false;
1997
+ }
1998
+
1999
+ bool INPLACE_OPERATION_SUB_FLOAT_INT(PyObject **operand1, PyObject *operand2) {
2000
+ return _INPLACE_OPERATION_SUB_FLOAT_INT(operand1, operand2);
2001
+ }
2002
+ #endif
2003
+
2004
+ #if PYTHON_VERSION < 0x300
2005
+ /* Code referring to "INT" corresponds to Python2 'int' and "FLOAT" to Python 'float'. */
2006
+ static inline bool _INPLACE_OPERATION_SUB_INT_FLOAT(PyObject **operand1, PyObject *operand2) {
2007
+ assert(operand1); // Pointer must be non-null.
2008
+
2009
+ CHECK_OBJECT(*operand1);
2010
+ assert(PyInt_CheckExact(*operand1));
2011
+ CHECK_OBJECT(operand2);
2012
+ assert(PyFloat_CheckExact(operand2));
2013
+
2014
+ #ifdef _MSC_VER
2015
+ #pragma warning(push)
2016
+ #pragma warning(disable : 4101)
2017
+ #endif
2018
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
2019
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2020
+ #ifdef _MSC_VER
2021
+ #pragma warning(pop)
2022
+ #endif
2023
+
2024
+ // No inplace number slot nb_inplace_subtract available for this type.
2025
+
2026
+ {
2027
+ // Slot1 ignored on purpose, type2 takes precedence.
2028
+ binaryfunc slot2 = NULL;
2029
+
2030
+ if (!(0)) {
2031
+ // Different types, need to consider second value slot.
2032
+
2033
+ slot2 = PyFloat_Type.tp_as_number->nb_subtract;
2034
+ }
2035
+
2036
+ if (slot2 != NULL) {
2037
+ PyObject *x = slot2(*operand1, operand2);
2038
+
2039
+ if (x != Py_NotImplemented) {
2040
+ obj_result = x;
2041
+ goto exit_inplace_result_object;
2042
+ }
2043
+
2044
+ Py_DECREF_IMMORTAL(x);
2045
+ }
2046
+
2047
+ // Statically recognized that coercion is not possible with these types
2048
+
2049
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'int' and 'float'");
2050
+ goto exit_inplace_exception;
2051
+ }
2052
+
2053
+ exit_inplace_result_object:
2054
+ if (unlikely(obj_result == NULL)) {
2055
+ return false;
2056
+ }
2057
+
2058
+ // We got an object handed, that we have to release.
2059
+ Py_DECREF(*operand1);
2060
+
2061
+ // That's our return value then. As we use a dedicated variable, it's
2062
+ // OK that way.
2063
+ *operand1 = obj_result;
2064
+
2065
+ return true;
2066
+
2067
+ exit_inplace_exception:
2068
+ return false;
2069
+ }
2070
+
2071
+ bool INPLACE_OPERATION_SUB_INT_FLOAT(PyObject **operand1, PyObject *operand2) {
2072
+ return _INPLACE_OPERATION_SUB_INT_FLOAT(operand1, operand2);
2073
+ }
2074
+ #endif
2075
+
2076
+ #if PYTHON_VERSION < 0x300
2077
+ /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
2078
+ static inline bool _INPLACE_OPERATION_SUB_LONG_INT(PyObject **operand1, PyObject *operand2) {
2079
+ assert(operand1); // Pointer must be non-null.
2080
+
2081
+ CHECK_OBJECT(*operand1);
2082
+ assert(PyLong_CheckExact(*operand1));
2083
+ CHECK_OBJECT(operand2);
2084
+ assert(PyInt_CheckExact(operand2));
2085
+
2086
+ #ifdef _MSC_VER
2087
+ #pragma warning(push)
2088
+ #pragma warning(disable : 4101)
2089
+ #endif
2090
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
2091
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2092
+ #ifdef _MSC_VER
2093
+ #pragma warning(pop)
2094
+ #endif
2095
+
2096
+ // No inplace number slot nb_inplace_subtract available for this type.
2097
+
2098
+ {
2099
+ binaryfunc slot1 = PyLong_Type.tp_as_number->nb_subtract;
2100
+ // Slot2 ignored on purpose, type1 takes precedence.
2101
+
2102
+ if (slot1 != NULL) {
2103
+ PyObject *x = slot1(*operand1, operand2);
2104
+
2105
+ if (x != Py_NotImplemented) {
2106
+ obj_result = x;
2107
+ goto exit_inplace_result_object;
2108
+ }
2109
+
2110
+ Py_DECREF_IMMORTAL(x);
2111
+ }
2112
+
2113
+ // Statically recognized that coercion is not possible with these types
2114
+
2115
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'long' and 'int'");
2116
+ goto exit_inplace_exception;
2117
+ }
2118
+
2119
+ exit_inplace_result_object:
2120
+ if (unlikely(obj_result == NULL)) {
2121
+ return false;
2122
+ }
2123
+
2124
+ // We got an object handed, that we have to release.
2125
+ Py_DECREF(*operand1);
2126
+
2127
+ // That's our return value then. As we use a dedicated variable, it's
2128
+ // OK that way.
2129
+ *operand1 = obj_result;
2130
+
2131
+ return true;
2132
+
2133
+ exit_inplace_exception:
2134
+ return false;
2135
+ }
2136
+
2137
+ bool INPLACE_OPERATION_SUB_LONG_INT(PyObject **operand1, PyObject *operand2) {
2138
+ return _INPLACE_OPERATION_SUB_LONG_INT(operand1, operand2);
2139
+ }
2140
+ #endif
2141
+
2142
+ #if PYTHON_VERSION < 0x300
2143
+ /* Code referring to "INT" corresponds to Python2 'int' and "LONG" to Python2 'long', Python3 'int'. */
2144
+ static inline bool _INPLACE_OPERATION_SUB_INT_LONG(PyObject **operand1, PyObject *operand2) {
2145
+ assert(operand1); // Pointer must be non-null.
2146
+
2147
+ CHECK_OBJECT(*operand1);
2148
+ assert(PyInt_CheckExact(*operand1));
2149
+ CHECK_OBJECT(operand2);
2150
+ assert(PyLong_CheckExact(operand2));
2151
+
2152
+ #ifdef _MSC_VER
2153
+ #pragma warning(push)
2154
+ #pragma warning(disable : 4101)
2155
+ #endif
2156
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
2157
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2158
+ #ifdef _MSC_VER
2159
+ #pragma warning(pop)
2160
+ #endif
2161
+
2162
+ // No inplace number slot nb_inplace_subtract available for this type.
2163
+
2164
+ {
2165
+ // Slot1 ignored on purpose, type2 takes precedence.
2166
+ binaryfunc slot2 = NULL;
2167
+
2168
+ if (!(0)) {
2169
+ // Different types, need to consider second value slot.
2170
+
2171
+ slot2 = PyLong_Type.tp_as_number->nb_subtract;
2172
+ }
2173
+
2174
+ if (slot2 != NULL) {
2175
+ PyObject *x = slot2(*operand1, operand2);
2176
+
2177
+ if (x != Py_NotImplemented) {
2178
+ obj_result = x;
2179
+ goto exit_inplace_result_object;
2180
+ }
2181
+
2182
+ Py_DECREF_IMMORTAL(x);
2183
+ }
2184
+
2185
+ // Statically recognized that coercion is not possible with these types
2186
+
2187
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: 'int' and 'long'");
2188
+ goto exit_inplace_exception;
2189
+ }
2190
+
2191
+ exit_inplace_result_object:
2192
+ if (unlikely(obj_result == NULL)) {
2193
+ return false;
2194
+ }
2195
+
2196
+ // We got an object handed, that we have to release.
2197
+ Py_DECREF(*operand1);
2198
+
2199
+ // That's our return value then. As we use a dedicated variable, it's
2200
+ // OK that way.
2201
+ *operand1 = obj_result;
2202
+
2203
+ return true;
2204
+
2205
+ exit_inplace_exception:
2206
+ return false;
2207
+ }
2208
+
2209
+ bool INPLACE_OPERATION_SUB_INT_LONG(PyObject **operand1, PyObject *operand2) {
2210
+ return _INPLACE_OPERATION_SUB_INT_LONG(operand1, operand2);
2211
+ }
2212
+ #endif
2213
+
2214
+ #if PYTHON_VERSION < 0x300
2215
+ /* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
2216
+ static inline bool _INPLACE_OPERATION_SUB_INT_CLONG(PyObject **operand1, long operand2) {
2217
+ assert(operand1); // Pointer must be non-null.
2218
+
2219
+ CHECK_OBJECT(*operand1);
2220
+ assert(PyInt_CheckExact(*operand1));
2221
+
2222
+ // Not every code path will make use of all possible results.
2223
+ #ifdef _MSC_VER
2224
+ #pragma warning(push)
2225
+ #pragma warning(disable : 4101)
2226
+ #endif
2227
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
2228
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2229
+ NUITKA_MAY_BE_UNUSED long clong_result;
2230
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
2231
+ #ifdef _MSC_VER
2232
+ #pragma warning(pop)
2233
+ #endif
2234
+
2235
+ CHECK_OBJECT(*operand1);
2236
+ assert(PyInt_CheckExact(*operand1));
2237
+
2238
+ const long a = PyInt_AS_LONG(*operand1);
2239
+ const long b = operand2;
2240
+
2241
+ const long x = (long)((unsigned long)a - b);
2242
+ bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);
2243
+ if (likely(no_overflow)) {
2244
+ clong_result = x;
2245
+ goto exit_result_ok_clong;
2246
+ }
2247
+
2248
+ {
2249
+ PyObject *operand1_object = *operand1;
2250
+ PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
2251
+
2252
+ PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);
2253
+ assert(r != Py_NotImplemented);
2254
+
2255
+ Py_DECREF(operand2_object);
2256
+
2257
+ obj_result = r;
2258
+ goto exit_result_object;
2259
+ }
2260
+
2261
+ exit_result_ok_clong:
2262
+
2263
+ // We got an object handed, that we have to release.
2264
+ Py_DECREF(*operand1);
2265
+
2266
+ // That's our return value then. As we use a dedicated variable, it's
2267
+ // OK that way.
2268
+ *operand1 = Nuitka_PyInt_FromLong(clong_result);
2269
+ goto exit_result_ok;
2270
+
2271
+ exit_result_object:
2272
+ if (unlikely(obj_result == NULL)) {
2273
+ goto exit_result_exception;
2274
+ }
2275
+ // We got an object handed, that we have to release.
2276
+ Py_DECREF(*operand1);
2277
+
2278
+ *operand1 = obj_result;
2279
+ goto exit_result_ok;
2280
+
2281
+ exit_result_ok:
2282
+ return true;
2283
+
2284
+ exit_result_exception:
2285
+ return false;
2286
+ }
2287
+
2288
+ bool INPLACE_OPERATION_SUB_INT_CLONG(PyObject **operand1, long operand2) {
2289
+ return _INPLACE_OPERATION_SUB_INT_CLONG(operand1, operand2);
2290
+ }
2291
+ #endif
2292
+
2293
+ /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "DIGIT" to C platform digit value for long
2294
+ * Python objects. */
2295
+ static inline bool _INPLACE_OPERATION_SUB_LONG_DIGIT(PyObject **operand1, long operand2) {
2296
+ assert(operand1); // Pointer must be non-null.
2297
+
2298
+ CHECK_OBJECT(*operand1);
2299
+ assert(PyLong_CheckExact(*operand1));
2300
+ assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));
2301
+
2302
+ // Not every code path will make use of all possible results.
2303
+ #ifdef _MSC_VER
2304
+ #pragma warning(push)
2305
+ #pragma warning(disable : 4101)
2306
+ #endif
2307
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2308
+ NUITKA_MAY_BE_UNUSED long clong_result;
2309
+ #ifdef _MSC_VER
2310
+ #pragma warning(pop)
2311
+ #endif
2312
+
2313
+ PyLongObject *operand1_long_object = (PyLongObject *)*operand1;
2314
+
2315
+ if (Nuitka_LongGetDigitSize(operand1_long_object) <= 1 && (operand2 == 0 ? 0 : 1) <= 1) {
2316
+ long r = (long)(MEDIUM_VALUE(operand1_long_object) - (sdigit)operand2);
2317
+
2318
+ if (Py_REFCNT(*operand1) == 1) {
2319
+ Nuitka_LongUpdateFromCLong(&*operand1, r);
2320
+ goto exit_result_ok;
2321
+ } else {
2322
+ PyObject *obj = Nuitka_LongFromCLong(r);
2323
+
2324
+ obj_result = obj;
2325
+ goto exit_result_object;
2326
+ }
2327
+ clong_result = r;
2328
+ goto exit_result_ok_clong;
2329
+ }
2330
+
2331
+ if (Py_REFCNT(*operand1) == 1) {
2332
+ digit const *b_digits = (digit *)&operand2;
2333
+ Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);
2334
+
2335
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
2336
+ bool b_negative = operand2 < 0;
2337
+
2338
+ if (a_negative) {
2339
+ if (b_negative) {
2340
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);
2341
+ } else {
2342
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
2343
+ Nuitka_LongSetSignNegative(*operand1);
2344
+ }
2345
+ } else {
2346
+ if (b_negative) {
2347
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
2348
+ } else {
2349
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);
2350
+ }
2351
+ }
2352
+
2353
+ goto exit_result_ok;
2354
+ }
2355
+ {
2356
+ PyLongObject *z;
2357
+
2358
+ digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);
2359
+ Py_ssize_t a_digit_count = Nuitka_LongGetDigitSize(operand1_long_object);
2360
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
2361
+ digit const *b_digits = (digit *)&operand2;
2362
+ Py_ssize_t b_digit_count = (operand2 == 0 ? 0 : 1);
2363
+ bool b_negative = operand2 < 0;
2364
+
2365
+ if (a_negative) {
2366
+ if (b_negative) {
2367
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
2368
+ } else {
2369
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
2370
+ }
2371
+
2372
+ Nuitka_LongFlipSign(z);
2373
+ } else {
2374
+ if (b_negative) {
2375
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
2376
+ } else {
2377
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
2378
+ }
2379
+ }
2380
+
2381
+ obj_result = (PyObject *)z;
2382
+ goto exit_result_object;
2383
+ }
2384
+
2385
+ exit_result_object:
2386
+ if (unlikely(obj_result == NULL)) {
2387
+ goto exit_result_exception;
2388
+ }
2389
+ // We got an object handed, that we have to release.
2390
+ Py_DECREF(*operand1);
2391
+ *operand1 = obj_result;
2392
+ goto exit_result_ok;
2393
+
2394
+ exit_result_ok_clong:
2395
+
2396
+ // We got an object handed, that we have to release.
2397
+ Py_DECREF(*operand1);
2398
+
2399
+ // That's our return value then. As we use a dedicated variable, it's
2400
+ // OK that way.
2401
+ *operand1 = Nuitka_PyLong_FromLong(clong_result);
2402
+ goto exit_result_ok;
2403
+
2404
+ exit_result_ok:
2405
+ return true;
2406
+
2407
+ exit_result_exception:
2408
+ return false;
2409
+ }
2410
+
2411
+ bool INPLACE_OPERATION_SUB_LONG_DIGIT(PyObject **operand1, long operand2) {
2412
+ return _INPLACE_OPERATION_SUB_LONG_DIGIT(operand1, operand2);
2413
+ }
2414
+
2415
+ /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "CLONG" to C platform long value. */
2416
+ static inline bool _INPLACE_OPERATION_SUB_LONG_CLONG(PyObject **operand1, long operand2) {
2417
+ assert(operand1); // Pointer must be non-null.
2418
+
2419
+ CHECK_OBJECT(*operand1);
2420
+ assert(PyLong_CheckExact(*operand1));
2421
+
2422
+ // Not every code path will make use of all possible results.
2423
+ #ifdef _MSC_VER
2424
+ #pragma warning(push)
2425
+ #pragma warning(disable : 4101)
2426
+ #endif
2427
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2428
+ NUITKA_MAY_BE_UNUSED long clong_result;
2429
+ #ifdef _MSC_VER
2430
+ #pragma warning(pop)
2431
+ #endif
2432
+
2433
+ PyLongObject *operand1_long_object = (PyLongObject *)*operand1;
2434
+
2435
+ bool operand2_is_negative;
2436
+ unsigned long operand2_abs_ival;
2437
+
2438
+ if (operand2 < 0) {
2439
+ operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;
2440
+ operand2_is_negative = true;
2441
+ } else {
2442
+ operand2_abs_ival = (unsigned long)operand2;
2443
+ operand2_is_negative = false;
2444
+ }
2445
+
2446
+ Py_ssize_t operand2_digit_count = 0;
2447
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
2448
+ {
2449
+ unsigned long t = operand2_abs_ival;
2450
+
2451
+ while (t != 0) {
2452
+ operand2_digit_count += 1;
2453
+ assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));
2454
+
2455
+ operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);
2456
+ t >>= PyLong_SHIFT;
2457
+ }
2458
+ }
2459
+
2460
+ NUITKA_MAY_BE_UNUSED Py_ssize_t operand2_size =
2461
+ operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
2462
+
2463
+ if (Nuitka_LongGetDigitSize(operand1_long_object) <= 1 && operand2_digit_count <= 1) {
2464
+ long r = (long)(MEDIUM_VALUE(operand1_long_object) - (sdigit)operand2);
2465
+
2466
+ if (Py_REFCNT(*operand1) == 1) {
2467
+ Nuitka_LongUpdateFromCLong(&*operand1, r);
2468
+ goto exit_result_ok;
2469
+ } else {
2470
+ PyObject *obj = Nuitka_LongFromCLong(r);
2471
+
2472
+ obj_result = obj;
2473
+ goto exit_result_object;
2474
+ }
2475
+ clong_result = r;
2476
+ goto exit_result_ok_clong;
2477
+ }
2478
+
2479
+ if (Py_REFCNT(*operand1) == 1) {
2480
+ digit const *b_digits = operand2_digits;
2481
+ Py_ssize_t b_digit_count = operand2_digit_count;
2482
+
2483
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
2484
+ bool b_negative = operand2_is_negative;
2485
+
2486
+ if (a_negative) {
2487
+ if (b_negative) {
2488
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);
2489
+ } else {
2490
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
2491
+ Nuitka_LongSetSignNegative(*operand1);
2492
+ }
2493
+ } else {
2494
+ if (b_negative) {
2495
+ *operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
2496
+ } else {
2497
+ *operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);
2498
+ }
2499
+ }
2500
+
2501
+ goto exit_result_ok;
2502
+ }
2503
+ {
2504
+ PyLongObject *z;
2505
+
2506
+ digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);
2507
+ Py_ssize_t a_digit_count = Nuitka_LongGetDigitSize(operand1_long_object);
2508
+ bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
2509
+ digit const *b_digits = operand2_digits;
2510
+ Py_ssize_t b_digit_count = operand2_digit_count;
2511
+ bool b_negative = operand2_is_negative;
2512
+
2513
+ if (a_negative) {
2514
+ if (b_negative) {
2515
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
2516
+ } else {
2517
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
2518
+ }
2519
+
2520
+ Nuitka_LongFlipSign(z);
2521
+ } else {
2522
+ if (b_negative) {
2523
+ z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
2524
+ } else {
2525
+ z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
2526
+ }
2527
+ }
2528
+
2529
+ obj_result = (PyObject *)z;
2530
+ goto exit_result_object;
2531
+ }
2532
+
2533
+ exit_result_object:
2534
+ if (unlikely(obj_result == NULL)) {
2535
+ goto exit_result_exception;
2536
+ }
2537
+ // We got an object handed, that we have to release.
2538
+ Py_DECREF(*operand1);
2539
+ *operand1 = obj_result;
2540
+ goto exit_result_ok;
2541
+
2542
+ exit_result_ok_clong:
2543
+
2544
+ // We got an object handed, that we have to release.
2545
+ Py_DECREF(*operand1);
2546
+
2547
+ // That's our return value then. As we use a dedicated variable, it's
2548
+ // OK that way.
2549
+ *operand1 = Nuitka_PyLong_FromLong(clong_result);
2550
+ goto exit_result_ok;
2551
+
2552
+ exit_result_ok:
2553
+ return true;
2554
+
2555
+ exit_result_exception:
2556
+ return false;
2557
+ }
2558
+
2559
+ bool INPLACE_OPERATION_SUB_LONG_CLONG(PyObject **operand1, long operand2) {
2560
+ return _INPLACE_OPERATION_SUB_LONG_CLONG(operand1, operand2);
2561
+ }
2562
+
2563
+ /* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
2564
+ static inline bool _INPLACE_OPERATION_SUB_FLOAT_CFLOAT(PyObject **operand1, double operand2) {
2565
+ assert(operand1); // Pointer must be non-null.
2566
+
2567
+ CHECK_OBJECT(*operand1);
2568
+ assert(PyFloat_CheckExact(*operand1));
2569
+
2570
+ #ifdef _MSC_VER
2571
+ #pragma warning(push)
2572
+ #pragma warning(disable : 4101)
2573
+ #endif
2574
+ // Not every code path will make use of all possible results.
2575
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2576
+ NUITKA_MAY_BE_UNUSED long clong_result;
2577
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
2578
+ #ifdef _MSC_VER
2579
+ #pragma warning(pop)
2580
+ #endif
2581
+
2582
+ CHECK_OBJECT(*operand1);
2583
+ assert(PyFloat_CheckExact(*operand1));
2584
+
2585
+ const double a = PyFloat_AS_DOUBLE(*operand1);
2586
+ const double b = operand2;
2587
+
2588
+ double r = a - b;
2589
+
2590
+ cfloat_result = r;
2591
+ goto exit_result_ok_cfloat;
2592
+
2593
+ exit_result_ok_cfloat:
2594
+ if (Py_REFCNT(*operand1) == 1) {
2595
+ PyFloat_SET_DOUBLE(*operand1, cfloat_result);
2596
+ } else {
2597
+ // We got an object handed, that we have to release.
2598
+ Py_DECREF(*operand1);
2599
+
2600
+ *operand1 = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2601
+ }
2602
+ goto exit_result_ok;
2603
+
2604
+ exit_result_ok:
2605
+ return true;
2606
+ }
2607
+
2608
+ bool INPLACE_OPERATION_SUB_FLOAT_CFLOAT(PyObject **operand1, double operand2) {
2609
+ return _INPLACE_OPERATION_SUB_FLOAT_CFLOAT(operand1, operand2);
2610
+ }
2611
+
2612
+ /* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */
2613
+ static inline bool _INPLACE_OPERATION_SUB_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {
2614
+ assert(operand1); // Pointer must be non-null.
2615
+
2616
+ CHECK_OBJECT(*operand1);
2617
+ CHECK_OBJECT(operand2);
2618
+
2619
+ #if PYTHON_VERSION < 0x300
2620
+ if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {
2621
+
2622
+ // Not every code path will make use of all possible results.
2623
+ #ifdef _MSC_VER
2624
+ #pragma warning(push)
2625
+ #pragma warning(disable : 4101)
2626
+ #endif
2627
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
2628
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2629
+ NUITKA_MAY_BE_UNUSED long clong_result;
2630
+ NUITKA_MAY_BE_UNUSED double cfloat_result;
2631
+ #ifdef _MSC_VER
2632
+ #pragma warning(pop)
2633
+ #endif
2634
+
2635
+ CHECK_OBJECT(*operand1);
2636
+ assert(PyInt_CheckExact(*operand1));
2637
+ CHECK_OBJECT(operand2);
2638
+ assert(PyInt_CheckExact(operand2));
2639
+
2640
+ const long a = PyInt_AS_LONG(*operand1);
2641
+ const long b = PyInt_AS_LONG(operand2);
2642
+
2643
+ const long x = (long)((unsigned long)a - b);
2644
+ bool no_overflow = ((x ^ a) >= 0 || (x ^ ~b) >= 0);
2645
+ if (likely(no_overflow)) {
2646
+ clong_result = x;
2647
+ goto exit_result_ok_clong;
2648
+ }
2649
+
2650
+ {
2651
+ PyObject *operand1_object = *operand1;
2652
+ PyObject *operand2_object = operand2;
2653
+
2654
+ PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);
2655
+ assert(r != Py_NotImplemented);
2656
+
2657
+ obj_result = r;
2658
+ goto exit_result_object;
2659
+ }
2660
+
2661
+ exit_result_ok_clong:
2662
+
2663
+ // We got an object handed, that we have to release.
2664
+ Py_DECREF(*operand1);
2665
+
2666
+ // That's our return value then. As we use a dedicated variable, it's
2667
+ // OK that way.
2668
+ *operand1 = Nuitka_PyInt_FromLong(clong_result);
2669
+ goto exit_result_ok;
2670
+
2671
+ exit_result_object:
2672
+ if (unlikely(obj_result == NULL)) {
2673
+ goto exit_result_exception;
2674
+ }
2675
+ // We got an object handed, that we have to release.
2676
+ Py_DECREF(*operand1);
2677
+
2678
+ *operand1 = obj_result;
2679
+ goto exit_result_ok;
2680
+
2681
+ exit_result_ok:
2682
+ return true;
2683
+
2684
+ exit_result_exception:
2685
+ return false;
2686
+ }
2687
+ #endif
2688
+
2689
+ if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {
2690
+ if (PyFloat_CheckExact(operand2)) {
2691
+ return _INPLACE_OPERATION_SUB_FLOAT_FLOAT(operand1, operand2);
2692
+ }
2693
+ #if PYTHON_VERSION >= 0x300
2694
+ if (PyLong_CheckExact(operand2)) {
2695
+ return _INPLACE_OPERATION_SUB_LONG_LONG(operand1, operand2);
2696
+ }
2697
+ #endif
2698
+ }
2699
+
2700
+ PyTypeObject *type1 = Py_TYPE(*operand1);
2701
+ PyTypeObject *type2 = Py_TYPE(operand2);
2702
+
2703
+ #ifdef _MSC_VER
2704
+ #pragma warning(push)
2705
+ #pragma warning(disable : 4101)
2706
+ #endif
2707
+ NUITKA_MAY_BE_UNUSED bool cbool_result;
2708
+ NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2709
+ #ifdef _MSC_VER
2710
+ #pragma warning(pop)
2711
+ #endif
2712
+
2713
+ binaryfunc islot =
2714
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_subtract : NULL;
2715
+
2716
+ if (islot != NULL) {
2717
+ PyObject *x = islot(*operand1, operand2);
2718
+
2719
+ if (x != Py_NotImplemented) {
2720
+ obj_result = x;
2721
+ goto exit_inplace_result_object;
2722
+ }
2723
+
2724
+ Py_DECREF_IMMORTAL(x);
2725
+ }
2726
+
2727
+ {
2728
+ binaryfunc slot1 =
2729
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_subtract : NULL;
2730
+ binaryfunc slot2 = NULL;
2731
+
2732
+ if (!(type1 == type2)) {
2733
+ // Different types, need to consider second value slot.
2734
+
2735
+ slot2 =
2736
+ (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_subtract : NULL;
2737
+
2738
+ if (slot1 == slot2) {
2739
+ slot2 = NULL;
2740
+ }
2741
+ }
2742
+
2743
+ if (slot1 != NULL) {
2744
+ if (slot2 != NULL) {
2745
+ if (Nuitka_Type_IsSubtype(type2, type1)) {
2746
+ PyObject *x = slot2(*operand1, operand2);
2747
+
2748
+ if (x != Py_NotImplemented) {
2749
+ obj_result = x;
2750
+ goto exit_inplace_result_object;
2751
+ }
2752
+
2753
+ Py_DECREF_IMMORTAL(x);
2754
+ slot2 = NULL;
2755
+ }
2756
+ }
2757
+
2758
+ PyObject *x = slot1(*operand1, operand2);
2759
+
2760
+ if (x != Py_NotImplemented) {
2761
+ obj_result = x;
2762
+ goto exit_inplace_result_object;
2763
+ }
2764
+
2765
+ Py_DECREF_IMMORTAL(x);
2766
+ }
2767
+
2768
+ if (slot2 != NULL) {
2769
+ PyObject *x = slot2(*operand1, operand2);
2770
+
2771
+ if (x != Py_NotImplemented) {
2772
+ obj_result = x;
2773
+ goto exit_inplace_result_object;
2774
+ }
2775
+
2776
+ Py_DECREF_IMMORTAL(x);
2777
+ }
2778
+
2779
+ #if PYTHON_VERSION < 0x300
2780
+ if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
2781
+ coercion c1 =
2782
+ (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2783
+
2784
+ if (c1 != NULL) {
2785
+ PyObject *coerced1 = *operand1;
2786
+ PyObject *coerced2 = operand2;
2787
+
2788
+ int err = c1(&coerced1, &coerced2);
2789
+
2790
+ if (unlikely(err < 0)) {
2791
+ goto exit_inplace_exception;
2792
+ }
2793
+
2794
+ if (err == 0) {
2795
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2796
+
2797
+ if (likely(mv == NULL)) {
2798
+ binaryfunc slot = mv->nb_subtract;
2799
+
2800
+ if (likely(slot != NULL)) {
2801
+ PyObject *x = slot(coerced1, coerced2);
2802
+
2803
+ Py_DECREF(coerced1);
2804
+ Py_DECREF(coerced2);
2805
+
2806
+ obj_result = x;
2807
+ goto exit_inplace_result_object;
2808
+ }
2809
+ }
2810
+
2811
+ // nb_coerce took a reference.
2812
+ Py_DECREF(coerced1);
2813
+ Py_DECREF(coerced2);
2814
+ }
2815
+ }
2816
+ coercion c2 =
2817
+ (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2818
+
2819
+ if (c2 != NULL) {
2820
+ PyObject *coerced1 = *operand1;
2821
+ PyObject *coerced2 = operand2;
2822
+
2823
+ int err = c2(&coerced2, &coerced1);
2824
+
2825
+ if (unlikely(err < 0)) {
2826
+ goto exit_inplace_exception;
2827
+ }
2828
+
2829
+ if (err == 0) {
2830
+ PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2831
+
2832
+ if (likely(mv == NULL)) {
2833
+ binaryfunc slot = mv->nb_subtract;
2834
+
2835
+ if (likely(slot != NULL)) {
2836
+ PyObject *x = slot(coerced1, coerced2);
2837
+
2838
+ Py_DECREF(coerced1);
2839
+ Py_DECREF(coerced2);
2840
+
2841
+ obj_result = x;
2842
+ goto exit_inplace_result_object;
2843
+ }
2844
+ }
2845
+
2846
+ // nb_coerce took a reference.
2847
+ Py_DECREF(coerced1);
2848
+ Py_DECREF(coerced2);
2849
+ }
2850
+ }
2851
+ }
2852
+ #endif
2853
+
2854
+ PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for -=: '%s' and '%s'", type1->tp_name,
2855
+ type2->tp_name);
2856
+ goto exit_inplace_exception;
2857
+ }
2858
+
2859
+ exit_inplace_result_object:
2860
+ if (unlikely(obj_result == NULL)) {
2861
+ return false;
2862
+ }
2863
+
2864
+ // We got an object handed, that we have to release.
2865
+ Py_DECREF(*operand1);
2866
+
2867
+ // That's our return value then. As we use a dedicated variable, it's
2868
+ // OK that way.
2869
+ *operand1 = obj_result;
2870
+
2871
+ return true;
2872
+
2873
+ exit_inplace_exception:
2874
+ return false;
2875
+ }
2876
+
2877
+ bool INPLACE_OPERATION_SUB_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {
2878
+ return _INPLACE_OPERATION_SUB_OBJECT_OBJECT(operand1, operand2);
2879
+ }
2880
+
2881
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
2882
+ // integrates with CPython, but also works on its own.
2883
+ //
2884
+ // Licensed under the Apache License, Version 2.0 (the "License");
2885
+ // you may not use this file except in compliance with the License.
2886
+ // You may obtain a copy of the License at
2887
+ //
2888
+ // http://www.apache.org/licenses/LICENSE-2.0
2889
+ //
2890
+ // Unless required by applicable law or agreed to in writing, software
2891
+ // distributed under the License is distributed on an "AS IS" BASIS,
2892
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2893
+ // See the License for the specific language governing permissions and
2894
+ // limitations under the License.