Nuitka-winsvc 1.8__cp311-cp311-win_amd64.whl → 2.4.8__cp311-cp311-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 (704) hide show
  1. Nuitka_winsvc-1.8.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.8.data/scripts/nuitka-run.cmd +9 -9
  2. Nuitka_winsvc-1.8.data/scripts/nuitka.bat → Nuitka_winsvc-2.4.8.data/scripts/nuitka.cmd +15 -15
  3. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/METADATA +4 -3
  4. Nuitka_winsvc-2.4.8.dist-info/RECORD +954 -0
  5. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/WHEEL +1 -1
  6. nuitka/Builtins.py +18 -17
  7. nuitka/BytecodeCaching.py +24 -20
  8. nuitka/Bytecodes.py +23 -19
  9. nuitka/CacheCleanup.py +28 -23
  10. nuitka/Constants.py +19 -17
  11. nuitka/Errors.py +23 -17
  12. nuitka/HardImportRegistry.py +400 -0
  13. nuitka/MainControl.py +200 -112
  14. nuitka/ModuleRegistry.py +83 -20
  15. nuitka/OptionParsing.py +368 -175
  16. nuitka/Options.py +632 -213
  17. nuitka/OutputDirectories.py +40 -21
  18. nuitka/PostProcessing.py +73 -50
  19. nuitka/Progress.py +58 -24
  20. nuitka/PythonFlavors.py +141 -32
  21. nuitka/PythonOperators.py +18 -17
  22. nuitka/PythonVersions.py +106 -19
  23. nuitka/Serialization.py +68 -55
  24. nuitka/SourceCodeReferences.py +19 -17
  25. nuitka/Tracing.py +108 -70
  26. nuitka/TreeXML.py +31 -26
  27. nuitka/Variables.py +39 -41
  28. nuitka/Version.py +21 -7
  29. nuitka/__init__.py +5 -4
  30. nuitka/__main__.py +95 -29
  31. nuitka/__past__.py +44 -34
  32. nuitka/build/Backend.scons +202 -140
  33. nuitka/build/CCompilerVersion.scons +39 -31
  34. nuitka/build/DataComposerInterface.py +20 -17
  35. nuitka/build/Onefile.scons +50 -54
  36. nuitka/build/SconsCaching.py +93 -90
  37. nuitka/build/SconsCompilerSettings.py +157 -69
  38. nuitka/build/SconsHacks.py +25 -19
  39. nuitka/build/SconsInterface.py +154 -54
  40. nuitka/build/SconsProgress.py +19 -18
  41. nuitka/build/SconsSpawn.py +62 -33
  42. nuitka/build/SconsUtils.py +147 -55
  43. nuitka/build/__init__.py +5 -4
  44. nuitka/build/include/nuitka/allocator.h +105 -22
  45. nuitka/build/include/nuitka/builtins.h +17 -17
  46. nuitka/build/include/nuitka/calling.h +18 -18
  47. nuitka/build/include/nuitka/checkers.h +17 -18
  48. nuitka/build/include/nuitka/checksum_tools.h +14 -19
  49. nuitka/build/include/nuitka/compiled_asyncgen.h +18 -18
  50. nuitka/build/include/nuitka/compiled_cell.h +33 -18
  51. nuitka/build/include/nuitka/compiled_coroutine.h +18 -18
  52. nuitka/build/include/nuitka/compiled_frame.h +91 -53
  53. nuitka/build/include/nuitka/compiled_function.h +42 -20
  54. nuitka/build/include/nuitka/compiled_generator.h +24 -18
  55. nuitka/build/include/nuitka/compiled_method.h +17 -18
  56. nuitka/build/include/nuitka/constants.h +29 -18
  57. nuitka/build/include/nuitka/constants_blob.h +17 -17
  58. nuitka/build/include/nuitka/environment_variables.h +30 -0
  59. nuitka/build/include/nuitka/environment_variables_system.h +45 -0
  60. nuitka/build/include/nuitka/exception_groups.h +23 -26
  61. nuitka/build/include/nuitka/exceptions.h +593 -190
  62. nuitka/build/include/nuitka/filesystem_paths.h +26 -20
  63. nuitka/build/include/nuitka/freelists.h +38 -18
  64. nuitka/build/include/nuitka/helper/attributes.h +24 -18
  65. nuitka/build/include/nuitka/helper/boolean.h +17 -17
  66. nuitka/build/include/nuitka/helper/bytearrays.h +17 -17
  67. nuitka/build/include/nuitka/helper/bytes.h +14 -15
  68. nuitka/build/include/nuitka/helper/calling_generated.h +17 -17
  69. nuitka/build/include/nuitka/helper/comparisons_eq.h +17 -17
  70. nuitka/build/include/nuitka/helper/comparisons_ge.h +17 -17
  71. nuitka/build/include/nuitka/helper/comparisons_gt.h +17 -17
  72. nuitka/build/include/nuitka/helper/comparisons_le.h +17 -17
  73. nuitka/build/include/nuitka/helper/comparisons_lt.h +17 -17
  74. nuitka/build/include/nuitka/helper/comparisons_ne.h +17 -17
  75. nuitka/build/include/nuitka/helper/complex.h +17 -17
  76. nuitka/build/include/nuitka/helper/dictionaries.h +24 -22
  77. nuitka/build/include/nuitka/helper/floats.h +17 -18
  78. nuitka/build/include/nuitka/helper/import_hard.h +25 -17
  79. nuitka/build/include/nuitka/helper/indexes.h +17 -18
  80. nuitka/build/include/nuitka/helper/ints.h +32 -20
  81. nuitka/build/include/nuitka/helper/iterators.h +17 -17
  82. nuitka/build/include/nuitka/helper/lists.h +26 -24
  83. nuitka/build/include/nuitka/helper/lists_generated.h +22 -22
  84. nuitka/build/include/nuitka/helper/mappings.h +17 -18
  85. nuitka/build/include/nuitka/helper/operations.h +17 -17
  86. nuitka/build/include/nuitka/helper/operations_binary_add.h +17 -17
  87. nuitka/build/include/nuitka/helper/operations_binary_bitand.h +17 -17
  88. nuitka/build/include/nuitka/helper/operations_binary_bitor.h +17 -17
  89. nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +17 -17
  90. nuitka/build/include/nuitka/helper/operations_binary_divmod.h +17 -17
  91. nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +17 -17
  92. nuitka/build/include/nuitka/helper/operations_binary_lshift.h +17 -17
  93. nuitka/build/include/nuitka/helper/operations_binary_matmult.h +17 -17
  94. nuitka/build/include/nuitka/helper/operations_binary_mod.h +17 -17
  95. nuitka/build/include/nuitka/helper/operations_binary_mult.h +17 -17
  96. nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +17 -17
  97. nuitka/build/include/nuitka/helper/operations_binary_pow.h +17 -17
  98. nuitka/build/include/nuitka/helper/operations_binary_rshift.h +17 -17
  99. nuitka/build/include/nuitka/helper/operations_binary_sub.h +17 -17
  100. nuitka/build/include/nuitka/helper/operations_binary_truediv.h +17 -17
  101. nuitka/build/include/nuitka/helper/operations_builtin_types.h +17 -17
  102. nuitka/build/include/nuitka/helper/operations_inplace_add.h +17 -17
  103. nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +17 -17
  104. nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +17 -17
  105. nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +17 -17
  106. nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +17 -17
  107. nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +17 -17
  108. nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +17 -17
  109. nuitka/build/include/nuitka/helper/operations_inplace_mod.h +17 -17
  110. nuitka/build/include/nuitka/helper/operations_inplace_mult.h +17 -17
  111. nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +17 -17
  112. nuitka/build/include/nuitka/helper/operations_inplace_pow.h +17 -17
  113. nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +17 -17
  114. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +17 -17
  115. nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +17 -17
  116. nuitka/build/include/nuitka/helper/raising.h +29 -17
  117. nuitka/build/include/nuitka/helper/rangeobjects.h +17 -17
  118. nuitka/build/include/nuitka/helper/richcomparisons.h +14 -14
  119. nuitka/build/include/nuitka/helper/sequences.h +19 -13
  120. nuitka/build/include/nuitka/helper/sets.h +11 -12
  121. nuitka/build/include/nuitka/helper/slices.h +31 -25
  122. nuitka/build/include/nuitka/helper/strings.h +16 -17
  123. nuitka/build/include/nuitka/helper/subscripts.h +18 -201
  124. nuitka/build/include/nuitka/helper/tuples.h +64 -52
  125. nuitka/build/include/nuitka/helpers.h +38 -20
  126. nuitka/build/include/nuitka/importing.h +28 -21
  127. nuitka/build/include/nuitka/jit_sources.h +25 -0
  128. nuitka/build/include/nuitka/prelude.h +128 -46
  129. nuitka/build/include/nuitka/printing.h +22 -17
  130. nuitka/build/include/nuitka/python_pgo.h +19 -18
  131. nuitka/build/include/nuitka/safe_string_ops.h +20 -18
  132. nuitka/build/include/nuitka/threading.h +32 -33
  133. nuitka/build/include/nuitka/tracing.h +28 -18
  134. nuitka/build/include/nuitka/type_aliases.h +27 -0
  135. nuitka/build/include/nuitka/unfreezing.h +29 -23
  136. nuitka/build/inline_copy/bin/scons.py +14 -0
  137. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +6 -6
  138. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
  139. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  140. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  141. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  142. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  143. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  144. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  145. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  146. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  147. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  148. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  149. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  150. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  151. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  152. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  153. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  154. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  155. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  156. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  157. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  158. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  159. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  160. nuitka/build/inline_copy/tqdm/tqdm/__init__.py +2 -2
  161. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  162. nuitka/build/inline_copy/tqdm/tqdm/utils.py +14 -8
  163. nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -8
  164. nuitka/build/inline_copy/zlib/LICENSE +22 -0
  165. nuitka/build/inline_copy/zlib/crc32.c +1049 -0
  166. nuitka/build/inline_copy/zlib/crc32.h +9446 -0
  167. nuitka/build/inline_copy/zlib/zconf.h +551 -0
  168. nuitka/build/inline_copy/zlib/zlib.h +1938 -0
  169. nuitka/build/inline_copy/zlib/zutil.h +275 -0
  170. nuitka/build/static_src/CompiledAsyncgenType.c +176 -182
  171. nuitka/build/static_src/CompiledCellType.c +63 -40
  172. nuitka/build/static_src/CompiledCodeHelpers.c +181 -128
  173. nuitka/build/static_src/CompiledCoroutineType.c +196 -203
  174. nuitka/build/static_src/CompiledFrameType.c +287 -133
  175. nuitka/build/static_src/CompiledFunctionType.c +389 -95
  176. nuitka/build/static_src/CompiledGeneratorType.c +376 -252
  177. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +185 -198
  178. nuitka/build/static_src/CompiledMethodType.c +83 -71
  179. nuitka/build/static_src/HelpersAllocator.c +88 -19
  180. nuitka/build/static_src/HelpersAttributes.c +33 -54
  181. nuitka/build/static_src/HelpersBuiltin.c +43 -33
  182. nuitka/build/static_src/HelpersBuiltinTypeMethods.c +17 -17
  183. nuitka/build/static_src/HelpersBytes.c +19 -20
  184. nuitka/build/static_src/HelpersCalling.c +33 -30
  185. nuitka/build/static_src/HelpersCallingGenerated.c +1000 -181
  186. nuitka/build/static_src/HelpersChecksumTools.c +35 -21
  187. nuitka/build/static_src/HelpersClasses.c +17 -17
  188. nuitka/build/static_src/HelpersComparisonEq.c +518 -492
  189. nuitka/build/static_src/HelpersComparisonEqUtils.c +21 -19
  190. nuitka/build/static_src/HelpersComparisonGe.c +513 -497
  191. nuitka/build/static_src/HelpersComparisonGt.c +512 -496
  192. nuitka/build/static_src/HelpersComparisonLe.c +513 -497
  193. nuitka/build/static_src/HelpersComparisonLt.c +512 -496
  194. nuitka/build/static_src/HelpersComparisonNe.c +520 -492
  195. nuitka/build/static_src/HelpersConsole.c +96 -0
  196. nuitka/build/static_src/HelpersConstantsBlob.c +542 -519
  197. nuitka/build/static_src/HelpersDeepcopy.c +33 -33
  198. nuitka/build/static_src/HelpersDictionaries.c +51 -29
  199. nuitka/build/static_src/HelpersDictionariesGenerated.c +177 -68
  200. nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
  201. nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
  202. nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +93 -0
  203. nuitka/build/static_src/HelpersExceptions.c +161 -50
  204. nuitka/build/static_src/HelpersFiles.c +37 -17
  205. nuitka/build/static_src/HelpersFilesystemPaths.c +292 -181
  206. nuitka/build/static_src/HelpersFloats.c +37 -31
  207. nuitka/build/static_src/HelpersHeapStorage.c +21 -17
  208. nuitka/build/static_src/HelpersImport.c +48 -20
  209. nuitka/build/static_src/HelpersImportHard.c +53 -17
  210. nuitka/build/static_src/HelpersJitSources.c +46 -0
  211. nuitka/build/static_src/HelpersLists.c +140 -50
  212. nuitka/build/static_src/HelpersListsGenerated.c +41 -41
  213. nuitka/build/static_src/HelpersMappings.c +17 -17
  214. nuitka/build/static_src/HelpersMatching.c +137 -51
  215. nuitka/build/static_src/HelpersOperationBinaryAdd.c +173 -146
  216. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +99 -52
  217. nuitka/build/static_src/HelpersOperationBinaryBitand.c +50 -50
  218. nuitka/build/static_src/HelpersOperationBinaryBitor.c +50 -50
  219. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +50 -50
  220. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +41 -41
  221. nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +17 -17
  222. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +41 -41
  223. nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +20 -21
  224. nuitka/build/static_src/HelpersOperationBinaryLshift.c +47 -47
  225. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +24 -24
  226. nuitka/build/static_src/HelpersOperationBinaryMod.c +107 -107
  227. nuitka/build/static_src/HelpersOperationBinaryMult.c +81 -75
  228. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +33 -30
  229. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +41 -41
  230. nuitka/build/static_src/HelpersOperationBinaryPow.c +44 -44
  231. nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +12 -12
  232. nuitka/build/static_src/HelpersOperationBinaryRshift.c +47 -47
  233. nuitka/build/static_src/HelpersOperationBinarySub.c +80 -80
  234. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +41 -41
  235. nuitka/build/static_src/HelpersOperationInplaceAdd.c +171 -153
  236. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +24 -22
  237. nuitka/build/static_src/HelpersOperationInplaceBitand.c +53 -53
  238. nuitka/build/static_src/HelpersOperationInplaceBitor.c +53 -53
  239. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +53 -53
  240. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +62 -62
  241. nuitka/build/static_src/HelpersOperationInplaceLshift.c +44 -44
  242. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +37 -37
  243. nuitka/build/static_src/HelpersOperationInplaceMod.c +134 -134
  244. nuitka/build/static_src/HelpersOperationInplaceMult.c +78 -78
  245. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +62 -62
  246. nuitka/build/static_src/HelpersOperationInplacePow.c +62 -62
  247. nuitka/build/static_src/HelpersOperationInplaceRshift.c +44 -44
  248. nuitka/build/static_src/HelpersOperationInplaceSub.c +112 -112
  249. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +62 -62
  250. nuitka/build/static_src/HelpersProfiling.c +24 -23
  251. nuitka/build/static_src/HelpersPythonPgo.c +22 -22
  252. nuitka/build/static_src/HelpersRaising.c +88 -20
  253. nuitka/build/static_src/HelpersSafeStrings.c +34 -22
  254. nuitka/build/static_src/HelpersSequences.c +18 -19
  255. nuitka/build/static_src/HelpersSlices.c +29 -23
  256. nuitka/build/static_src/HelpersStrings.c +234 -37
  257. nuitka/build/static_src/HelpersTuples.c +46 -34
  258. nuitka/build/static_src/HelpersTypes.c +68 -23
  259. nuitka/build/static_src/InspectPatcher.c +108 -27
  260. nuitka/build/static_src/MainProgram.c +359 -263
  261. nuitka/build/static_src/MetaPathBasedLoader.c +367 -242
  262. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +39 -26
  263. nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +17 -18
  264. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +97 -22
  265. nuitka/build/static_src/OnefileBootstrap.c +276 -164
  266. nuitka/build/static_src/OnefileSplashScreen.cpp +51 -27
  267. nuitka/code_generation/AsyncgenCodes.py +19 -17
  268. nuitka/code_generation/AttributeCodes.py +31 -27
  269. nuitka/code_generation/BinaryOperationHelperDefinitions.py +24 -20
  270. nuitka/code_generation/BranchCodes.py +19 -17
  271. nuitka/code_generation/BuiltinCodes.py +20 -17
  272. nuitka/code_generation/CallCodes.py +19 -17
  273. nuitka/code_generation/ClassCodes.py +19 -17
  274. nuitka/code_generation/CodeGeneration.py +48 -27
  275. nuitka/code_generation/CodeHelperSelection.py +19 -17
  276. nuitka/code_generation/CodeHelpers.py +24 -20
  277. nuitka/code_generation/CodeObjectCodes.py +34 -24
  278. nuitka/code_generation/ComparisonCodes.py +38 -20
  279. nuitka/code_generation/ComparisonHelperDefinitions.py +19 -17
  280. nuitka/code_generation/ConditionalCodes.py +19 -17
  281. nuitka/code_generation/ConstantCodes.py +82 -28
  282. nuitka/code_generation/Contexts.py +152 -26
  283. nuitka/code_generation/CoroutineCodes.py +19 -17
  284. nuitka/code_generation/CtypesCodes.py +19 -17
  285. nuitka/code_generation/DictCodes.py +25 -23
  286. nuitka/code_generation/Emission.py +21 -18
  287. nuitka/code_generation/ErrorCodes.py +27 -33
  288. nuitka/code_generation/EvalCodes.py +24 -20
  289. nuitka/code_generation/ExceptionCodes.py +27 -18
  290. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +20 -17
  291. nuitka/code_generation/ExpressionCodes.py +19 -17
  292. nuitka/code_generation/FrameCodes.py +24 -20
  293. nuitka/code_generation/FunctionCodes.py +24 -21
  294. nuitka/code_generation/GeneratorCodes.py +23 -20
  295. nuitka/code_generation/GlobalConstants.py +43 -23
  296. nuitka/code_generation/GlobalsLocalsCodes.py +21 -19
  297. nuitka/code_generation/IdCodes.py +19 -17
  298. nuitka/code_generation/ImportCodes.py +90 -50
  299. nuitka/code_generation/Indentation.py +23 -22
  300. nuitka/code_generation/IndexCodes.py +19 -17
  301. nuitka/code_generation/InjectCCodes.py +14 -12
  302. nuitka/code_generation/IntegerCodes.py +19 -17
  303. nuitka/code_generation/IteratorCodes.py +19 -17
  304. nuitka/code_generation/JitCodes.py +44 -0
  305. nuitka/code_generation/LabelCodes.py +19 -17
  306. nuitka/code_generation/LineNumberCodes.py +19 -17
  307. nuitka/code_generation/ListCodes.py +32 -36
  308. nuitka/code_generation/LoaderCodes.py +22 -17
  309. nuitka/code_generation/LocalsDictCodes.py +56 -32
  310. nuitka/code_generation/LoopCodes.py +19 -17
  311. nuitka/code_generation/MatchCodes.py +42 -22
  312. nuitka/code_generation/ModuleCodes.py +43 -25
  313. nuitka/code_generation/Namify.py +27 -23
  314. nuitka/code_generation/NetworkxCodes.py +51 -0
  315. nuitka/code_generation/OperationCodes.py +29 -31
  316. nuitka/code_generation/PackageResourceCodes.py +59 -23
  317. nuitka/code_generation/PrintCodes.py +19 -17
  318. nuitka/code_generation/PythonAPICodes.py +19 -17
  319. nuitka/code_generation/RaisingCodes.py +19 -17
  320. nuitka/code_generation/Reports.py +19 -17
  321. nuitka/code_generation/ReturnCodes.py +19 -17
  322. nuitka/code_generation/SetCodes.py +19 -17
  323. nuitka/code_generation/SliceCodes.py +22 -20
  324. nuitka/code_generation/StringCodes.py +19 -17
  325. nuitka/code_generation/SubscriptCodes.py +24 -30
  326. nuitka/code_generation/TensorflowCodes.py +54 -0
  327. nuitka/code_generation/TryCodes.py +19 -17
  328. nuitka/code_generation/TupleCodes.py +20 -18
  329. nuitka/code_generation/TypeAliasCodes.py +71 -0
  330. nuitka/code_generation/VariableCodes.py +26 -22
  331. nuitka/code_generation/VariableDeclarations.py +20 -17
  332. nuitka/code_generation/YieldCodes.py +22 -20
  333. nuitka/code_generation/__init__.py +5 -4
  334. nuitka/code_generation/c_types/CTypeBases.py +19 -17
  335. nuitka/code_generation/c_types/CTypeBooleans.py +19 -17
  336. nuitka/code_generation/c_types/CTypeCFloats.py +19 -17
  337. nuitka/code_generation/c_types/CTypeCLongs.py +19 -18
  338. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +19 -17
  339. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +19 -17
  340. nuitka/code_generation/c_types/CTypeNuitkaInts.py +19 -18
  341. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +19 -17
  342. nuitka/code_generation/c_types/CTypePyObjectPointers.py +27 -25
  343. nuitka/code_generation/c_types/CTypeVoids.py +20 -17
  344. nuitka/code_generation/c_types/__init__.py +5 -4
  345. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +18 -17
  346. nuitka/code_generation/templates/CodeTemplatesConstants.py +132 -36
  347. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +18 -17
  348. nuitka/code_generation/templates/CodeTemplatesExceptions.py +19 -18
  349. nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -17
  350. nuitka/code_generation/templates/CodeTemplatesFunction.py +18 -17
  351. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +19 -17
  352. nuitka/code_generation/templates/CodeTemplatesIterators.py +18 -18
  353. nuitka/code_generation/templates/CodeTemplatesLoader.py +25 -19
  354. nuitka/code_generation/templates/CodeTemplatesModules.py +244 -165
  355. nuitka/code_generation/templates/CodeTemplatesVariables.py +42 -27
  356. nuitka/code_generation/templates/TemplateDebugWrapper.py +19 -18
  357. nuitka/code_generation/templates/__init__.py +5 -4
  358. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +19 -19
  359. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +18 -18
  360. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +76 -25
  361. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +22 -22
  362. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +19 -19
  363. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +19 -19
  364. nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +17 -17
  365. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +121 -48
  366. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +18 -18
  367. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +18 -18
  368. nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +6 -6
  369. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +23 -23
  370. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +35 -35
  371. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +28 -28
  372. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +17 -17
  373. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +18 -18
  374. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +44 -32
  375. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +20 -20
  376. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +28 -28
  377. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +24 -24
  378. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +33 -29
  379. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +20 -20
  380. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +27 -27
  381. nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +17 -17
  382. nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +17 -17
  383. nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +17 -17
  384. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +17 -17
  385. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +21 -18
  386. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +26 -24
  387. nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +17 -17
  388. nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +17 -17
  389. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +21 -18
  390. nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +17 -17
  391. nuitka/containers/Namedtuples.py +19 -18
  392. nuitka/containers/OrderedSetsFallback.py +19 -17
  393. nuitka/containers/__init__.py +5 -4
  394. nuitka/distutils/Build.py +19 -18
  395. nuitka/distutils/DistutilCommands.py +34 -23
  396. nuitka/distutils/__init__.py +5 -4
  397. nuitka/finalizations/Finalization.py +20 -17
  398. nuitka/finalizations/FinalizeMarkups.py +21 -41
  399. nuitka/finalizations/__init__.py +5 -4
  400. nuitka/freezer/DependsExe.py +48 -28
  401. nuitka/freezer/DllDependenciesCommon.py +47 -20
  402. nuitka/freezer/DllDependenciesMacOS.py +147 -57
  403. nuitka/freezer/DllDependenciesPosix.py +29 -19
  404. nuitka/freezer/DllDependenciesWin32.py +29 -21
  405. nuitka/freezer/ImportDetection.py +20 -17
  406. nuitka/freezer/IncludedDataFiles.py +118 -47
  407. nuitka/freezer/IncludedEntryPoints.py +102 -38
  408. nuitka/freezer/Onefile.py +32 -22
  409. nuitka/freezer/Standalone.py +105 -50
  410. nuitka/freezer/__init__.py +5 -4
  411. nuitka/importing/IgnoreListing.py +19 -17
  412. nuitka/importing/ImportCache.py +24 -21
  413. nuitka/importing/ImportResolving.py +103 -95
  414. nuitka/importing/Importing.py +286 -92
  415. nuitka/importing/PreloadedPackages.py +21 -18
  416. nuitka/importing/Recursion.py +131 -47
  417. nuitka/importing/StandardLibrary.py +46 -28
  418. nuitka/importing/__init__.py +5 -4
  419. nuitka/nodes/AsyncgenNodes.py +19 -17
  420. nuitka/nodes/AttributeLookupNodes.py +19 -17
  421. nuitka/nodes/AttributeNodes.py +19 -17
  422. nuitka/nodes/AttributeNodesGenerated.py +49 -24
  423. nuitka/nodes/BuiltinAllNodes.py +19 -17
  424. nuitka/nodes/BuiltinAnyNodes.py +19 -17
  425. nuitka/nodes/BuiltinComplexNodes.py +20 -17
  426. nuitka/nodes/BuiltinDecodingNodes.py +19 -17
  427. nuitka/nodes/BuiltinDecoratorNodes.py +19 -17
  428. nuitka/nodes/BuiltinDictNodes.py +19 -17
  429. nuitka/nodes/BuiltinFormatNodes.py +20 -17
  430. nuitka/nodes/BuiltinHashNodes.py +19 -17
  431. nuitka/nodes/BuiltinInputNodes.py +19 -17
  432. nuitka/nodes/BuiltinIntegerNodes.py +19 -17
  433. nuitka/nodes/BuiltinIteratorNodes.py +24 -20
  434. nuitka/nodes/BuiltinLenNodes.py +19 -17
  435. nuitka/nodes/BuiltinNextNodes.py +19 -17
  436. nuitka/nodes/BuiltinOpenNodes.py +52 -18
  437. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +40 -23
  438. nuitka/nodes/BuiltinRangeNodes.py +21 -19
  439. nuitka/nodes/BuiltinRefNodes.py +68 -19
  440. nuitka/nodes/BuiltinSumNodes.py +20 -18
  441. nuitka/nodes/BuiltinTypeNodes.py +19 -17
  442. nuitka/nodes/BuiltinVarsNodes.py +19 -18
  443. nuitka/nodes/BytesNodes.py +19 -17
  444. nuitka/nodes/CallNodes.py +19 -17
  445. nuitka/nodes/Checkers.py +19 -17
  446. nuitka/nodes/ChildrenHavingMixins.py +1250 -302
  447. nuitka/nodes/ClassNodes.py +49 -29
  448. nuitka/nodes/CodeObjectSpecs.py +29 -18
  449. nuitka/nodes/ComparisonNodes.py +19 -17
  450. nuitka/nodes/ConditionalNodes.py +21 -23
  451. nuitka/nodes/ConstantRefNodes.py +57 -17
  452. nuitka/nodes/ContainerMakingNodes.py +19 -17
  453. nuitka/nodes/ContainerOperationNodes.py +19 -17
  454. nuitka/nodes/CoroutineNodes.py +19 -17
  455. nuitka/nodes/CtypesNodes.py +19 -18
  456. nuitka/nodes/DictionaryNodes.py +19 -18
  457. nuitka/nodes/ExceptionNodes.py +29 -17
  458. nuitka/nodes/ExecEvalNodes.py +19 -17
  459. nuitka/nodes/ExpressionBases.py +34 -26
  460. nuitka/nodes/ExpressionBasesGenerated.py +54 -32
  461. nuitka/nodes/ExpressionShapeMixins.py +19 -17
  462. nuitka/nodes/FrameNodes.py +19 -17
  463. nuitka/nodes/FunctionAttributeNodes.py +19 -17
  464. nuitka/nodes/FunctionNodes.py +81 -35
  465. nuitka/nodes/FutureSpecs.py +35 -20
  466. nuitka/nodes/GeneratorNodes.py +21 -19
  467. nuitka/nodes/GlobalsLocalsNodes.py +22 -17
  468. nuitka/nodes/HardImportNodesGenerated.py +545 -129
  469. nuitka/nodes/ImportHardNodes.py +46 -38
  470. nuitka/nodes/ImportNodes.py +436 -446
  471. nuitka/nodes/IndicatorMixins.py +19 -17
  472. nuitka/nodes/InjectCNodes.py +19 -18
  473. nuitka/nodes/IterationHandles.py +55 -34
  474. nuitka/nodes/KeyValuePairNodes.py +19 -17
  475. nuitka/nodes/ListOperationNodes.py +33 -21
  476. nuitka/nodes/LocalsDictNodes.py +19 -17
  477. nuitka/nodes/LocalsScopes.py +41 -41
  478. nuitka/nodes/LoopNodes.py +28 -17
  479. nuitka/nodes/MatchNodes.py +37 -24
  480. nuitka/nodes/ModuleAttributeNodes.py +18 -35
  481. nuitka/nodes/ModuleNodes.py +90 -31
  482. nuitka/nodes/NetworkxNodes.py +45 -0
  483. nuitka/nodes/NodeBases.py +45 -43
  484. nuitka/nodes/NodeMakingHelpers.py +21 -19
  485. nuitka/nodes/NodeMetaClasses.py +45 -28
  486. nuitka/nodes/OperatorNodes.py +28 -26
  487. nuitka/nodes/OperatorNodesUnary.py +20 -17
  488. nuitka/nodes/OsSysNodes.py +66 -18
  489. nuitka/nodes/OutlineNodes.py +22 -20
  490. nuitka/nodes/PackageMetadataNodes.py +37 -27
  491. nuitka/nodes/PackageResourceNodes.py +29 -23
  492. nuitka/nodes/PrintNodes.py +19 -17
  493. nuitka/nodes/ReturnNodes.py +20 -18
  494. nuitka/nodes/SideEffectNodes.py +19 -17
  495. nuitka/nodes/SliceNodes.py +20 -18
  496. nuitka/nodes/StatementBasesGenerated.py +125 -77
  497. nuitka/nodes/StatementNodes.py +19 -17
  498. nuitka/nodes/StrNodes.py +19 -17
  499. nuitka/nodes/StringConcatenationNodes.py +20 -17
  500. nuitka/nodes/SubscriptNodes.py +26 -24
  501. nuitka/nodes/TensorflowNodes.py +38 -0
  502. nuitka/nodes/TryNodes.py +19 -17
  503. nuitka/nodes/TypeMatchNodes.py +19 -17
  504. nuitka/nodes/TypeNodes.py +40 -17
  505. nuitka/nodes/VariableAssignNodes.py +122 -64
  506. nuitka/nodes/VariableDelNodes.py +19 -17
  507. nuitka/nodes/VariableNameNodes.py +19 -17
  508. nuitka/nodes/VariableRefNodes.py +63 -26
  509. nuitka/nodes/VariableReleaseNodes.py +19 -17
  510. nuitka/nodes/YieldNodes.py +21 -19
  511. nuitka/nodes/__init__.py +5 -4
  512. nuitka/nodes/shapes/BuiltinTypeShapes.py +145 -39
  513. nuitka/nodes/shapes/ControlFlowDescriptions.py +19 -17
  514. nuitka/nodes/shapes/ShapeMixins.py +40 -17
  515. nuitka/nodes/shapes/StandardShapes.py +27 -20
  516. nuitka/nodes/shapes/__init__.py +5 -4
  517. nuitka/optimizations/BytecodeDemotion.py +19 -17
  518. nuitka/optimizations/FunctionInlining.py +22 -23
  519. nuitka/optimizations/Graphs.py +19 -17
  520. nuitka/optimizations/Optimization.py +39 -35
  521. nuitka/optimizations/OptimizeBuiltinCalls.py +31 -27
  522. nuitka/optimizations/Tags.py +19 -18
  523. nuitka/optimizations/TraceCollections.py +67 -24
  524. nuitka/optimizations/ValueTraces.py +92 -25
  525. nuitka/optimizations/__init__.py +5 -4
  526. nuitka/pgo/PGO.py +33 -23
  527. nuitka/pgo/__init__.py +5 -4
  528. nuitka/plugins/PluginBase.py +610 -109
  529. nuitka/plugins/Plugins.py +241 -58
  530. nuitka/plugins/YamlPluginBase.py +121 -0
  531. nuitka/plugins/__init__.py +5 -4
  532. nuitka/plugins/standard/AntiBloatPlugin.py +357 -129
  533. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +20 -19
  534. nuitka/plugins/standard/DataFilesPlugin.py +65 -29
  535. nuitka/plugins/standard/DelvewheelPlugin.py +32 -24
  536. nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
  537. nuitka/plugins/standard/DillPlugin/dill-postLoad.py +256 -0
  538. nuitka/plugins/standard/DillPlugin.py +42 -134
  539. nuitka/plugins/standard/DllFilesPlugin.py +125 -42
  540. nuitka/plugins/standard/EnumPlugin.py +19 -17
  541. nuitka/plugins/standard/EventletPlugin.py +19 -17
  542. nuitka/plugins/standard/GeventPlugin.py +19 -17
  543. nuitka/plugins/standard/GiPlugin.py +44 -28
  544. nuitka/plugins/standard/GlfwPlugin.py +20 -17
  545. nuitka/plugins/standard/ImplicitImports.py +407 -46
  546. nuitka/plugins/standard/KivyPlugin.py +30 -17
  547. nuitka/plugins/standard/MatplotlibPlugin.py +88 -42
  548. nuitka/plugins/standard/MultiprocessingPlugin.py +25 -20
  549. nuitka/plugins/standard/NumpyPlugin.py +19 -17
  550. nuitka/plugins/standard/OptionsNannyPlugin.py +48 -76
  551. nuitka/plugins/standard/PbrPlugin.py +21 -19
  552. nuitka/plugins/standard/PkgResourcesPlugin.py +34 -23
  553. nuitka/plugins/standard/PmwPlugin.py +30 -27
  554. nuitka/plugins/standard/PySidePyQtPlugin.py +74 -80
  555. nuitka/plugins/standard/PywebViewPlugin.py +19 -17
  556. nuitka/plugins/standard/SpacyPlugin.py +136 -0
  557. nuitka/plugins/standard/TensorflowPlugin.py +20 -17
  558. nuitka/plugins/standard/TkinterPlugin.py +103 -53
  559. nuitka/plugins/standard/TorchPlugin.py +20 -17
  560. nuitka/plugins/standard/TransformersPlugin.py +94 -30
  561. nuitka/plugins/standard/TrioPlugin.py +18 -15
  562. nuitka/plugins/standard/UpxPlugin.py +21 -19
  563. nuitka/plugins/standard/__init__.py +5 -4
  564. nuitka/plugins/standard/standard.nuitka-package.config.yml +3449 -1299
  565. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +14 -14
  566. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +121 -66
  567. nuitka/reports/CompilationReportReader.py +67 -0
  568. nuitka/reports/LicenseReport.rst.j2 +21 -21
  569. nuitka/reports/Reports.py +352 -76
  570. nuitka/reports/__init__.py +5 -4
  571. nuitka/specs/BuiltinBytesOperationSpecs.py +18 -17
  572. nuitka/specs/BuiltinDictOperationSpecs.py +18 -17
  573. nuitka/specs/BuiltinListOperationSpecs.py +18 -17
  574. nuitka/specs/BuiltinParameterSpecs.py +30 -20
  575. nuitka/specs/BuiltinStrOperationSpecs.py +19 -18
  576. nuitka/specs/BuiltinTypeOperationSpecs.py +18 -18
  577. nuitka/specs/BuiltinUnicodeOperationSpecs.py +18 -17
  578. nuitka/specs/HardImportSpecs.py +67 -22
  579. nuitka/specs/ParameterSpecs.py +56 -41
  580. nuitka/specs/__init__.py +5 -4
  581. nuitka/tools/Basics.py +20 -18
  582. nuitka/tools/__init__.py +5 -4
  583. nuitka/tools/commercial/__init__.py +7 -6
  584. nuitka/tools/data_composer/DataComposer.py +78 -62
  585. nuitka/tools/data_composer/__init__.py +5 -4
  586. nuitka/tools/data_composer/__main__.py +18 -17
  587. nuitka/tools/environments/CreateEnvironment.py +20 -17
  588. nuitka/tools/environments/Virtualenv.py +60 -32
  589. nuitka/tools/environments/__init__.py +5 -4
  590. nuitka/tools/general/__init__.py +5 -4
  591. nuitka/tools/general/dll_report/__init__.py +5 -4
  592. nuitka/tools/general/dll_report/__main__.py +19 -21
  593. nuitka/tools/general/find_module/FindModuleCode.py +35 -22
  594. nuitka/tools/general/find_module/__init__.py +5 -4
  595. nuitka/tools/onefile_compressor/OnefileCompressor.py +213 -131
  596. nuitka/tools/onefile_compressor/__init__.py +5 -4
  597. nuitka/tools/onefile_compressor/__main__.py +18 -17
  598. nuitka/tools/podman/Podman.py +19 -17
  599. nuitka/tools/podman/__init__.py +5 -4
  600. nuitka/tools/podman/__main__.py +35 -19
  601. nuitka/tools/profiler/__init__.py +5 -4
  602. nuitka/tools/profiler/__main__.py +18 -17
  603. nuitka/tools/scanning/DisplayPackageDLLs.py +47 -22
  604. nuitka/tools/scanning/DisplayPackageData.py +31 -19
  605. nuitka/tools/scanning/__init__.py +5 -4
  606. nuitka/tools/specialize/CTypeDescriptions.py +93 -71
  607. nuitka/tools/specialize/Common.py +18 -17
  608. nuitka/tools/specialize/SpecializeC.py +31 -27
  609. nuitka/tools/specialize/SpecializePython.py +108 -45
  610. nuitka/tools/specialize/__init__.py +5 -4
  611. nuitka/tools/testing/Common.py +106 -52
  612. nuitka/tools/testing/Constructs.py +19 -17
  613. nuitka/tools/testing/OutputComparison.py +54 -18
  614. nuitka/tools/testing/Pythons.py +19 -18
  615. nuitka/tools/testing/RuntimeTracing.py +20 -19
  616. nuitka/tools/testing/SearchModes.py +26 -20
  617. nuitka/tools/testing/Valgrind.py +19 -17
  618. nuitka/tools/testing/__init__.py +5 -4
  619. nuitka/tools/testing/check_reference_counts/__init__.py +5 -4
  620. nuitka/tools/testing/check_reference_counts/__main__.py +18 -18
  621. nuitka/tools/testing/compare_with_cpython/__init__.py +5 -4
  622. nuitka/tools/testing/compare_with_cpython/__main__.py +36 -29
  623. nuitka/tools/testing/find_sxs_modules/__init__.py +5 -4
  624. nuitka/tools/testing/find_sxs_modules/__main__.py +17 -17
  625. nuitka/tools/testing/measure_construct_performance/__init__.py +5 -4
  626. nuitka/tools/testing/measure_construct_performance/__main__.py +22 -25
  627. nuitka/tools/testing/run_nuitka_tests/__init__.py +5 -4
  628. nuitka/tools/testing/run_nuitka_tests/__main__.py +57 -40
  629. nuitka/tools/watch/AutoStage.py +144 -0
  630. nuitka/tools/watch/GitHub.py +113 -0
  631. nuitka/tools/watch/__init__.py +5 -4
  632. nuitka/tools/watch/__main__.py +322 -91
  633. nuitka/tree/Building.py +176 -147
  634. nuitka/tree/ComplexCallHelperFunctions.py +80 -58
  635. nuitka/tree/Extractions.py +19 -17
  636. nuitka/tree/InternalModule.py +29 -20
  637. nuitka/tree/Operations.py +19 -17
  638. nuitka/tree/ReformulationAssertStatements.py +20 -17
  639. nuitka/tree/ReformulationAssignmentStatements.py +92 -91
  640. nuitka/tree/ReformulationBooleanExpressions.py +19 -17
  641. nuitka/tree/ReformulationCallExpressions.py +20 -18
  642. nuitka/tree/ReformulationClasses.py +45 -39
  643. nuitka/tree/ReformulationClasses3.py +146 -98
  644. nuitka/tree/ReformulationComparisonExpressions.py +29 -35
  645. nuitka/tree/ReformulationContractionExpressions.py +58 -55
  646. nuitka/tree/ReformulationDictionaryCreation.py +40 -35
  647. nuitka/tree/ReformulationExecStatements.py +42 -39
  648. nuitka/tree/ReformulationForLoopStatements.py +30 -34
  649. nuitka/tree/ReformulationFunctionStatements.py +58 -54
  650. nuitka/tree/ReformulationImportStatements.py +34 -29
  651. nuitka/tree/ReformulationLambdaExpressions.py +23 -24
  652. nuitka/tree/ReformulationMatchStatements.py +244 -92
  653. nuitka/tree/ReformulationMultidist.py +22 -18
  654. nuitka/tree/ReformulationNamespacePackages.py +55 -46
  655. nuitka/tree/ReformulationPrintStatements.py +23 -24
  656. nuitka/tree/ReformulationSequenceCreation.py +50 -49
  657. nuitka/tree/ReformulationSubscriptExpressions.py +19 -17
  658. nuitka/tree/ReformulationTryExceptStatements.py +19 -17
  659. nuitka/tree/ReformulationTryFinallyStatements.py +34 -17
  660. nuitka/tree/ReformulationWhileLoopStatements.py +19 -17
  661. nuitka/tree/ReformulationWithStatements.py +39 -41
  662. nuitka/tree/ReformulationYieldExpressions.py +21 -19
  663. nuitka/tree/SourceHandling.py +76 -31
  664. nuitka/tree/SyntaxErrors.py +19 -17
  665. nuitka/tree/TreeHelpers.py +33 -20
  666. nuitka/tree/VariableClosure.py +35 -39
  667. nuitka/tree/__init__.py +5 -4
  668. nuitka/utils/AppDirs.py +41 -20
  669. nuitka/utils/CStrings.py +66 -21
  670. nuitka/utils/CommandLineOptions.py +84 -19
  671. nuitka/utils/Distributions.py +445 -54
  672. nuitka/utils/Download.py +89 -57
  673. nuitka/utils/Execution.py +73 -34
  674. nuitka/utils/FileOperations.py +318 -74
  675. nuitka/utils/Hashing.py +55 -33
  676. nuitka/utils/Images.py +26 -19
  677. nuitka/utils/Importing.py +118 -24
  678. nuitka/utils/InstalledPythons.py +80 -75
  679. nuitka/utils/InstanceCounters.py +20 -17
  680. nuitka/utils/Jinja2.py +30 -22
  681. nuitka/utils/Json.py +19 -17
  682. nuitka/utils/MacOSApp.py +26 -18
  683. nuitka/utils/MemoryUsage.py +20 -18
  684. nuitka/utils/ModuleNames.py +42 -26
  685. nuitka/utils/ReExecute.py +50 -28
  686. nuitka/utils/Rest.py +20 -17
  687. nuitka/utils/SharedLibraries.py +161 -75
  688. nuitka/utils/Shebang.py +20 -17
  689. nuitka/utils/Signing.py +63 -18
  690. nuitka/utils/SlotMetaClasses.py +57 -0
  691. nuitka/utils/StaticLibraries.py +83 -56
  692. nuitka/utils/ThreadedExecutor.py +18 -17
  693. nuitka/utils/Timing.py +22 -20
  694. nuitka/utils/Utils.py +115 -25
  695. nuitka/utils/WindowsFileUsage.py +22 -20
  696. nuitka/utils/WindowsResources.py +25 -18
  697. nuitka/utils/Yaml.py +62 -24
  698. nuitka/utils/__init__.py +5 -4
  699. Nuitka_winsvc-1.8.dist-info/RECORD +0 -905
  700. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_gui.py +0 -9
  701. nuitka/build/inline_copy/tqdm/tqdm/gui.py +0 -191
  702. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/LICENSE.txt +0 -0
  703. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/entry_points.txt +0 -0
  704. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/top_level.txt +0 -0
@@ -1,20 +1,5 @@
1
- // Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com
2
- //
3
- // Part of "Nuitka", an optimizing Python compiler that is compatible and
4
- // integrates with CPython, but also works on its own.
5
- //
6
- // Licensed under the Apache License, Version 2.0 (the "License");
7
- // you may not use this file except in compliance with the License.
8
- // You may obtain a copy of the License at
9
- //
10
- // http://www.apache.org/licenses/LICENSE-2.0
11
- //
12
- // Unless required by applicable law or agreed to in writing, software
13
- // distributed under the License is distributed on an "AS IS" BASIS,
14
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- // See the License for the specific language governing permissions and
16
- // limitations under the License.
17
- //
1
+ // Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
18
3
  /* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */
19
4
 
20
5
  /* This file is included from another C file, help IDEs to still parse it on its own. */
@@ -38,7 +23,7 @@ static PyObject *COMPARE_GT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand
38
23
 
39
24
  // Convert to target type.
40
25
  PyObject *result = BOOL_FROM(r);
41
- Py_INCREF(result);
26
+ Py_INCREF_IMMORTAL(result);
42
27
  return result;
43
28
  }
44
29
  #endif
@@ -86,7 +71,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
86
71
  // If the types are equal, we may get away immediately except for instances.
87
72
  if (type1 == type2 && !PyInstance_Check(operand1)) {
88
73
 
89
- richcmpfunc frich = RICHCOMPARE(type1);
74
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
90
75
 
91
76
  if (frich != NULL) {
92
77
  PyObject *result = (*frich)(operand1, operand2, Py_GT);
@@ -97,7 +82,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
97
82
  return result;
98
83
  }
99
84
 
100
- Py_DECREF(result);
85
+ Py_DECREF_IMMORTAL(result);
101
86
  }
102
87
 
103
88
  // No rich comparison worked, but maybe compare works.
@@ -138,7 +123,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
138
123
 
139
124
  bool r = c != 0;
140
125
  PyObject *result = BOOL_FROM(r);
141
- Py_INCREF(result);
126
+ Py_INCREF_IMMORTAL(result);
142
127
  return result;
143
128
  }
144
129
  }
@@ -147,7 +132,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
147
132
  richcmpfunc f;
148
133
 
149
134
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
150
- f = RICHCOMPARE(type2);
135
+ f = TP_RICHCOMPARE(type2);
151
136
 
152
137
  if (f != NULL) {
153
138
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -158,11 +143,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
158
143
  return result;
159
144
  }
160
145
 
161
- Py_DECREF(result);
146
+ Py_DECREF_IMMORTAL(result);
162
147
  }
163
148
  }
164
149
 
165
- f = RICHCOMPARE(type1);
150
+ f = TP_RICHCOMPARE(type1);
166
151
  if (f != NULL) {
167
152
  PyObject *result = (*f)(operand1, operand2, Py_GT);
168
153
 
@@ -172,10 +157,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
172
157
  return result;
173
158
  }
174
159
 
175
- Py_DECREF(result);
160
+ Py_DECREF_IMMORTAL(result);
176
161
  }
177
162
 
178
- f = RICHCOMPARE(type2);
163
+ f = TP_RICHCOMPARE(type2);
179
164
  if (f != NULL) {
180
165
  PyObject *result = (*f)(operand2, operand1, Py_LT);
181
166
 
@@ -185,7 +170,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
185
170
  return result;
186
171
  }
187
172
 
188
- Py_DECREF(result);
173
+ Py_DECREF_IMMORTAL(result);
189
174
  }
190
175
 
191
176
  int c;
@@ -273,14 +258,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
273
258
 
274
259
  bool r = c != 0;
275
260
  PyObject *result = BOOL_FROM(r);
276
- Py_INCREF(result);
261
+ Py_INCREF_IMMORTAL(result);
277
262
  return result;
278
263
  #else
279
264
  bool checked_reverse_op = false;
280
265
  richcmpfunc f;
281
266
 
282
267
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
283
- f = RICHCOMPARE(type2);
268
+ f = TP_RICHCOMPARE(type2);
284
269
 
285
270
  if (f != NULL) {
286
271
  checked_reverse_op = true;
@@ -293,11 +278,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
293
278
  return result;
294
279
  }
295
280
 
296
- Py_DECREF(result);
281
+ Py_DECREF_IMMORTAL(result);
297
282
  }
298
283
  }
299
284
 
300
- f = RICHCOMPARE(type1);
285
+ f = TP_RICHCOMPARE(type1);
301
286
 
302
287
  if (f != NULL) {
303
288
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -308,11 +293,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
308
293
  return result;
309
294
  }
310
295
 
311
- Py_DECREF(result);
296
+ Py_DECREF_IMMORTAL(result);
312
297
  }
313
298
 
314
299
  if (checked_reverse_op == false) {
315
- f = RICHCOMPARE(type2);
300
+ f = TP_RICHCOMPARE(type2);
316
301
 
317
302
  if (f != NULL) {
318
303
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -323,7 +308,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
323
308
  return result;
324
309
  }
325
310
 
326
- Py_DECREF(result);
311
+ Py_DECREF_IMMORTAL(result);
327
312
  }
328
313
  }
329
314
 
@@ -335,13 +320,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
335
320
  case Py_EQ: {
336
321
  bool r = operand1 == operand2;
337
322
  PyObject *result = BOOL_FROM(r);
338
- Py_INCREF(result);
323
+ Py_INCREF_IMMORTAL(result);
339
324
  return result;
340
325
  }
341
326
  case Py_NE: {
342
327
  bool r = operand1 != operand2;
343
328
  PyObject *result = BOOL_FROM(r);
344
- Py_INCREF(result);
329
+ Py_INCREF_IMMORTAL(result);
345
330
  return result;
346
331
  }
347
332
  default:
@@ -382,7 +367,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
382
367
  // If the types are equal, we may get away immediately except for instances.
383
368
  if (type1 == type2 && !PyInstance_Check(operand1)) {
384
369
 
385
- richcmpfunc frich = RICHCOMPARE(type1);
370
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
386
371
 
387
372
  if (frich != NULL) {
388
373
  PyObject *result = (*frich)(operand1, operand2, Py_GT);
@@ -401,7 +386,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
401
386
  }
402
387
  }
403
388
 
404
- Py_DECREF(result);
389
+ Py_DECREF_IMMORTAL(result);
405
390
  }
406
391
 
407
392
  // No rich comparison worked, but maybe compare works.
@@ -451,7 +436,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
451
436
  richcmpfunc f;
452
437
 
453
438
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
454
- f = RICHCOMPARE(type2);
439
+ f = TP_RICHCOMPARE(type2);
455
440
 
456
441
  if (f != NULL) {
457
442
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -470,11 +455,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
470
455
  }
471
456
  }
472
457
 
473
- Py_DECREF(result);
458
+ Py_DECREF_IMMORTAL(result);
474
459
  }
475
460
  }
476
461
 
477
- f = RICHCOMPARE(type1);
462
+ f = TP_RICHCOMPARE(type1);
478
463
  if (f != NULL) {
479
464
  PyObject *result = (*f)(operand1, operand2, Py_GT);
480
465
 
@@ -492,10 +477,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
492
477
  }
493
478
  }
494
479
 
495
- Py_DECREF(result);
480
+ Py_DECREF_IMMORTAL(result);
496
481
  }
497
482
 
498
- f = RICHCOMPARE(type2);
483
+ f = TP_RICHCOMPARE(type2);
499
484
  if (f != NULL) {
500
485
  PyObject *result = (*f)(operand2, operand1, Py_LT);
501
486
 
@@ -513,7 +498,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
513
498
  }
514
499
  }
515
500
 
516
- Py_DECREF(result);
501
+ Py_DECREF_IMMORTAL(result);
517
502
  }
518
503
 
519
504
  int c;
@@ -608,7 +593,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
608
593
  richcmpfunc f;
609
594
 
610
595
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
611
- f = RICHCOMPARE(type2);
596
+ f = TP_RICHCOMPARE(type2);
612
597
 
613
598
  if (f != NULL) {
614
599
  checked_reverse_op = true;
@@ -629,11 +614,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
629
614
  }
630
615
  }
631
616
 
632
- Py_DECREF(result);
617
+ Py_DECREF_IMMORTAL(result);
633
618
  }
634
619
  }
635
620
 
636
- f = RICHCOMPARE(type1);
621
+ f = TP_RICHCOMPARE(type1);
637
622
 
638
623
  if (f != NULL) {
639
624
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -652,11 +637,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
652
637
  }
653
638
  }
654
639
 
655
- Py_DECREF(result);
640
+ Py_DECREF_IMMORTAL(result);
656
641
  }
657
642
 
658
643
  if (checked_reverse_op == false) {
659
- f = RICHCOMPARE(type2);
644
+ f = TP_RICHCOMPARE(type2);
660
645
 
661
646
  if (f != NULL) {
662
647
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -675,7 +660,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
675
660
  }
676
661
  }
677
662
 
678
- Py_DECREF(result);
663
+ Py_DECREF_IMMORTAL(result);
679
664
  }
680
665
  }
681
666
 
@@ -724,7 +709,7 @@ static PyObject *COMPARE_GT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
724
709
 
725
710
  // Convert to target type.
726
711
  PyObject *result = BOOL_FROM(r);
727
- Py_INCREF(result);
712
+ Py_INCREF_IMMORTAL(result);
728
713
  return result;
729
714
  }
730
715
 
@@ -752,7 +737,7 @@ static PyObject *COMPARE_GT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
752
737
 
753
738
  // Convert to target type.
754
739
  PyObject *result = BOOL_FROM(c != 0);
755
- Py_INCREF(result);
740
+ Py_INCREF_IMMORTAL(result);
756
741
  return result;
757
742
  }
758
743
  /* Code referring to "OBJECT" corresponds to any Python object and "STR" to Python2 'str'. */
@@ -789,7 +774,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
789
774
  return result;
790
775
  }
791
776
 
792
- Py_DECREF(result);
777
+ Py_DECREF_IMMORTAL(result);
793
778
  }
794
779
 
795
780
  // No rich comparison worked, but maybe compare works.
@@ -830,7 +815,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
830
815
 
831
816
  bool r = c != 0;
832
817
  PyObject *result = BOOL_FROM(r);
833
- Py_INCREF(result);
818
+ Py_INCREF_IMMORTAL(result);
834
819
  return result;
835
820
  }
836
821
  }
@@ -850,11 +835,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
850
835
  return result;
851
836
  }
852
837
 
853
- Py_DECREF(result);
838
+ Py_DECREF_IMMORTAL(result);
854
839
  }
855
840
  }
856
841
 
857
- f = RICHCOMPARE(type1);
842
+ f = TP_RICHCOMPARE(type1);
858
843
  if (f != NULL) {
859
844
  PyObject *result = (*f)(operand1, operand2, Py_GT);
860
845
 
@@ -864,7 +849,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
864
849
  return result;
865
850
  }
866
851
 
867
- Py_DECREF(result);
852
+ Py_DECREF_IMMORTAL(result);
868
853
  }
869
854
 
870
855
  f = PyString_Type.tp_richcompare;
@@ -877,7 +862,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
877
862
  return result;
878
863
  }
879
864
 
880
- Py_DECREF(result);
865
+ Py_DECREF_IMMORTAL(result);
881
866
  }
882
867
 
883
868
  int c;
@@ -965,7 +950,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
965
950
 
966
951
  bool r = c != 0;
967
952
  PyObject *result = BOOL_FROM(r);
968
- Py_INCREF(result);
953
+ Py_INCREF_IMMORTAL(result);
969
954
  return result;
970
955
  #else
971
956
  bool checked_reverse_op = false;
@@ -985,11 +970,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
985
970
  return result;
986
971
  }
987
972
 
988
- Py_DECREF(result);
973
+ Py_DECREF_IMMORTAL(result);
989
974
  }
990
975
  }
991
976
 
992
- f = RICHCOMPARE(type1);
977
+ f = TP_RICHCOMPARE(type1);
993
978
 
994
979
  if (f != NULL) {
995
980
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -1000,7 +985,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1000
985
  return result;
1001
986
  }
1002
987
 
1003
- Py_DECREF(result);
988
+ Py_DECREF_IMMORTAL(result);
1004
989
  }
1005
990
 
1006
991
  if (checked_reverse_op == false) {
@@ -1015,7 +1000,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1015
1000
  return result;
1016
1001
  }
1017
1002
 
1018
- Py_DECREF(result);
1003
+ Py_DECREF_IMMORTAL(result);
1019
1004
  }
1020
1005
  }
1021
1006
 
@@ -1027,13 +1012,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1027
1012
  case Py_EQ: {
1028
1013
  bool r = operand1 == operand2;
1029
1014
  PyObject *result = BOOL_FROM(r);
1030
- Py_INCREF(result);
1015
+ Py_INCREF_IMMORTAL(result);
1031
1016
  return result;
1032
1017
  }
1033
1018
  case Py_NE: {
1034
1019
  bool r = operand1 != operand2;
1035
1020
  PyObject *result = BOOL_FROM(r);
1036
- Py_INCREF(result);
1021
+ Py_INCREF_IMMORTAL(result);
1037
1022
  return result;
1038
1023
  }
1039
1024
  default:
@@ -1083,7 +1068,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1083
1068
  return result;
1084
1069
  }
1085
1070
 
1086
- Py_DECREF(result);
1071
+ Py_DECREF_IMMORTAL(result);
1087
1072
  }
1088
1073
 
1089
1074
  // No rich comparison worked, but maybe compare works.
@@ -1124,7 +1109,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1124
1109
 
1125
1110
  bool r = c != 0;
1126
1111
  PyObject *result = BOOL_FROM(r);
1127
- Py_INCREF(result);
1112
+ Py_INCREF_IMMORTAL(result);
1128
1113
  return result;
1129
1114
  }
1130
1115
  }
@@ -1133,7 +1118,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1133
1118
  richcmpfunc f;
1134
1119
 
1135
1120
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1136
- f = RICHCOMPARE(type2);
1121
+ f = TP_RICHCOMPARE(type2);
1137
1122
 
1138
1123
  if (f != NULL) {
1139
1124
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -1144,7 +1129,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1144
1129
  return result;
1145
1130
  }
1146
1131
 
1147
- Py_DECREF(result);
1132
+ Py_DECREF_IMMORTAL(result);
1148
1133
  }
1149
1134
  }
1150
1135
 
@@ -1158,10 +1143,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1158
1143
  return result;
1159
1144
  }
1160
1145
 
1161
- Py_DECREF(result);
1146
+ Py_DECREF_IMMORTAL(result);
1162
1147
  }
1163
1148
 
1164
- f = RICHCOMPARE(type2);
1149
+ f = TP_RICHCOMPARE(type2);
1165
1150
  if (f != NULL) {
1166
1151
  PyObject *result = (*f)(operand2, operand1, Py_LT);
1167
1152
 
@@ -1171,7 +1156,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1171
1156
  return result;
1172
1157
  }
1173
1158
 
1174
- Py_DECREF(result);
1159
+ Py_DECREF_IMMORTAL(result);
1175
1160
  }
1176
1161
 
1177
1162
  int c;
@@ -1259,14 +1244,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1259
1244
 
1260
1245
  bool r = c != 0;
1261
1246
  PyObject *result = BOOL_FROM(r);
1262
- Py_INCREF(result);
1247
+ Py_INCREF_IMMORTAL(result);
1263
1248
  return result;
1264
1249
  #else
1265
1250
  bool checked_reverse_op = false;
1266
1251
  richcmpfunc f;
1267
1252
 
1268
1253
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1269
- f = RICHCOMPARE(type2);
1254
+ f = TP_RICHCOMPARE(type2);
1270
1255
 
1271
1256
  if (f != NULL) {
1272
1257
  checked_reverse_op = true;
@@ -1279,7 +1264,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1279
1264
  return result;
1280
1265
  }
1281
1266
 
1282
- Py_DECREF(result);
1267
+ Py_DECREF_IMMORTAL(result);
1283
1268
  }
1284
1269
  }
1285
1270
 
@@ -1294,11 +1279,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1294
1279
  return result;
1295
1280
  }
1296
1281
 
1297
- Py_DECREF(result);
1282
+ Py_DECREF_IMMORTAL(result);
1298
1283
  }
1299
1284
 
1300
1285
  if (checked_reverse_op == false) {
1301
- f = RICHCOMPARE(type2);
1286
+ f = TP_RICHCOMPARE(type2);
1302
1287
 
1303
1288
  if (f != NULL) {
1304
1289
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -1309,7 +1294,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1309
1294
  return result;
1310
1295
  }
1311
1296
 
1312
- Py_DECREF(result);
1297
+ Py_DECREF_IMMORTAL(result);
1313
1298
  }
1314
1299
  }
1315
1300
 
@@ -1321,13 +1306,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1321
1306
  case Py_EQ: {
1322
1307
  bool r = operand1 == operand2;
1323
1308
  PyObject *result = BOOL_FROM(r);
1324
- Py_INCREF(result);
1309
+ Py_INCREF_IMMORTAL(result);
1325
1310
  return result;
1326
1311
  }
1327
1312
  case Py_NE: {
1328
1313
  bool r = operand1 != operand2;
1329
1314
  PyObject *result = BOOL_FROM(r);
1330
- Py_INCREF(result);
1315
+ Py_INCREF_IMMORTAL(result);
1331
1316
  return result;
1332
1317
  }
1333
1318
  default:
@@ -1431,7 +1416,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1431
1416
  }
1432
1417
  }
1433
1418
 
1434
- Py_DECREF(result);
1419
+ Py_DECREF_IMMORTAL(result);
1435
1420
  }
1436
1421
 
1437
1422
  // No rich comparison worked, but maybe compare works.
@@ -1500,11 +1485,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1500
1485
  }
1501
1486
  }
1502
1487
 
1503
- Py_DECREF(result);
1488
+ Py_DECREF_IMMORTAL(result);
1504
1489
  }
1505
1490
  }
1506
1491
 
1507
- f = RICHCOMPARE(type1);
1492
+ f = TP_RICHCOMPARE(type1);
1508
1493
  if (f != NULL) {
1509
1494
  PyObject *result = (*f)(operand1, operand2, Py_GT);
1510
1495
 
@@ -1522,7 +1507,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1522
1507
  }
1523
1508
  }
1524
1509
 
1525
- Py_DECREF(result);
1510
+ Py_DECREF_IMMORTAL(result);
1526
1511
  }
1527
1512
 
1528
1513
  f = PyString_Type.tp_richcompare;
@@ -1543,7 +1528,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1543
1528
  }
1544
1529
  }
1545
1530
 
1546
- Py_DECREF(result);
1531
+ Py_DECREF_IMMORTAL(result);
1547
1532
  }
1548
1533
 
1549
1534
  int c;
@@ -1659,11 +1644,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1659
1644
  }
1660
1645
  }
1661
1646
 
1662
- Py_DECREF(result);
1647
+ Py_DECREF_IMMORTAL(result);
1663
1648
  }
1664
1649
  }
1665
1650
 
1666
- f = RICHCOMPARE(type1);
1651
+ f = TP_RICHCOMPARE(type1);
1667
1652
 
1668
1653
  if (f != NULL) {
1669
1654
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -1682,7 +1667,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1682
1667
  }
1683
1668
  }
1684
1669
 
1685
- Py_DECREF(result);
1670
+ Py_DECREF_IMMORTAL(result);
1686
1671
  }
1687
1672
 
1688
1673
  if (checked_reverse_op == false) {
@@ -1705,7 +1690,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1705
1690
  }
1706
1691
  }
1707
1692
 
1708
- Py_DECREF(result);
1693
+ Py_DECREF_IMMORTAL(result);
1709
1694
  }
1710
1695
  }
1711
1696
 
@@ -1781,7 +1766,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1781
1766
  }
1782
1767
  }
1783
1768
 
1784
- Py_DECREF(result);
1769
+ Py_DECREF_IMMORTAL(result);
1785
1770
  }
1786
1771
 
1787
1772
  // No rich comparison worked, but maybe compare works.
@@ -1831,7 +1816,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1831
1816
  richcmpfunc f;
1832
1817
 
1833
1818
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1834
- f = RICHCOMPARE(type2);
1819
+ f = TP_RICHCOMPARE(type2);
1835
1820
 
1836
1821
  if (f != NULL) {
1837
1822
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -1850,7 +1835,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1850
1835
  }
1851
1836
  }
1852
1837
 
1853
- Py_DECREF(result);
1838
+ Py_DECREF_IMMORTAL(result);
1854
1839
  }
1855
1840
  }
1856
1841
 
@@ -1872,10 +1857,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1872
1857
  }
1873
1858
  }
1874
1859
 
1875
- Py_DECREF(result);
1860
+ Py_DECREF_IMMORTAL(result);
1876
1861
  }
1877
1862
 
1878
- f = RICHCOMPARE(type2);
1863
+ f = TP_RICHCOMPARE(type2);
1879
1864
  if (f != NULL) {
1880
1865
  PyObject *result = (*f)(operand2, operand1, Py_LT);
1881
1866
 
@@ -1893,7 +1878,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1893
1878
  }
1894
1879
  }
1895
1880
 
1896
- Py_DECREF(result);
1881
+ Py_DECREF_IMMORTAL(result);
1897
1882
  }
1898
1883
 
1899
1884
  int c;
@@ -1988,7 +1973,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1988
1973
  richcmpfunc f;
1989
1974
 
1990
1975
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1991
- f = RICHCOMPARE(type2);
1976
+ f = TP_RICHCOMPARE(type2);
1992
1977
 
1993
1978
  if (f != NULL) {
1994
1979
  checked_reverse_op = true;
@@ -2009,7 +1994,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2009
1994
  }
2010
1995
  }
2011
1996
 
2012
- Py_DECREF(result);
1997
+ Py_DECREF_IMMORTAL(result);
2013
1998
  }
2014
1999
  }
2015
2000
 
@@ -2032,11 +2017,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2032
2017
  }
2033
2018
  }
2034
2019
 
2035
- Py_DECREF(result);
2020
+ Py_DECREF_IMMORTAL(result);
2036
2021
  }
2037
2022
 
2038
2023
  if (checked_reverse_op == false) {
2039
- f = RICHCOMPARE(type2);
2024
+ f = TP_RICHCOMPARE(type2);
2040
2025
 
2041
2026
  if (f != NULL) {
2042
2027
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -2055,7 +2040,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2055
2040
  }
2056
2041
  }
2057
2042
 
2058
- Py_DECREF(result);
2043
+ Py_DECREF_IMMORTAL(result);
2059
2044
  }
2060
2045
  }
2061
2046
 
@@ -2103,7 +2088,7 @@ static PyObject *COMPARE_GT_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject
2103
2088
 
2104
2089
  // Convert to target type.
2105
2090
  PyObject *result = BOOL_FROM(r);
2106
- Py_INCREF(result);
2091
+ Py_INCREF_IMMORTAL(result);
2107
2092
  return result;
2108
2093
  }
2109
2094
 
@@ -2146,7 +2131,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2146
2131
  return result;
2147
2132
  }
2148
2133
 
2149
- Py_DECREF(result);
2134
+ Py_DECREF_IMMORTAL(result);
2150
2135
  }
2151
2136
 
2152
2137
  // No rich comparison worked, but maybe compare works.
@@ -2187,7 +2172,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2187
2172
 
2188
2173
  bool r = c != 0;
2189
2174
  PyObject *result = BOOL_FROM(r);
2190
- Py_INCREF(result);
2175
+ Py_INCREF_IMMORTAL(result);
2191
2176
  return result;
2192
2177
  }
2193
2178
  }
@@ -2207,11 +2192,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2207
2192
  return result;
2208
2193
  }
2209
2194
 
2210
- Py_DECREF(result);
2195
+ Py_DECREF_IMMORTAL(result);
2211
2196
  }
2212
2197
  }
2213
2198
 
2214
- f = RICHCOMPARE(type1);
2199
+ f = TP_RICHCOMPARE(type1);
2215
2200
  if (f != NULL) {
2216
2201
  PyObject *result = (*f)(operand1, operand2, Py_GT);
2217
2202
 
@@ -2221,7 +2206,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2221
2206
  return result;
2222
2207
  }
2223
2208
 
2224
- Py_DECREF(result);
2209
+ Py_DECREF_IMMORTAL(result);
2225
2210
  }
2226
2211
 
2227
2212
  f = PyUnicode_Type.tp_richcompare;
@@ -2234,7 +2219,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2234
2219
  return result;
2235
2220
  }
2236
2221
 
2237
- Py_DECREF(result);
2222
+ Py_DECREF_IMMORTAL(result);
2238
2223
  }
2239
2224
 
2240
2225
  int c;
@@ -2322,7 +2307,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2322
2307
 
2323
2308
  bool r = c != 0;
2324
2309
  PyObject *result = BOOL_FROM(r);
2325
- Py_INCREF(result);
2310
+ Py_INCREF_IMMORTAL(result);
2326
2311
  return result;
2327
2312
  #else
2328
2313
  bool checked_reverse_op = false;
@@ -2342,11 +2327,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2342
2327
  return result;
2343
2328
  }
2344
2329
 
2345
- Py_DECREF(result);
2330
+ Py_DECREF_IMMORTAL(result);
2346
2331
  }
2347
2332
  }
2348
2333
 
2349
- f = RICHCOMPARE(type1);
2334
+ f = TP_RICHCOMPARE(type1);
2350
2335
 
2351
2336
  if (f != NULL) {
2352
2337
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -2357,7 +2342,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2357
2342
  return result;
2358
2343
  }
2359
2344
 
2360
- Py_DECREF(result);
2345
+ Py_DECREF_IMMORTAL(result);
2361
2346
  }
2362
2347
 
2363
2348
  if (checked_reverse_op == false) {
@@ -2372,7 +2357,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2372
2357
  return result;
2373
2358
  }
2374
2359
 
2375
- Py_DECREF(result);
2360
+ Py_DECREF_IMMORTAL(result);
2376
2361
  }
2377
2362
  }
2378
2363
 
@@ -2384,13 +2369,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2384
2369
  case Py_EQ: {
2385
2370
  bool r = operand1 == operand2;
2386
2371
  PyObject *result = BOOL_FROM(r);
2387
- Py_INCREF(result);
2372
+ Py_INCREF_IMMORTAL(result);
2388
2373
  return result;
2389
2374
  }
2390
2375
  case Py_NE: {
2391
2376
  bool r = operand1 != operand2;
2392
2377
  PyObject *result = BOOL_FROM(r);
2393
- Py_INCREF(result);
2378
+ Py_INCREF_IMMORTAL(result);
2394
2379
  return result;
2395
2380
  }
2396
2381
  default:
@@ -2440,7 +2425,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2440
2425
  return result;
2441
2426
  }
2442
2427
 
2443
- Py_DECREF(result);
2428
+ Py_DECREF_IMMORTAL(result);
2444
2429
  }
2445
2430
 
2446
2431
  // No rich comparison worked, but maybe compare works.
@@ -2481,7 +2466,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2481
2466
 
2482
2467
  bool r = c != 0;
2483
2468
  PyObject *result = BOOL_FROM(r);
2484
- Py_INCREF(result);
2469
+ Py_INCREF_IMMORTAL(result);
2485
2470
  return result;
2486
2471
  }
2487
2472
  }
@@ -2490,7 +2475,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2490
2475
  richcmpfunc f;
2491
2476
 
2492
2477
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2493
- f = RICHCOMPARE(type2);
2478
+ f = TP_RICHCOMPARE(type2);
2494
2479
 
2495
2480
  if (f != NULL) {
2496
2481
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -2501,7 +2486,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2501
2486
  return result;
2502
2487
  }
2503
2488
 
2504
- Py_DECREF(result);
2489
+ Py_DECREF_IMMORTAL(result);
2505
2490
  }
2506
2491
  }
2507
2492
 
@@ -2515,10 +2500,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2515
2500
  return result;
2516
2501
  }
2517
2502
 
2518
- Py_DECREF(result);
2503
+ Py_DECREF_IMMORTAL(result);
2519
2504
  }
2520
2505
 
2521
- f = RICHCOMPARE(type2);
2506
+ f = TP_RICHCOMPARE(type2);
2522
2507
  if (f != NULL) {
2523
2508
  PyObject *result = (*f)(operand2, operand1, Py_LT);
2524
2509
 
@@ -2528,7 +2513,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2528
2513
  return result;
2529
2514
  }
2530
2515
 
2531
- Py_DECREF(result);
2516
+ Py_DECREF_IMMORTAL(result);
2532
2517
  }
2533
2518
 
2534
2519
  int c;
@@ -2616,14 +2601,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2616
2601
 
2617
2602
  bool r = c != 0;
2618
2603
  PyObject *result = BOOL_FROM(r);
2619
- Py_INCREF(result);
2604
+ Py_INCREF_IMMORTAL(result);
2620
2605
  return result;
2621
2606
  #else
2622
2607
  bool checked_reverse_op = false;
2623
2608
  richcmpfunc f;
2624
2609
 
2625
2610
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2626
- f = RICHCOMPARE(type2);
2611
+ f = TP_RICHCOMPARE(type2);
2627
2612
 
2628
2613
  if (f != NULL) {
2629
2614
  checked_reverse_op = true;
@@ -2636,7 +2621,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2636
2621
  return result;
2637
2622
  }
2638
2623
 
2639
- Py_DECREF(result);
2624
+ Py_DECREF_IMMORTAL(result);
2640
2625
  }
2641
2626
  }
2642
2627
 
@@ -2651,11 +2636,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2651
2636
  return result;
2652
2637
  }
2653
2638
 
2654
- Py_DECREF(result);
2639
+ Py_DECREF_IMMORTAL(result);
2655
2640
  }
2656
2641
 
2657
2642
  if (checked_reverse_op == false) {
2658
- f = RICHCOMPARE(type2);
2643
+ f = TP_RICHCOMPARE(type2);
2659
2644
 
2660
2645
  if (f != NULL) {
2661
2646
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -2666,7 +2651,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2666
2651
  return result;
2667
2652
  }
2668
2653
 
2669
- Py_DECREF(result);
2654
+ Py_DECREF_IMMORTAL(result);
2670
2655
  }
2671
2656
  }
2672
2657
 
@@ -2678,13 +2663,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2678
2663
  case Py_EQ: {
2679
2664
  bool r = operand1 == operand2;
2680
2665
  PyObject *result = BOOL_FROM(r);
2681
- Py_INCREF(result);
2666
+ Py_INCREF_IMMORTAL(result);
2682
2667
  return result;
2683
2668
  }
2684
2669
  case Py_NE: {
2685
2670
  bool r = operand1 != operand2;
2686
2671
  PyObject *result = BOOL_FROM(r);
2687
- Py_INCREF(result);
2672
+ Py_INCREF_IMMORTAL(result);
2688
2673
  return result;
2689
2674
  }
2690
2675
  default:
@@ -2724,7 +2709,7 @@ static bool COMPARE_GT_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *opera
2724
2709
 
2725
2710
  // Convert to target type if necessary
2726
2711
  bool result = r == Py_True;
2727
- Py_DECREF(r);
2712
+ Py_DECREF_IMMORTAL(r);
2728
2713
 
2729
2714
  return result;
2730
2715
  }
@@ -2770,7 +2755,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2770
2755
  }
2771
2756
  }
2772
2757
 
2773
- Py_DECREF(result);
2758
+ Py_DECREF_IMMORTAL(result);
2774
2759
  }
2775
2760
 
2776
2761
  // No rich comparison worked, but maybe compare works.
@@ -2839,11 +2824,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2839
2824
  }
2840
2825
  }
2841
2826
 
2842
- Py_DECREF(result);
2827
+ Py_DECREF_IMMORTAL(result);
2843
2828
  }
2844
2829
  }
2845
2830
 
2846
- f = RICHCOMPARE(type1);
2831
+ f = TP_RICHCOMPARE(type1);
2847
2832
  if (f != NULL) {
2848
2833
  PyObject *result = (*f)(operand1, operand2, Py_GT);
2849
2834
 
@@ -2861,7 +2846,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2861
2846
  }
2862
2847
  }
2863
2848
 
2864
- Py_DECREF(result);
2849
+ Py_DECREF_IMMORTAL(result);
2865
2850
  }
2866
2851
 
2867
2852
  f = PyUnicode_Type.tp_richcompare;
@@ -2882,7 +2867,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2882
2867
  }
2883
2868
  }
2884
2869
 
2885
- Py_DECREF(result);
2870
+ Py_DECREF_IMMORTAL(result);
2886
2871
  }
2887
2872
 
2888
2873
  int c;
@@ -2998,11 +2983,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2998
2983
  }
2999
2984
  }
3000
2985
 
3001
- Py_DECREF(result);
2986
+ Py_DECREF_IMMORTAL(result);
3002
2987
  }
3003
2988
  }
3004
2989
 
3005
- f = RICHCOMPARE(type1);
2990
+ f = TP_RICHCOMPARE(type1);
3006
2991
 
3007
2992
  if (f != NULL) {
3008
2993
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -3021,7 +3006,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3021
3006
  }
3022
3007
  }
3023
3008
 
3024
- Py_DECREF(result);
3009
+ Py_DECREF_IMMORTAL(result);
3025
3010
  }
3026
3011
 
3027
3012
  if (checked_reverse_op == false) {
@@ -3044,7 +3029,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3044
3029
  }
3045
3030
  }
3046
3031
 
3047
- Py_DECREF(result);
3032
+ Py_DECREF_IMMORTAL(result);
3048
3033
  }
3049
3034
  }
3050
3035
 
@@ -3120,7 +3105,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3120
3105
  }
3121
3106
  }
3122
3107
 
3123
- Py_DECREF(result);
3108
+ Py_DECREF_IMMORTAL(result);
3124
3109
  }
3125
3110
 
3126
3111
  // No rich comparison worked, but maybe compare works.
@@ -3170,7 +3155,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3170
3155
  richcmpfunc f;
3171
3156
 
3172
3157
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3173
- f = RICHCOMPARE(type2);
3158
+ f = TP_RICHCOMPARE(type2);
3174
3159
 
3175
3160
  if (f != NULL) {
3176
3161
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -3189,7 +3174,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3189
3174
  }
3190
3175
  }
3191
3176
 
3192
- Py_DECREF(result);
3177
+ Py_DECREF_IMMORTAL(result);
3193
3178
  }
3194
3179
  }
3195
3180
 
@@ -3211,10 +3196,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3211
3196
  }
3212
3197
  }
3213
3198
 
3214
- Py_DECREF(result);
3199
+ Py_DECREF_IMMORTAL(result);
3215
3200
  }
3216
3201
 
3217
- f = RICHCOMPARE(type2);
3202
+ f = TP_RICHCOMPARE(type2);
3218
3203
  if (f != NULL) {
3219
3204
  PyObject *result = (*f)(operand2, operand1, Py_LT);
3220
3205
 
@@ -3232,7 +3217,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3232
3217
  }
3233
3218
  }
3234
3219
 
3235
- Py_DECREF(result);
3220
+ Py_DECREF_IMMORTAL(result);
3236
3221
  }
3237
3222
 
3238
3223
  int c;
@@ -3327,7 +3312,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3327
3312
  richcmpfunc f;
3328
3313
 
3329
3314
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3330
- f = RICHCOMPARE(type2);
3315
+ f = TP_RICHCOMPARE(type2);
3331
3316
 
3332
3317
  if (f != NULL) {
3333
3318
  checked_reverse_op = true;
@@ -3348,7 +3333,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3348
3333
  }
3349
3334
  }
3350
3335
 
3351
- Py_DECREF(result);
3336
+ Py_DECREF_IMMORTAL(result);
3352
3337
  }
3353
3338
  }
3354
3339
 
@@ -3371,11 +3356,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3371
3356
  }
3372
3357
  }
3373
3358
 
3374
- Py_DECREF(result);
3359
+ Py_DECREF_IMMORTAL(result);
3375
3360
  }
3376
3361
 
3377
3362
  if (checked_reverse_op == false) {
3378
- f = RICHCOMPARE(type2);
3363
+ f = TP_RICHCOMPARE(type2);
3379
3364
 
3380
3365
  if (f != NULL) {
3381
3366
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -3394,7 +3379,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3394
3379
  }
3395
3380
  }
3396
3381
 
3397
- Py_DECREF(result);
3382
+ Py_DECREF_IMMORTAL(result);
3398
3383
  }
3399
3384
  }
3400
3385
 
@@ -3444,7 +3429,7 @@ static PyObject *COMPARE_GT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3444
3429
 
3445
3430
  // Convert to target type.
3446
3431
  PyObject *result = BOOL_FROM(r);
3447
- Py_INCREF(result);
3432
+ Py_INCREF_IMMORTAL(result);
3448
3433
  return result;
3449
3434
  }
3450
3435
 
@@ -3472,7 +3457,7 @@ static PyObject *COMPARE_GT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3472
3457
 
3473
3458
  // Convert to target type.
3474
3459
  PyObject *result = BOOL_FROM(c != 0);
3475
- Py_INCREF(result);
3460
+ Py_INCREF_IMMORTAL(result);
3476
3461
  return result;
3477
3462
  }
3478
3463
  /* Code referring to "OBJECT" corresponds to any Python object and "BYTES" to Python3 'bytes'. */
@@ -3509,7 +3494,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3509
3494
  return result;
3510
3495
  }
3511
3496
 
3512
- Py_DECREF(result);
3497
+ Py_DECREF_IMMORTAL(result);
3513
3498
  }
3514
3499
 
3515
3500
  // No rich comparison worked, but maybe compare works.
@@ -3550,7 +3535,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3550
3535
 
3551
3536
  bool r = c != 0;
3552
3537
  PyObject *result = BOOL_FROM(r);
3553
- Py_INCREF(result);
3538
+ Py_INCREF_IMMORTAL(result);
3554
3539
  return result;
3555
3540
  }
3556
3541
  }
@@ -3570,11 +3555,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3570
3555
  return result;
3571
3556
  }
3572
3557
 
3573
- Py_DECREF(result);
3558
+ Py_DECREF_IMMORTAL(result);
3574
3559
  }
3575
3560
  }
3576
3561
 
3577
- f = RICHCOMPARE(type1);
3562
+ f = TP_RICHCOMPARE(type1);
3578
3563
  if (f != NULL) {
3579
3564
  PyObject *result = (*f)(operand1, operand2, Py_GT);
3580
3565
 
@@ -3584,7 +3569,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3584
3569
  return result;
3585
3570
  }
3586
3571
 
3587
- Py_DECREF(result);
3572
+ Py_DECREF_IMMORTAL(result);
3588
3573
  }
3589
3574
 
3590
3575
  f = PyBytes_Type.tp_richcompare;
@@ -3597,7 +3582,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3597
3582
  return result;
3598
3583
  }
3599
3584
 
3600
- Py_DECREF(result);
3585
+ Py_DECREF_IMMORTAL(result);
3601
3586
  }
3602
3587
 
3603
3588
  int c;
@@ -3685,7 +3670,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3685
3670
 
3686
3671
  bool r = c != 0;
3687
3672
  PyObject *result = BOOL_FROM(r);
3688
- Py_INCREF(result);
3673
+ Py_INCREF_IMMORTAL(result);
3689
3674
  return result;
3690
3675
  #else
3691
3676
  bool checked_reverse_op = false;
@@ -3705,11 +3690,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3705
3690
  return result;
3706
3691
  }
3707
3692
 
3708
- Py_DECREF(result);
3693
+ Py_DECREF_IMMORTAL(result);
3709
3694
  }
3710
3695
  }
3711
3696
 
3712
- f = RICHCOMPARE(type1);
3697
+ f = TP_RICHCOMPARE(type1);
3713
3698
 
3714
3699
  if (f != NULL) {
3715
3700
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -3720,7 +3705,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3720
3705
  return result;
3721
3706
  }
3722
3707
 
3723
- Py_DECREF(result);
3708
+ Py_DECREF_IMMORTAL(result);
3724
3709
  }
3725
3710
 
3726
3711
  if (checked_reverse_op == false) {
@@ -3735,7 +3720,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3735
3720
  return result;
3736
3721
  }
3737
3722
 
3738
- Py_DECREF(result);
3723
+ Py_DECREF_IMMORTAL(result);
3739
3724
  }
3740
3725
  }
3741
3726
 
@@ -3747,13 +3732,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3747
3732
  case Py_EQ: {
3748
3733
  bool r = operand1 == operand2;
3749
3734
  PyObject *result = BOOL_FROM(r);
3750
- Py_INCREF(result);
3735
+ Py_INCREF_IMMORTAL(result);
3751
3736
  return result;
3752
3737
  }
3753
3738
  case Py_NE: {
3754
3739
  bool r = operand1 != operand2;
3755
3740
  PyObject *result = BOOL_FROM(r);
3756
- Py_INCREF(result);
3741
+ Py_INCREF_IMMORTAL(result);
3757
3742
  return result;
3758
3743
  }
3759
3744
  default:
@@ -3803,7 +3788,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3803
3788
  return result;
3804
3789
  }
3805
3790
 
3806
- Py_DECREF(result);
3791
+ Py_DECREF_IMMORTAL(result);
3807
3792
  }
3808
3793
 
3809
3794
  // No rich comparison worked, but maybe compare works.
@@ -3844,7 +3829,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3844
3829
 
3845
3830
  bool r = c != 0;
3846
3831
  PyObject *result = BOOL_FROM(r);
3847
- Py_INCREF(result);
3832
+ Py_INCREF_IMMORTAL(result);
3848
3833
  return result;
3849
3834
  }
3850
3835
  }
@@ -3853,7 +3838,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3853
3838
  richcmpfunc f;
3854
3839
 
3855
3840
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
3856
- f = RICHCOMPARE(type2);
3841
+ f = TP_RICHCOMPARE(type2);
3857
3842
 
3858
3843
  if (f != NULL) {
3859
3844
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -3864,7 +3849,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3864
3849
  return result;
3865
3850
  }
3866
3851
 
3867
- Py_DECREF(result);
3852
+ Py_DECREF_IMMORTAL(result);
3868
3853
  }
3869
3854
  }
3870
3855
 
@@ -3878,10 +3863,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3878
3863
  return result;
3879
3864
  }
3880
3865
 
3881
- Py_DECREF(result);
3866
+ Py_DECREF_IMMORTAL(result);
3882
3867
  }
3883
3868
 
3884
- f = RICHCOMPARE(type2);
3869
+ f = TP_RICHCOMPARE(type2);
3885
3870
  if (f != NULL) {
3886
3871
  PyObject *result = (*f)(operand2, operand1, Py_LT);
3887
3872
 
@@ -3891,7 +3876,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3891
3876
  return result;
3892
3877
  }
3893
3878
 
3894
- Py_DECREF(result);
3879
+ Py_DECREF_IMMORTAL(result);
3895
3880
  }
3896
3881
 
3897
3882
  int c;
@@ -3979,14 +3964,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3979
3964
 
3980
3965
  bool r = c != 0;
3981
3966
  PyObject *result = BOOL_FROM(r);
3982
- Py_INCREF(result);
3967
+ Py_INCREF_IMMORTAL(result);
3983
3968
  return result;
3984
3969
  #else
3985
3970
  bool checked_reverse_op = false;
3986
3971
  richcmpfunc f;
3987
3972
 
3988
3973
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
3989
- f = RICHCOMPARE(type2);
3974
+ f = TP_RICHCOMPARE(type2);
3990
3975
 
3991
3976
  if (f != NULL) {
3992
3977
  checked_reverse_op = true;
@@ -3999,7 +3984,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3999
3984
  return result;
4000
3985
  }
4001
3986
 
4002
- Py_DECREF(result);
3987
+ Py_DECREF_IMMORTAL(result);
4003
3988
  }
4004
3989
  }
4005
3990
 
@@ -4014,11 +3999,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4014
3999
  return result;
4015
4000
  }
4016
4001
 
4017
- Py_DECREF(result);
4002
+ Py_DECREF_IMMORTAL(result);
4018
4003
  }
4019
4004
 
4020
4005
  if (checked_reverse_op == false) {
4021
- f = RICHCOMPARE(type2);
4006
+ f = TP_RICHCOMPARE(type2);
4022
4007
 
4023
4008
  if (f != NULL) {
4024
4009
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -4029,7 +4014,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4029
4014
  return result;
4030
4015
  }
4031
4016
 
4032
- Py_DECREF(result);
4017
+ Py_DECREF_IMMORTAL(result);
4033
4018
  }
4034
4019
  }
4035
4020
 
@@ -4041,13 +4026,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4041
4026
  case Py_EQ: {
4042
4027
  bool r = operand1 == operand2;
4043
4028
  PyObject *result = BOOL_FROM(r);
4044
- Py_INCREF(result);
4029
+ Py_INCREF_IMMORTAL(result);
4045
4030
  return result;
4046
4031
  }
4047
4032
  case Py_NE: {
4048
4033
  bool r = operand1 != operand2;
4049
4034
  PyObject *result = BOOL_FROM(r);
4050
- Py_INCREF(result);
4035
+ Py_INCREF_IMMORTAL(result);
4051
4036
  return result;
4052
4037
  }
4053
4038
  default:
@@ -4151,7 +4136,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4151
4136
  }
4152
4137
  }
4153
4138
 
4154
- Py_DECREF(result);
4139
+ Py_DECREF_IMMORTAL(result);
4155
4140
  }
4156
4141
 
4157
4142
  // No rich comparison worked, but maybe compare works.
@@ -4220,11 +4205,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4220
4205
  }
4221
4206
  }
4222
4207
 
4223
- Py_DECREF(result);
4208
+ Py_DECREF_IMMORTAL(result);
4224
4209
  }
4225
4210
  }
4226
4211
 
4227
- f = RICHCOMPARE(type1);
4212
+ f = TP_RICHCOMPARE(type1);
4228
4213
  if (f != NULL) {
4229
4214
  PyObject *result = (*f)(operand1, operand2, Py_GT);
4230
4215
 
@@ -4242,7 +4227,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4242
4227
  }
4243
4228
  }
4244
4229
 
4245
- Py_DECREF(result);
4230
+ Py_DECREF_IMMORTAL(result);
4246
4231
  }
4247
4232
 
4248
4233
  f = PyBytes_Type.tp_richcompare;
@@ -4263,7 +4248,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4263
4248
  }
4264
4249
  }
4265
4250
 
4266
- Py_DECREF(result);
4251
+ Py_DECREF_IMMORTAL(result);
4267
4252
  }
4268
4253
 
4269
4254
  int c;
@@ -4379,11 +4364,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4379
4364
  }
4380
4365
  }
4381
4366
 
4382
- Py_DECREF(result);
4367
+ Py_DECREF_IMMORTAL(result);
4383
4368
  }
4384
4369
  }
4385
4370
 
4386
- f = RICHCOMPARE(type1);
4371
+ f = TP_RICHCOMPARE(type1);
4387
4372
 
4388
4373
  if (f != NULL) {
4389
4374
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -4402,7 +4387,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4402
4387
  }
4403
4388
  }
4404
4389
 
4405
- Py_DECREF(result);
4390
+ Py_DECREF_IMMORTAL(result);
4406
4391
  }
4407
4392
 
4408
4393
  if (checked_reverse_op == false) {
@@ -4425,7 +4410,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4425
4410
  }
4426
4411
  }
4427
4412
 
4428
- Py_DECREF(result);
4413
+ Py_DECREF_IMMORTAL(result);
4429
4414
  }
4430
4415
  }
4431
4416
 
@@ -4501,7 +4486,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4501
4486
  }
4502
4487
  }
4503
4488
 
4504
- Py_DECREF(result);
4489
+ Py_DECREF_IMMORTAL(result);
4505
4490
  }
4506
4491
 
4507
4492
  // No rich comparison worked, but maybe compare works.
@@ -4551,7 +4536,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4551
4536
  richcmpfunc f;
4552
4537
 
4553
4538
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4554
- f = RICHCOMPARE(type2);
4539
+ f = TP_RICHCOMPARE(type2);
4555
4540
 
4556
4541
  if (f != NULL) {
4557
4542
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -4570,7 +4555,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4570
4555
  }
4571
4556
  }
4572
4557
 
4573
- Py_DECREF(result);
4558
+ Py_DECREF_IMMORTAL(result);
4574
4559
  }
4575
4560
  }
4576
4561
 
@@ -4592,10 +4577,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4592
4577
  }
4593
4578
  }
4594
4579
 
4595
- Py_DECREF(result);
4580
+ Py_DECREF_IMMORTAL(result);
4596
4581
  }
4597
4582
 
4598
- f = RICHCOMPARE(type2);
4583
+ f = TP_RICHCOMPARE(type2);
4599
4584
  if (f != NULL) {
4600
4585
  PyObject *result = (*f)(operand2, operand1, Py_LT);
4601
4586
 
@@ -4613,7 +4598,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4613
4598
  }
4614
4599
  }
4615
4600
 
4616
- Py_DECREF(result);
4601
+ Py_DECREF_IMMORTAL(result);
4617
4602
  }
4618
4603
 
4619
4604
  int c;
@@ -4708,7 +4693,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4708
4693
  richcmpfunc f;
4709
4694
 
4710
4695
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4711
- f = RICHCOMPARE(type2);
4696
+ f = TP_RICHCOMPARE(type2);
4712
4697
 
4713
4698
  if (f != NULL) {
4714
4699
  checked_reverse_op = true;
@@ -4729,7 +4714,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4729
4714
  }
4730
4715
  }
4731
4716
 
4732
- Py_DECREF(result);
4717
+ Py_DECREF_IMMORTAL(result);
4733
4718
  }
4734
4719
  }
4735
4720
 
@@ -4752,11 +4737,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4752
4737
  }
4753
4738
  }
4754
4739
 
4755
- Py_DECREF(result);
4740
+ Py_DECREF_IMMORTAL(result);
4756
4741
  }
4757
4742
 
4758
4743
  if (checked_reverse_op == false) {
4759
- f = RICHCOMPARE(type2);
4744
+ f = TP_RICHCOMPARE(type2);
4760
4745
 
4761
4746
  if (f != NULL) {
4762
4747
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -4775,7 +4760,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4775
4760
  }
4776
4761
  }
4777
4762
 
4778
- Py_DECREF(result);
4763
+ Py_DECREF_IMMORTAL(result);
4779
4764
  }
4780
4765
  }
4781
4766
 
@@ -4843,7 +4828,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4843
4828
  return result;
4844
4829
  }
4845
4830
 
4846
- Py_DECREF(result);
4831
+ Py_DECREF_IMMORTAL(result);
4847
4832
  }
4848
4833
 
4849
4834
  // No rich comparison worked, but maybe compare works.
@@ -4884,7 +4869,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4884
4869
 
4885
4870
  bool r = c != 0;
4886
4871
  PyObject *result = BOOL_FROM(r);
4887
- Py_INCREF(result);
4872
+ Py_INCREF_IMMORTAL(result);
4888
4873
  return result;
4889
4874
  }
4890
4875
  }
@@ -4904,11 +4889,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4904
4889
  return result;
4905
4890
  }
4906
4891
 
4907
- Py_DECREF(result);
4892
+ Py_DECREF_IMMORTAL(result);
4908
4893
  }
4909
4894
  }
4910
4895
 
4911
- f = RICHCOMPARE(type1);
4896
+ f = TP_RICHCOMPARE(type1);
4912
4897
  if (f != NULL) {
4913
4898
  PyObject *result = (*f)(operand1, operand2, Py_GT);
4914
4899
 
@@ -4918,7 +4903,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4918
4903
  return result;
4919
4904
  }
4920
4905
 
4921
- Py_DECREF(result);
4906
+ Py_DECREF_IMMORTAL(result);
4922
4907
  }
4923
4908
 
4924
4909
  f = NULL;
@@ -4931,7 +4916,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4931
4916
  return result;
4932
4917
  }
4933
4918
 
4934
- Py_DECREF(result);
4919
+ Py_DECREF_IMMORTAL(result);
4935
4920
  }
4936
4921
 
4937
4922
  int c;
@@ -5019,7 +5004,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5019
5004
 
5020
5005
  bool r = c != 0;
5021
5006
  PyObject *result = BOOL_FROM(r);
5022
- Py_INCREF(result);
5007
+ Py_INCREF_IMMORTAL(result);
5023
5008
  return result;
5024
5009
  #else
5025
5010
  bool checked_reverse_op = false;
@@ -5039,11 +5024,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5039
5024
  return result;
5040
5025
  }
5041
5026
 
5042
- Py_DECREF(result);
5027
+ Py_DECREF_IMMORTAL(result);
5043
5028
  }
5044
5029
  }
5045
5030
 
5046
- f = RICHCOMPARE(type1);
5031
+ f = TP_RICHCOMPARE(type1);
5047
5032
 
5048
5033
  if (f != NULL) {
5049
5034
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -5054,7 +5039,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5054
5039
  return result;
5055
5040
  }
5056
5041
 
5057
- Py_DECREF(result);
5042
+ Py_DECREF_IMMORTAL(result);
5058
5043
  }
5059
5044
 
5060
5045
  if (checked_reverse_op == false) {
@@ -5069,7 +5054,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5069
5054
  return result;
5070
5055
  }
5071
5056
 
5072
- Py_DECREF(result);
5057
+ Py_DECREF_IMMORTAL(result);
5073
5058
  }
5074
5059
  }
5075
5060
 
@@ -5081,13 +5066,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5081
5066
  case Py_EQ: {
5082
5067
  bool r = operand1 == operand2;
5083
5068
  PyObject *result = BOOL_FROM(r);
5084
- Py_INCREF(result);
5069
+ Py_INCREF_IMMORTAL(result);
5085
5070
  return result;
5086
5071
  }
5087
5072
  case Py_NE: {
5088
5073
  bool r = operand1 != operand2;
5089
5074
  PyObject *result = BOOL_FROM(r);
5090
- Py_INCREF(result);
5075
+ Py_INCREF_IMMORTAL(result);
5091
5076
  return result;
5092
5077
  }
5093
5078
  default:
@@ -5137,7 +5122,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5137
5122
  return result;
5138
5123
  }
5139
5124
 
5140
- Py_DECREF(result);
5125
+ Py_DECREF_IMMORTAL(result);
5141
5126
  }
5142
5127
 
5143
5128
  // No rich comparison worked, but maybe compare works.
@@ -5178,7 +5163,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5178
5163
 
5179
5164
  bool r = c != 0;
5180
5165
  PyObject *result = BOOL_FROM(r);
5181
- Py_INCREF(result);
5166
+ Py_INCREF_IMMORTAL(result);
5182
5167
  return result;
5183
5168
  }
5184
5169
  }
@@ -5187,7 +5172,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5187
5172
  richcmpfunc f;
5188
5173
 
5189
5174
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5190
- f = RICHCOMPARE(type2);
5175
+ f = TP_RICHCOMPARE(type2);
5191
5176
 
5192
5177
  if (f != NULL) {
5193
5178
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -5198,7 +5183,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5198
5183
  return result;
5199
5184
  }
5200
5185
 
5201
- Py_DECREF(result);
5186
+ Py_DECREF_IMMORTAL(result);
5202
5187
  }
5203
5188
  }
5204
5189
 
@@ -5212,10 +5197,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5212
5197
  return result;
5213
5198
  }
5214
5199
 
5215
- Py_DECREF(result);
5200
+ Py_DECREF_IMMORTAL(result);
5216
5201
  }
5217
5202
 
5218
- f = RICHCOMPARE(type2);
5203
+ f = TP_RICHCOMPARE(type2);
5219
5204
  if (f != NULL) {
5220
5205
  PyObject *result = (*f)(operand2, operand1, Py_LT);
5221
5206
 
@@ -5225,7 +5210,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5225
5210
  return result;
5226
5211
  }
5227
5212
 
5228
- Py_DECREF(result);
5213
+ Py_DECREF_IMMORTAL(result);
5229
5214
  }
5230
5215
 
5231
5216
  int c;
@@ -5313,14 +5298,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5313
5298
 
5314
5299
  bool r = c != 0;
5315
5300
  PyObject *result = BOOL_FROM(r);
5316
- Py_INCREF(result);
5301
+ Py_INCREF_IMMORTAL(result);
5317
5302
  return result;
5318
5303
  #else
5319
5304
  bool checked_reverse_op = false;
5320
5305
  richcmpfunc f;
5321
5306
 
5322
5307
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5323
- f = RICHCOMPARE(type2);
5308
+ f = TP_RICHCOMPARE(type2);
5324
5309
 
5325
5310
  if (f != NULL) {
5326
5311
  checked_reverse_op = true;
@@ -5333,7 +5318,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5333
5318
  return result;
5334
5319
  }
5335
5320
 
5336
- Py_DECREF(result);
5321
+ Py_DECREF_IMMORTAL(result);
5337
5322
  }
5338
5323
  }
5339
5324
 
@@ -5348,11 +5333,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5348
5333
  return result;
5349
5334
  }
5350
5335
 
5351
- Py_DECREF(result);
5336
+ Py_DECREF_IMMORTAL(result);
5352
5337
  }
5353
5338
 
5354
5339
  if (checked_reverse_op == false) {
5355
- f = RICHCOMPARE(type2);
5340
+ f = TP_RICHCOMPARE(type2);
5356
5341
 
5357
5342
  if (f != NULL) {
5358
5343
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -5363,7 +5348,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5363
5348
  return result;
5364
5349
  }
5365
5350
 
5366
- Py_DECREF(result);
5351
+ Py_DECREF_IMMORTAL(result);
5367
5352
  }
5368
5353
  }
5369
5354
 
@@ -5375,13 +5360,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5375
5360
  case Py_EQ: {
5376
5361
  bool r = operand1 == operand2;
5377
5362
  PyObject *result = BOOL_FROM(r);
5378
- Py_INCREF(result);
5363
+ Py_INCREF_IMMORTAL(result);
5379
5364
  return result;
5380
5365
  }
5381
5366
  case Py_NE: {
5382
5367
  bool r = operand1 != operand2;
5383
5368
  PyObject *result = BOOL_FROM(r);
5384
- Py_INCREF(result);
5369
+ Py_INCREF_IMMORTAL(result);
5385
5370
  return result;
5386
5371
  }
5387
5372
  default:
@@ -5439,7 +5424,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5439
5424
  }
5440
5425
  }
5441
5426
 
5442
- Py_DECREF(result);
5427
+ Py_DECREF_IMMORTAL(result);
5443
5428
  }
5444
5429
 
5445
5430
  // No rich comparison worked, but maybe compare works.
@@ -5508,11 +5493,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5508
5493
  }
5509
5494
  }
5510
5495
 
5511
- Py_DECREF(result);
5496
+ Py_DECREF_IMMORTAL(result);
5512
5497
  }
5513
5498
  }
5514
5499
 
5515
- f = RICHCOMPARE(type1);
5500
+ f = TP_RICHCOMPARE(type1);
5516
5501
  if (f != NULL) {
5517
5502
  PyObject *result = (*f)(operand1, operand2, Py_GT);
5518
5503
 
@@ -5530,7 +5515,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5530
5515
  }
5531
5516
  }
5532
5517
 
5533
- Py_DECREF(result);
5518
+ Py_DECREF_IMMORTAL(result);
5534
5519
  }
5535
5520
 
5536
5521
  f = NULL;
@@ -5551,7 +5536,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5551
5536
  }
5552
5537
  }
5553
5538
 
5554
- Py_DECREF(result);
5539
+ Py_DECREF_IMMORTAL(result);
5555
5540
  }
5556
5541
 
5557
5542
  int c;
@@ -5667,11 +5652,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5667
5652
  }
5668
5653
  }
5669
5654
 
5670
- Py_DECREF(result);
5655
+ Py_DECREF_IMMORTAL(result);
5671
5656
  }
5672
5657
  }
5673
5658
 
5674
- f = RICHCOMPARE(type1);
5659
+ f = TP_RICHCOMPARE(type1);
5675
5660
 
5676
5661
  if (f != NULL) {
5677
5662
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -5690,7 +5675,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5690
5675
  }
5691
5676
  }
5692
5677
 
5693
- Py_DECREF(result);
5678
+ Py_DECREF_IMMORTAL(result);
5694
5679
  }
5695
5680
 
5696
5681
  if (checked_reverse_op == false) {
@@ -5713,7 +5698,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5713
5698
  }
5714
5699
  }
5715
5700
 
5716
- Py_DECREF(result);
5701
+ Py_DECREF_IMMORTAL(result);
5717
5702
  }
5718
5703
  }
5719
5704
 
@@ -5789,7 +5774,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5789
5774
  }
5790
5775
  }
5791
5776
 
5792
- Py_DECREF(result);
5777
+ Py_DECREF_IMMORTAL(result);
5793
5778
  }
5794
5779
 
5795
5780
  // No rich comparison worked, but maybe compare works.
@@ -5839,7 +5824,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5839
5824
  richcmpfunc f;
5840
5825
 
5841
5826
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5842
- f = RICHCOMPARE(type2);
5827
+ f = TP_RICHCOMPARE(type2);
5843
5828
 
5844
5829
  if (f != NULL) {
5845
5830
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -5858,7 +5843,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5858
5843
  }
5859
5844
  }
5860
5845
 
5861
- Py_DECREF(result);
5846
+ Py_DECREF_IMMORTAL(result);
5862
5847
  }
5863
5848
  }
5864
5849
 
@@ -5880,10 +5865,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5880
5865
  }
5881
5866
  }
5882
5867
 
5883
- Py_DECREF(result);
5868
+ Py_DECREF_IMMORTAL(result);
5884
5869
  }
5885
5870
 
5886
- f = RICHCOMPARE(type2);
5871
+ f = TP_RICHCOMPARE(type2);
5887
5872
  if (f != NULL) {
5888
5873
  PyObject *result = (*f)(operand2, operand1, Py_LT);
5889
5874
 
@@ -5901,7 +5886,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5901
5886
  }
5902
5887
  }
5903
5888
 
5904
- Py_DECREF(result);
5889
+ Py_DECREF_IMMORTAL(result);
5905
5890
  }
5906
5891
 
5907
5892
  int c;
@@ -5996,7 +5981,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5996
5981
  richcmpfunc f;
5997
5982
 
5998
5983
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5999
- f = RICHCOMPARE(type2);
5984
+ f = TP_RICHCOMPARE(type2);
6000
5985
 
6001
5986
  if (f != NULL) {
6002
5987
  checked_reverse_op = true;
@@ -6017,7 +6002,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6017
6002
  }
6018
6003
  }
6019
6004
 
6020
- Py_DECREF(result);
6005
+ Py_DECREF_IMMORTAL(result);
6021
6006
  }
6022
6007
  }
6023
6008
 
@@ -6040,11 +6025,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6040
6025
  }
6041
6026
  }
6042
6027
 
6043
- Py_DECREF(result);
6028
+ Py_DECREF_IMMORTAL(result);
6044
6029
  }
6045
6030
 
6046
6031
  if (checked_reverse_op == false) {
6047
- f = RICHCOMPARE(type2);
6032
+ f = TP_RICHCOMPARE(type2);
6048
6033
 
6049
6034
  if (f != NULL) {
6050
6035
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -6063,7 +6048,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6063
6048
  }
6064
6049
  }
6065
6050
 
6066
- Py_DECREF(result);
6051
+ Py_DECREF_IMMORTAL(result);
6067
6052
  }
6068
6053
  }
6069
6054
 
@@ -6110,15 +6095,19 @@ static PyObject *COMPARE_GT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6110
6095
 
6111
6096
  if (operand1_long_object == operand2_long_object) {
6112
6097
  r = false;
6113
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6114
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) > 0;
6098
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6099
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6100
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) >
6101
+ 0;
6115
6102
  } else {
6116
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6103
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6117
6104
  r = false;
6118
6105
  while (--i >= 0) {
6119
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6120
- r = operand1_long_object->ob_digit[i] > operand2_long_object->ob_digit[i];
6121
- if (Py_SIZE(operand1_long_object) < 0) {
6106
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6107
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6108
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] >
6109
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6110
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6122
6111
  r = !r;
6123
6112
  }
6124
6113
  break;
@@ -6128,7 +6117,7 @@ static PyObject *COMPARE_GT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6128
6117
 
6129
6118
  // Convert to target type.
6130
6119
  PyObject *result = BOOL_FROM(r);
6131
- Py_INCREF(result);
6120
+ Py_INCREF_IMMORTAL(result);
6132
6121
  return result;
6133
6122
  }
6134
6123
  /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
@@ -6165,7 +6154,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6165
6154
  return result;
6166
6155
  }
6167
6156
 
6168
- Py_DECREF(result);
6157
+ Py_DECREF_IMMORTAL(result);
6169
6158
  }
6170
6159
 
6171
6160
  // No rich comparison worked, but maybe compare works.
@@ -6206,7 +6195,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6206
6195
 
6207
6196
  bool r = c != 0;
6208
6197
  PyObject *result = BOOL_FROM(r);
6209
- Py_INCREF(result);
6198
+ Py_INCREF_IMMORTAL(result);
6210
6199
  return result;
6211
6200
  }
6212
6201
  }
@@ -6226,11 +6215,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6226
6215
  return result;
6227
6216
  }
6228
6217
 
6229
- Py_DECREF(result);
6218
+ Py_DECREF_IMMORTAL(result);
6230
6219
  }
6231
6220
  }
6232
6221
 
6233
- f = RICHCOMPARE(type1);
6222
+ f = TP_RICHCOMPARE(type1);
6234
6223
  if (f != NULL) {
6235
6224
  PyObject *result = (*f)(operand1, operand2, Py_GT);
6236
6225
 
@@ -6240,7 +6229,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6240
6229
  return result;
6241
6230
  }
6242
6231
 
6243
- Py_DECREF(result);
6232
+ Py_DECREF_IMMORTAL(result);
6244
6233
  }
6245
6234
 
6246
6235
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6253,7 +6242,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6253
6242
  return result;
6254
6243
  }
6255
6244
 
6256
- Py_DECREF(result);
6245
+ Py_DECREF_IMMORTAL(result);
6257
6246
  }
6258
6247
 
6259
6248
  int c;
@@ -6341,7 +6330,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6341
6330
 
6342
6331
  bool r = c != 0;
6343
6332
  PyObject *result = BOOL_FROM(r);
6344
- Py_INCREF(result);
6333
+ Py_INCREF_IMMORTAL(result);
6345
6334
  return result;
6346
6335
  #else
6347
6336
  bool checked_reverse_op = false;
@@ -6361,11 +6350,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6361
6350
  return result;
6362
6351
  }
6363
6352
 
6364
- Py_DECREF(result);
6353
+ Py_DECREF_IMMORTAL(result);
6365
6354
  }
6366
6355
  }
6367
6356
 
6368
- f = RICHCOMPARE(type1);
6357
+ f = TP_RICHCOMPARE(type1);
6369
6358
 
6370
6359
  if (f != NULL) {
6371
6360
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -6376,7 +6365,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6376
6365
  return result;
6377
6366
  }
6378
6367
 
6379
- Py_DECREF(result);
6368
+ Py_DECREF_IMMORTAL(result);
6380
6369
  }
6381
6370
 
6382
6371
  if (checked_reverse_op == false) {
@@ -6391,7 +6380,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6391
6380
  return result;
6392
6381
  }
6393
6382
 
6394
- Py_DECREF(result);
6383
+ Py_DECREF_IMMORTAL(result);
6395
6384
  }
6396
6385
  }
6397
6386
 
@@ -6403,13 +6392,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6403
6392
  case Py_EQ: {
6404
6393
  bool r = operand1 == operand2;
6405
6394
  PyObject *result = BOOL_FROM(r);
6406
- Py_INCREF(result);
6395
+ Py_INCREF_IMMORTAL(result);
6407
6396
  return result;
6408
6397
  }
6409
6398
  case Py_NE: {
6410
6399
  bool r = operand1 != operand2;
6411
6400
  PyObject *result = BOOL_FROM(r);
6412
- Py_INCREF(result);
6401
+ Py_INCREF_IMMORTAL(result);
6413
6402
  return result;
6414
6403
  }
6415
6404
  default:
@@ -6459,7 +6448,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6459
6448
  return result;
6460
6449
  }
6461
6450
 
6462
- Py_DECREF(result);
6451
+ Py_DECREF_IMMORTAL(result);
6463
6452
  }
6464
6453
 
6465
6454
  // No rich comparison worked, but maybe compare works.
@@ -6500,7 +6489,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6500
6489
 
6501
6490
  bool r = c != 0;
6502
6491
  PyObject *result = BOOL_FROM(r);
6503
- Py_INCREF(result);
6492
+ Py_INCREF_IMMORTAL(result);
6504
6493
  return result;
6505
6494
  }
6506
6495
  }
@@ -6509,7 +6498,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6509
6498
  richcmpfunc f;
6510
6499
 
6511
6500
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6512
- f = RICHCOMPARE(type2);
6501
+ f = TP_RICHCOMPARE(type2);
6513
6502
 
6514
6503
  if (f != NULL) {
6515
6504
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -6520,7 +6509,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6520
6509
  return result;
6521
6510
  }
6522
6511
 
6523
- Py_DECREF(result);
6512
+ Py_DECREF_IMMORTAL(result);
6524
6513
  }
6525
6514
  }
6526
6515
 
@@ -6534,10 +6523,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6534
6523
  return result;
6535
6524
  }
6536
6525
 
6537
- Py_DECREF(result);
6526
+ Py_DECREF_IMMORTAL(result);
6538
6527
  }
6539
6528
 
6540
- f = RICHCOMPARE(type2);
6529
+ f = TP_RICHCOMPARE(type2);
6541
6530
  if (f != NULL) {
6542
6531
  PyObject *result = (*f)(operand2, operand1, Py_LT);
6543
6532
 
@@ -6547,7 +6536,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6547
6536
  return result;
6548
6537
  }
6549
6538
 
6550
- Py_DECREF(result);
6539
+ Py_DECREF_IMMORTAL(result);
6551
6540
  }
6552
6541
 
6553
6542
  int c;
@@ -6635,14 +6624,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6635
6624
 
6636
6625
  bool r = c != 0;
6637
6626
  PyObject *result = BOOL_FROM(r);
6638
- Py_INCREF(result);
6627
+ Py_INCREF_IMMORTAL(result);
6639
6628
  return result;
6640
6629
  #else
6641
6630
  bool checked_reverse_op = false;
6642
6631
  richcmpfunc f;
6643
6632
 
6644
6633
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6645
- f = RICHCOMPARE(type2);
6634
+ f = TP_RICHCOMPARE(type2);
6646
6635
 
6647
6636
  if (f != NULL) {
6648
6637
  checked_reverse_op = true;
@@ -6655,7 +6644,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6655
6644
  return result;
6656
6645
  }
6657
6646
 
6658
- Py_DECREF(result);
6647
+ Py_DECREF_IMMORTAL(result);
6659
6648
  }
6660
6649
  }
6661
6650
 
@@ -6670,11 +6659,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6670
6659
  return result;
6671
6660
  }
6672
6661
 
6673
- Py_DECREF(result);
6662
+ Py_DECREF_IMMORTAL(result);
6674
6663
  }
6675
6664
 
6676
6665
  if (checked_reverse_op == false) {
6677
- f = RICHCOMPARE(type2);
6666
+ f = TP_RICHCOMPARE(type2);
6678
6667
 
6679
6668
  if (f != NULL) {
6680
6669
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -6685,7 +6674,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6685
6674
  return result;
6686
6675
  }
6687
6676
 
6688
- Py_DECREF(result);
6677
+ Py_DECREF_IMMORTAL(result);
6689
6678
  }
6690
6679
  }
6691
6680
 
@@ -6697,13 +6686,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6697
6686
  case Py_EQ: {
6698
6687
  bool r = operand1 == operand2;
6699
6688
  PyObject *result = BOOL_FROM(r);
6700
- Py_INCREF(result);
6689
+ Py_INCREF_IMMORTAL(result);
6701
6690
  return result;
6702
6691
  }
6703
6692
  case Py_NE: {
6704
6693
  bool r = operand1 != operand2;
6705
6694
  PyObject *result = BOOL_FROM(r);
6706
- Py_INCREF(result);
6695
+ Py_INCREF_IMMORTAL(result);
6707
6696
  return result;
6708
6697
  }
6709
6698
  default:
@@ -6733,15 +6722,19 @@ static bool COMPARE_GT_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
6733
6722
 
6734
6723
  if (operand1_long_object == operand2_long_object) {
6735
6724
  r = false;
6736
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6737
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) > 0;
6725
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6726
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6727
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) >
6728
+ 0;
6738
6729
  } else {
6739
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6730
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6740
6731
  r = false;
6741
6732
  while (--i >= 0) {
6742
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6743
- r = operand1_long_object->ob_digit[i] > operand2_long_object->ob_digit[i];
6744
- if (Py_SIZE(operand1_long_object) < 0) {
6733
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6734
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6735
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] >
6736
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6737
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6745
6738
  r = !r;
6746
6739
  }
6747
6740
  break;
@@ -6796,7 +6789,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6796
6789
  }
6797
6790
  }
6798
6791
 
6799
- Py_DECREF(result);
6792
+ Py_DECREF_IMMORTAL(result);
6800
6793
  }
6801
6794
 
6802
6795
  // No rich comparison worked, but maybe compare works.
@@ -6865,11 +6858,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6865
6858
  }
6866
6859
  }
6867
6860
 
6868
- Py_DECREF(result);
6861
+ Py_DECREF_IMMORTAL(result);
6869
6862
  }
6870
6863
  }
6871
6864
 
6872
- f = RICHCOMPARE(type1);
6865
+ f = TP_RICHCOMPARE(type1);
6873
6866
  if (f != NULL) {
6874
6867
  PyObject *result = (*f)(operand1, operand2, Py_GT);
6875
6868
 
@@ -6887,7 +6880,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6887
6880
  }
6888
6881
  }
6889
6882
 
6890
- Py_DECREF(result);
6883
+ Py_DECREF_IMMORTAL(result);
6891
6884
  }
6892
6885
 
6893
6886
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6908,7 +6901,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6908
6901
  }
6909
6902
  }
6910
6903
 
6911
- Py_DECREF(result);
6904
+ Py_DECREF_IMMORTAL(result);
6912
6905
  }
6913
6906
 
6914
6907
  int c;
@@ -7024,11 +7017,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7024
7017
  }
7025
7018
  }
7026
7019
 
7027
- Py_DECREF(result);
7020
+ Py_DECREF_IMMORTAL(result);
7028
7021
  }
7029
7022
  }
7030
7023
 
7031
- f = RICHCOMPARE(type1);
7024
+ f = TP_RICHCOMPARE(type1);
7032
7025
 
7033
7026
  if (f != NULL) {
7034
7027
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -7047,7 +7040,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7047
7040
  }
7048
7041
  }
7049
7042
 
7050
- Py_DECREF(result);
7043
+ Py_DECREF_IMMORTAL(result);
7051
7044
  }
7052
7045
 
7053
7046
  if (checked_reverse_op == false) {
@@ -7070,7 +7063,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7070
7063
  }
7071
7064
  }
7072
7065
 
7073
- Py_DECREF(result);
7066
+ Py_DECREF_IMMORTAL(result);
7074
7067
  }
7075
7068
  }
7076
7069
 
@@ -7146,7 +7139,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7146
7139
  }
7147
7140
  }
7148
7141
 
7149
- Py_DECREF(result);
7142
+ Py_DECREF_IMMORTAL(result);
7150
7143
  }
7151
7144
 
7152
7145
  // No rich comparison worked, but maybe compare works.
@@ -7196,7 +7189,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7196
7189
  richcmpfunc f;
7197
7190
 
7198
7191
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7199
- f = RICHCOMPARE(type2);
7192
+ f = TP_RICHCOMPARE(type2);
7200
7193
 
7201
7194
  if (f != NULL) {
7202
7195
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -7215,7 +7208,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7215
7208
  }
7216
7209
  }
7217
7210
 
7218
- Py_DECREF(result);
7211
+ Py_DECREF_IMMORTAL(result);
7219
7212
  }
7220
7213
  }
7221
7214
 
@@ -7237,10 +7230,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7237
7230
  }
7238
7231
  }
7239
7232
 
7240
- Py_DECREF(result);
7233
+ Py_DECREF_IMMORTAL(result);
7241
7234
  }
7242
7235
 
7243
- f = RICHCOMPARE(type2);
7236
+ f = TP_RICHCOMPARE(type2);
7244
7237
  if (f != NULL) {
7245
7238
  PyObject *result = (*f)(operand2, operand1, Py_LT);
7246
7239
 
@@ -7258,7 +7251,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7258
7251
  }
7259
7252
  }
7260
7253
 
7261
- Py_DECREF(result);
7254
+ Py_DECREF_IMMORTAL(result);
7262
7255
  }
7263
7256
 
7264
7257
  int c;
@@ -7353,7 +7346,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7353
7346
  richcmpfunc f;
7354
7347
 
7355
7348
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7356
- f = RICHCOMPARE(type2);
7349
+ f = TP_RICHCOMPARE(type2);
7357
7350
 
7358
7351
  if (f != NULL) {
7359
7352
  checked_reverse_op = true;
@@ -7374,7 +7367,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7374
7367
  }
7375
7368
  }
7376
7369
 
7377
- Py_DECREF(result);
7370
+ Py_DECREF_IMMORTAL(result);
7378
7371
  }
7379
7372
  }
7380
7373
 
@@ -7397,11 +7390,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7397
7390
  }
7398
7391
  }
7399
7392
 
7400
- Py_DECREF(result);
7393
+ Py_DECREF_IMMORTAL(result);
7401
7394
  }
7402
7395
 
7403
7396
  if (checked_reverse_op == false) {
7404
- f = RICHCOMPARE(type2);
7397
+ f = TP_RICHCOMPARE(type2);
7405
7398
 
7406
7399
  if (f != NULL) {
7407
7400
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -7420,7 +7413,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7420
7413
  }
7421
7414
  }
7422
7415
 
7423
- Py_DECREF(result);
7416
+ Py_DECREF_IMMORTAL(result);
7424
7417
  }
7425
7418
  }
7426
7419
 
@@ -7467,7 +7460,7 @@ static PyObject *COMPARE_GT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *ope
7467
7460
 
7468
7461
  // Convert to target type.
7469
7462
  PyObject *result = BOOL_FROM(r);
7470
- Py_INCREF(result);
7463
+ Py_INCREF_IMMORTAL(result);
7471
7464
  return result;
7472
7465
  }
7473
7466
  /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
@@ -7504,7 +7497,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7504
7497
  return result;
7505
7498
  }
7506
7499
 
7507
- Py_DECREF(result);
7500
+ Py_DECREF_IMMORTAL(result);
7508
7501
  }
7509
7502
 
7510
7503
  // No rich comparison worked, but maybe compare works.
@@ -7545,7 +7538,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7545
7538
 
7546
7539
  bool r = c != 0;
7547
7540
  PyObject *result = BOOL_FROM(r);
7548
- Py_INCREF(result);
7541
+ Py_INCREF_IMMORTAL(result);
7549
7542
  return result;
7550
7543
  }
7551
7544
  }
@@ -7565,11 +7558,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7565
7558
  return result;
7566
7559
  }
7567
7560
 
7568
- Py_DECREF(result);
7561
+ Py_DECREF_IMMORTAL(result);
7569
7562
  }
7570
7563
  }
7571
7564
 
7572
- f = RICHCOMPARE(type1);
7565
+ f = TP_RICHCOMPARE(type1);
7573
7566
  if (f != NULL) {
7574
7567
  PyObject *result = (*f)(operand1, operand2, Py_GT);
7575
7568
 
@@ -7579,7 +7572,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7579
7572
  return result;
7580
7573
  }
7581
7574
 
7582
- Py_DECREF(result);
7575
+ Py_DECREF_IMMORTAL(result);
7583
7576
  }
7584
7577
 
7585
7578
  f = PyFloat_Type.tp_richcompare;
@@ -7592,7 +7585,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7592
7585
  return result;
7593
7586
  }
7594
7587
 
7595
- Py_DECREF(result);
7588
+ Py_DECREF_IMMORTAL(result);
7596
7589
  }
7597
7590
 
7598
7591
  int c;
@@ -7680,7 +7673,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7680
7673
 
7681
7674
  bool r = c != 0;
7682
7675
  PyObject *result = BOOL_FROM(r);
7683
- Py_INCREF(result);
7676
+ Py_INCREF_IMMORTAL(result);
7684
7677
  return result;
7685
7678
  #else
7686
7679
  bool checked_reverse_op = false;
@@ -7700,11 +7693,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7700
7693
  return result;
7701
7694
  }
7702
7695
 
7703
- Py_DECREF(result);
7696
+ Py_DECREF_IMMORTAL(result);
7704
7697
  }
7705
7698
  }
7706
7699
 
7707
- f = RICHCOMPARE(type1);
7700
+ f = TP_RICHCOMPARE(type1);
7708
7701
 
7709
7702
  if (f != NULL) {
7710
7703
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -7715,7 +7708,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7715
7708
  return result;
7716
7709
  }
7717
7710
 
7718
- Py_DECREF(result);
7711
+ Py_DECREF_IMMORTAL(result);
7719
7712
  }
7720
7713
 
7721
7714
  if (checked_reverse_op == false) {
@@ -7730,7 +7723,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7730
7723
  return result;
7731
7724
  }
7732
7725
 
7733
- Py_DECREF(result);
7726
+ Py_DECREF_IMMORTAL(result);
7734
7727
  }
7735
7728
  }
7736
7729
 
@@ -7742,13 +7735,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7742
7735
  case Py_EQ: {
7743
7736
  bool r = operand1 == operand2;
7744
7737
  PyObject *result = BOOL_FROM(r);
7745
- Py_INCREF(result);
7738
+ Py_INCREF_IMMORTAL(result);
7746
7739
  return result;
7747
7740
  }
7748
7741
  case Py_NE: {
7749
7742
  bool r = operand1 != operand2;
7750
7743
  PyObject *result = BOOL_FROM(r);
7751
- Py_INCREF(result);
7744
+ Py_INCREF_IMMORTAL(result);
7752
7745
  return result;
7753
7746
  }
7754
7747
  default:
@@ -7796,7 +7789,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7796
7789
  return result;
7797
7790
  }
7798
7791
 
7799
- Py_DECREF(result);
7792
+ Py_DECREF_IMMORTAL(result);
7800
7793
  }
7801
7794
 
7802
7795
  // No rich comparison worked, but maybe compare works.
@@ -7837,7 +7830,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7837
7830
 
7838
7831
  bool r = c != 0;
7839
7832
  PyObject *result = BOOL_FROM(r);
7840
- Py_INCREF(result);
7833
+ Py_INCREF_IMMORTAL(result);
7841
7834
  return result;
7842
7835
  }
7843
7836
  }
@@ -7846,7 +7839,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7846
7839
  richcmpfunc f;
7847
7840
 
7848
7841
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
7849
- f = RICHCOMPARE(type2);
7842
+ f = TP_RICHCOMPARE(type2);
7850
7843
 
7851
7844
  if (f != NULL) {
7852
7845
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -7857,7 +7850,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7857
7850
  return result;
7858
7851
  }
7859
7852
 
7860
- Py_DECREF(result);
7853
+ Py_DECREF_IMMORTAL(result);
7861
7854
  }
7862
7855
  }
7863
7856
 
@@ -7871,10 +7864,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7871
7864
  return result;
7872
7865
  }
7873
7866
 
7874
- Py_DECREF(result);
7867
+ Py_DECREF_IMMORTAL(result);
7875
7868
  }
7876
7869
 
7877
- f = RICHCOMPARE(type2);
7870
+ f = TP_RICHCOMPARE(type2);
7878
7871
  if (f != NULL) {
7879
7872
  PyObject *result = (*f)(operand2, operand1, Py_LT);
7880
7873
 
@@ -7884,7 +7877,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7884
7877
  return result;
7885
7878
  }
7886
7879
 
7887
- Py_DECREF(result);
7880
+ Py_DECREF_IMMORTAL(result);
7888
7881
  }
7889
7882
 
7890
7883
  int c;
@@ -7972,14 +7965,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7972
7965
 
7973
7966
  bool r = c != 0;
7974
7967
  PyObject *result = BOOL_FROM(r);
7975
- Py_INCREF(result);
7968
+ Py_INCREF_IMMORTAL(result);
7976
7969
  return result;
7977
7970
  #else
7978
7971
  bool checked_reverse_op = false;
7979
7972
  richcmpfunc f;
7980
7973
 
7981
7974
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
7982
- f = RICHCOMPARE(type2);
7975
+ f = TP_RICHCOMPARE(type2);
7983
7976
 
7984
7977
  if (f != NULL) {
7985
7978
  checked_reverse_op = true;
@@ -7992,7 +7985,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7992
7985
  return result;
7993
7986
  }
7994
7987
 
7995
- Py_DECREF(result);
7988
+ Py_DECREF_IMMORTAL(result);
7996
7989
  }
7997
7990
  }
7998
7991
 
@@ -8007,11 +8000,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8007
8000
  return result;
8008
8001
  }
8009
8002
 
8010
- Py_DECREF(result);
8003
+ Py_DECREF_IMMORTAL(result);
8011
8004
  }
8012
8005
 
8013
8006
  if (checked_reverse_op == false) {
8014
- f = RICHCOMPARE(type2);
8007
+ f = TP_RICHCOMPARE(type2);
8015
8008
 
8016
8009
  if (f != NULL) {
8017
8010
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -8022,7 +8015,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8022
8015
  return result;
8023
8016
  }
8024
8017
 
8025
- Py_DECREF(result);
8018
+ Py_DECREF_IMMORTAL(result);
8026
8019
  }
8027
8020
  }
8028
8021
 
@@ -8034,13 +8027,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8034
8027
  case Py_EQ: {
8035
8028
  bool r = operand1 == operand2;
8036
8029
  PyObject *result = BOOL_FROM(r);
8037
- Py_INCREF(result);
8030
+ Py_INCREF_IMMORTAL(result);
8038
8031
  return result;
8039
8032
  }
8040
8033
  case Py_NE: {
8041
8034
  bool r = operand1 != operand2;
8042
8035
  PyObject *result = BOOL_FROM(r);
8043
- Py_INCREF(result);
8036
+ Py_INCREF_IMMORTAL(result);
8044
8037
  return result;
8045
8038
  }
8046
8039
  default:
@@ -8112,7 +8105,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8112
8105
  }
8113
8106
  }
8114
8107
 
8115
- Py_DECREF(result);
8108
+ Py_DECREF_IMMORTAL(result);
8116
8109
  }
8117
8110
 
8118
8111
  // No rich comparison worked, but maybe compare works.
@@ -8181,11 +8174,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8181
8174
  }
8182
8175
  }
8183
8176
 
8184
- Py_DECREF(result);
8177
+ Py_DECREF_IMMORTAL(result);
8185
8178
  }
8186
8179
  }
8187
8180
 
8188
- f = RICHCOMPARE(type1);
8181
+ f = TP_RICHCOMPARE(type1);
8189
8182
  if (f != NULL) {
8190
8183
  PyObject *result = (*f)(operand1, operand2, Py_GT);
8191
8184
 
@@ -8203,7 +8196,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8203
8196
  }
8204
8197
  }
8205
8198
 
8206
- Py_DECREF(result);
8199
+ Py_DECREF_IMMORTAL(result);
8207
8200
  }
8208
8201
 
8209
8202
  f = PyFloat_Type.tp_richcompare;
@@ -8224,7 +8217,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8224
8217
  }
8225
8218
  }
8226
8219
 
8227
- Py_DECREF(result);
8220
+ Py_DECREF_IMMORTAL(result);
8228
8221
  }
8229
8222
 
8230
8223
  int c;
@@ -8340,11 +8333,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8340
8333
  }
8341
8334
  }
8342
8335
 
8343
- Py_DECREF(result);
8336
+ Py_DECREF_IMMORTAL(result);
8344
8337
  }
8345
8338
  }
8346
8339
 
8347
- f = RICHCOMPARE(type1);
8340
+ f = TP_RICHCOMPARE(type1);
8348
8341
 
8349
8342
  if (f != NULL) {
8350
8343
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -8363,7 +8356,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8363
8356
  }
8364
8357
  }
8365
8358
 
8366
- Py_DECREF(result);
8359
+ Py_DECREF_IMMORTAL(result);
8367
8360
  }
8368
8361
 
8369
8362
  if (checked_reverse_op == false) {
@@ -8386,7 +8379,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8386
8379
  }
8387
8380
  }
8388
8381
 
8389
- Py_DECREF(result);
8382
+ Py_DECREF_IMMORTAL(result);
8390
8383
  }
8391
8384
  }
8392
8385
 
@@ -8460,7 +8453,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8460
8453
  }
8461
8454
  }
8462
8455
 
8463
- Py_DECREF(result);
8456
+ Py_DECREF_IMMORTAL(result);
8464
8457
  }
8465
8458
 
8466
8459
  // No rich comparison worked, but maybe compare works.
@@ -8510,7 +8503,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8510
8503
  richcmpfunc f;
8511
8504
 
8512
8505
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8513
- f = RICHCOMPARE(type2);
8506
+ f = TP_RICHCOMPARE(type2);
8514
8507
 
8515
8508
  if (f != NULL) {
8516
8509
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -8529,7 +8522,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8529
8522
  }
8530
8523
  }
8531
8524
 
8532
- Py_DECREF(result);
8525
+ Py_DECREF_IMMORTAL(result);
8533
8526
  }
8534
8527
  }
8535
8528
 
@@ -8551,10 +8544,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8551
8544
  }
8552
8545
  }
8553
8546
 
8554
- Py_DECREF(result);
8547
+ Py_DECREF_IMMORTAL(result);
8555
8548
  }
8556
8549
 
8557
- f = RICHCOMPARE(type2);
8550
+ f = TP_RICHCOMPARE(type2);
8558
8551
  if (f != NULL) {
8559
8552
  PyObject *result = (*f)(operand2, operand1, Py_LT);
8560
8553
 
@@ -8572,7 +8565,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8572
8565
  }
8573
8566
  }
8574
8567
 
8575
- Py_DECREF(result);
8568
+ Py_DECREF_IMMORTAL(result);
8576
8569
  }
8577
8570
 
8578
8571
  int c;
@@ -8667,7 +8660,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8667
8660
  richcmpfunc f;
8668
8661
 
8669
8662
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8670
- f = RICHCOMPARE(type2);
8663
+ f = TP_RICHCOMPARE(type2);
8671
8664
 
8672
8665
  if (f != NULL) {
8673
8666
  checked_reverse_op = true;
@@ -8688,7 +8681,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8688
8681
  }
8689
8682
  }
8690
8683
 
8691
- Py_DECREF(result);
8684
+ Py_DECREF_IMMORTAL(result);
8692
8685
  }
8693
8686
  }
8694
8687
 
@@ -8711,11 +8704,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8711
8704
  }
8712
8705
  }
8713
8706
 
8714
- Py_DECREF(result);
8707
+ Py_DECREF_IMMORTAL(result);
8715
8708
  }
8716
8709
 
8717
8710
  if (checked_reverse_op == false) {
8718
- f = RICHCOMPARE(type2);
8711
+ f = TP_RICHCOMPARE(type2);
8719
8712
 
8720
8713
  if (f != NULL) {
8721
8714
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -8734,7 +8727,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8734
8727
  }
8735
8728
  }
8736
8729
 
8737
- Py_DECREF(result);
8730
+ Py_DECREF_IMMORTAL(result);
8738
8731
  }
8739
8732
  }
8740
8733
 
@@ -8807,7 +8800,7 @@ static PyObject *COMPARE_GT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *ope
8807
8800
 
8808
8801
  // Convert to target type.
8809
8802
  PyObject *result = BOOL_FROM(r);
8810
- Py_INCREF(result);
8803
+ Py_INCREF_IMMORTAL(result);
8811
8804
  return result;
8812
8805
  }
8813
8806
 
@@ -8847,7 +8840,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8847
8840
  return result;
8848
8841
  }
8849
8842
 
8850
- Py_DECREF(result);
8843
+ Py_DECREF_IMMORTAL(result);
8851
8844
  }
8852
8845
 
8853
8846
  // No rich comparison worked, but maybe compare works.
@@ -8888,7 +8881,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8888
8881
 
8889
8882
  bool r = c != 0;
8890
8883
  PyObject *result = BOOL_FROM(r);
8891
- Py_INCREF(result);
8884
+ Py_INCREF_IMMORTAL(result);
8892
8885
  return result;
8893
8886
  }
8894
8887
  }
@@ -8908,11 +8901,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8908
8901
  return result;
8909
8902
  }
8910
8903
 
8911
- Py_DECREF(result);
8904
+ Py_DECREF_IMMORTAL(result);
8912
8905
  }
8913
8906
  }
8914
8907
 
8915
- f = RICHCOMPARE(type1);
8908
+ f = TP_RICHCOMPARE(type1);
8916
8909
  if (f != NULL) {
8917
8910
  PyObject *result = (*f)(operand1, operand2, Py_GT);
8918
8911
 
@@ -8922,7 +8915,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8922
8915
  return result;
8923
8916
  }
8924
8917
 
8925
- Py_DECREF(result);
8918
+ Py_DECREF_IMMORTAL(result);
8926
8919
  }
8927
8920
 
8928
8921
  f = PyTuple_Type.tp_richcompare;
@@ -8935,7 +8928,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8935
8928
  return result;
8936
8929
  }
8937
8930
 
8938
- Py_DECREF(result);
8931
+ Py_DECREF_IMMORTAL(result);
8939
8932
  }
8940
8933
 
8941
8934
  int c;
@@ -9023,7 +9016,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9023
9016
 
9024
9017
  bool r = c != 0;
9025
9018
  PyObject *result = BOOL_FROM(r);
9026
- Py_INCREF(result);
9019
+ Py_INCREF_IMMORTAL(result);
9027
9020
  return result;
9028
9021
  #else
9029
9022
  bool checked_reverse_op = false;
@@ -9043,11 +9036,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9043
9036
  return result;
9044
9037
  }
9045
9038
 
9046
- Py_DECREF(result);
9039
+ Py_DECREF_IMMORTAL(result);
9047
9040
  }
9048
9041
  }
9049
9042
 
9050
- f = RICHCOMPARE(type1);
9043
+ f = TP_RICHCOMPARE(type1);
9051
9044
 
9052
9045
  if (f != NULL) {
9053
9046
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -9058,7 +9051,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9058
9051
  return result;
9059
9052
  }
9060
9053
 
9061
- Py_DECREF(result);
9054
+ Py_DECREF_IMMORTAL(result);
9062
9055
  }
9063
9056
 
9064
9057
  if (checked_reverse_op == false) {
@@ -9073,7 +9066,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9073
9066
  return result;
9074
9067
  }
9075
9068
 
9076
- Py_DECREF(result);
9069
+ Py_DECREF_IMMORTAL(result);
9077
9070
  }
9078
9071
  }
9079
9072
 
@@ -9085,13 +9078,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9085
9078
  case Py_EQ: {
9086
9079
  bool r = operand1 == operand2;
9087
9080
  PyObject *result = BOOL_FROM(r);
9088
- Py_INCREF(result);
9081
+ Py_INCREF_IMMORTAL(result);
9089
9082
  return result;
9090
9083
  }
9091
9084
  case Py_NE: {
9092
9085
  bool r = operand1 != operand2;
9093
9086
  PyObject *result = BOOL_FROM(r);
9094
- Py_INCREF(result);
9087
+ Py_INCREF_IMMORTAL(result);
9095
9088
  return result;
9096
9089
  }
9097
9090
  default:
@@ -9139,7 +9132,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9139
9132
  return result;
9140
9133
  }
9141
9134
 
9142
- Py_DECREF(result);
9135
+ Py_DECREF_IMMORTAL(result);
9143
9136
  }
9144
9137
 
9145
9138
  // No rich comparison worked, but maybe compare works.
@@ -9180,7 +9173,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9180
9173
 
9181
9174
  bool r = c != 0;
9182
9175
  PyObject *result = BOOL_FROM(r);
9183
- Py_INCREF(result);
9176
+ Py_INCREF_IMMORTAL(result);
9184
9177
  return result;
9185
9178
  }
9186
9179
  }
@@ -9189,7 +9182,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9189
9182
  richcmpfunc f;
9190
9183
 
9191
9184
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9192
- f = RICHCOMPARE(type2);
9185
+ f = TP_RICHCOMPARE(type2);
9193
9186
 
9194
9187
  if (f != NULL) {
9195
9188
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -9200,7 +9193,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9200
9193
  return result;
9201
9194
  }
9202
9195
 
9203
- Py_DECREF(result);
9196
+ Py_DECREF_IMMORTAL(result);
9204
9197
  }
9205
9198
  }
9206
9199
 
@@ -9214,10 +9207,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9214
9207
  return result;
9215
9208
  }
9216
9209
 
9217
- Py_DECREF(result);
9210
+ Py_DECREF_IMMORTAL(result);
9218
9211
  }
9219
9212
 
9220
- f = RICHCOMPARE(type2);
9213
+ f = TP_RICHCOMPARE(type2);
9221
9214
  if (f != NULL) {
9222
9215
  PyObject *result = (*f)(operand2, operand1, Py_LT);
9223
9216
 
@@ -9227,7 +9220,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9227
9220
  return result;
9228
9221
  }
9229
9222
 
9230
- Py_DECREF(result);
9223
+ Py_DECREF_IMMORTAL(result);
9231
9224
  }
9232
9225
 
9233
9226
  int c;
@@ -9315,14 +9308,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9315
9308
 
9316
9309
  bool r = c != 0;
9317
9310
  PyObject *result = BOOL_FROM(r);
9318
- Py_INCREF(result);
9311
+ Py_INCREF_IMMORTAL(result);
9319
9312
  return result;
9320
9313
  #else
9321
9314
  bool checked_reverse_op = false;
9322
9315
  richcmpfunc f;
9323
9316
 
9324
9317
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9325
- f = RICHCOMPARE(type2);
9318
+ f = TP_RICHCOMPARE(type2);
9326
9319
 
9327
9320
  if (f != NULL) {
9328
9321
  checked_reverse_op = true;
@@ -9335,7 +9328,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9335
9328
  return result;
9336
9329
  }
9337
9330
 
9338
- Py_DECREF(result);
9331
+ Py_DECREF_IMMORTAL(result);
9339
9332
  }
9340
9333
  }
9341
9334
 
@@ -9350,11 +9343,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9350
9343
  return result;
9351
9344
  }
9352
9345
 
9353
- Py_DECREF(result);
9346
+ Py_DECREF_IMMORTAL(result);
9354
9347
  }
9355
9348
 
9356
9349
  if (checked_reverse_op == false) {
9357
- f = RICHCOMPARE(type2);
9350
+ f = TP_RICHCOMPARE(type2);
9358
9351
 
9359
9352
  if (f != NULL) {
9360
9353
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -9365,7 +9358,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9365
9358
  return result;
9366
9359
  }
9367
9360
 
9368
- Py_DECREF(result);
9361
+ Py_DECREF_IMMORTAL(result);
9369
9362
  }
9370
9363
  }
9371
9364
 
@@ -9377,13 +9370,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9377
9370
  case Py_EQ: {
9378
9371
  bool r = operand1 == operand2;
9379
9372
  PyObject *result = BOOL_FROM(r);
9380
- Py_INCREF(result);
9373
+ Py_INCREF_IMMORTAL(result);
9381
9374
  return result;
9382
9375
  }
9383
9376
  case Py_NE: {
9384
9377
  bool r = operand1 != operand2;
9385
9378
  PyObject *result = BOOL_FROM(r);
9386
- Py_INCREF(result);
9379
+ Py_INCREF_IMMORTAL(result);
9387
9380
  return result;
9388
9381
  }
9389
9382
  default:
@@ -9492,7 +9485,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9492
9485
  }
9493
9486
  }
9494
9487
 
9495
- Py_DECREF(result);
9488
+ Py_DECREF_IMMORTAL(result);
9496
9489
  }
9497
9490
 
9498
9491
  // No rich comparison worked, but maybe compare works.
@@ -9561,11 +9554,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9561
9554
  }
9562
9555
  }
9563
9556
 
9564
- Py_DECREF(result);
9557
+ Py_DECREF_IMMORTAL(result);
9565
9558
  }
9566
9559
  }
9567
9560
 
9568
- f = RICHCOMPARE(type1);
9561
+ f = TP_RICHCOMPARE(type1);
9569
9562
  if (f != NULL) {
9570
9563
  PyObject *result = (*f)(operand1, operand2, Py_GT);
9571
9564
 
@@ -9583,7 +9576,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9583
9576
  }
9584
9577
  }
9585
9578
 
9586
- Py_DECREF(result);
9579
+ Py_DECREF_IMMORTAL(result);
9587
9580
  }
9588
9581
 
9589
9582
  f = PyTuple_Type.tp_richcompare;
@@ -9604,7 +9597,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9604
9597
  }
9605
9598
  }
9606
9599
 
9607
- Py_DECREF(result);
9600
+ Py_DECREF_IMMORTAL(result);
9608
9601
  }
9609
9602
 
9610
9603
  int c;
@@ -9720,11 +9713,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9720
9713
  }
9721
9714
  }
9722
9715
 
9723
- Py_DECREF(result);
9716
+ Py_DECREF_IMMORTAL(result);
9724
9717
  }
9725
9718
  }
9726
9719
 
9727
- f = RICHCOMPARE(type1);
9720
+ f = TP_RICHCOMPARE(type1);
9728
9721
 
9729
9722
  if (f != NULL) {
9730
9723
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -9743,7 +9736,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9743
9736
  }
9744
9737
  }
9745
9738
 
9746
- Py_DECREF(result);
9739
+ Py_DECREF_IMMORTAL(result);
9747
9740
  }
9748
9741
 
9749
9742
  if (checked_reverse_op == false) {
@@ -9766,7 +9759,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9766
9759
  }
9767
9760
  }
9768
9761
 
9769
- Py_DECREF(result);
9762
+ Py_DECREF_IMMORTAL(result);
9770
9763
  }
9771
9764
  }
9772
9765
 
@@ -9840,7 +9833,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9840
9833
  }
9841
9834
  }
9842
9835
 
9843
- Py_DECREF(result);
9836
+ Py_DECREF_IMMORTAL(result);
9844
9837
  }
9845
9838
 
9846
9839
  // No rich comparison worked, but maybe compare works.
@@ -9890,7 +9883,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9890
9883
  richcmpfunc f;
9891
9884
 
9892
9885
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9893
- f = RICHCOMPARE(type2);
9886
+ f = TP_RICHCOMPARE(type2);
9894
9887
 
9895
9888
  if (f != NULL) {
9896
9889
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -9909,7 +9902,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9909
9902
  }
9910
9903
  }
9911
9904
 
9912
- Py_DECREF(result);
9905
+ Py_DECREF_IMMORTAL(result);
9913
9906
  }
9914
9907
  }
9915
9908
 
@@ -9931,10 +9924,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9931
9924
  }
9932
9925
  }
9933
9926
 
9934
- Py_DECREF(result);
9927
+ Py_DECREF_IMMORTAL(result);
9935
9928
  }
9936
9929
 
9937
- f = RICHCOMPARE(type2);
9930
+ f = TP_RICHCOMPARE(type2);
9938
9931
  if (f != NULL) {
9939
9932
  PyObject *result = (*f)(operand2, operand1, Py_LT);
9940
9933
 
@@ -9952,7 +9945,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9952
9945
  }
9953
9946
  }
9954
9947
 
9955
- Py_DECREF(result);
9948
+ Py_DECREF_IMMORTAL(result);
9956
9949
  }
9957
9950
 
9958
9951
  int c;
@@ -10047,7 +10040,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10047
10040
  richcmpfunc f;
10048
10041
 
10049
10042
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
10050
- f = RICHCOMPARE(type2);
10043
+ f = TP_RICHCOMPARE(type2);
10051
10044
 
10052
10045
  if (f != NULL) {
10053
10046
  checked_reverse_op = true;
@@ -10068,7 +10061,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10068
10061
  }
10069
10062
  }
10070
10063
 
10071
- Py_DECREF(result);
10064
+ Py_DECREF_IMMORTAL(result);
10072
10065
  }
10073
10066
  }
10074
10067
 
@@ -10091,11 +10084,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10091
10084
  }
10092
10085
  }
10093
10086
 
10094
- Py_DECREF(result);
10087
+ Py_DECREF_IMMORTAL(result);
10095
10088
  }
10096
10089
 
10097
10090
  if (checked_reverse_op == false) {
10098
- f = RICHCOMPARE(type2);
10091
+ f = TP_RICHCOMPARE(type2);
10099
10092
 
10100
10093
  if (f != NULL) {
10101
10094
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -10114,7 +10107,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10114
10107
  }
10115
10108
  }
10116
10109
 
10117
- Py_DECREF(result);
10110
+ Py_DECREF_IMMORTAL(result);
10118
10111
  }
10119
10112
  }
10120
10113
 
@@ -10161,14 +10154,11 @@ static PyObject *COMPARE_GT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10161
10154
  PyListObject *a = (PyListObject *)operand1;
10162
10155
  PyListObject *b = (PyListObject *)operand2;
10163
10156
 
10164
- Py_ssize_t len_a = Py_SIZE(a);
10165
- Py_ssize_t len_b = Py_SIZE(b);
10166
-
10167
10157
  bool found = false;
10168
10158
  nuitka_bool res = NUITKA_BOOL_TRUE;
10169
10159
 
10170
10160
  Py_ssize_t i;
10171
- for (i = 0; i < len_a && i < len_b; i++) {
10161
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10172
10162
  PyObject *aa = a->ob_item[i];
10173
10163
  PyObject *bb = b->ob_item[i];
10174
10164
 
@@ -10176,7 +10166,11 @@ static PyObject *COMPARE_GT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10176
10166
  continue;
10177
10167
  }
10178
10168
 
10169
+ Py_INCREF(aa);
10170
+ Py_INCREF(bb);
10179
10171
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10172
+ Py_DECREF(aa);
10173
+ Py_DECREF(bb);
10180
10174
 
10181
10175
  if (res == NUITKA_BOOL_EXCEPTION) {
10182
10176
  return NULL;
@@ -10189,11 +10183,11 @@ static PyObject *COMPARE_GT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10189
10183
  }
10190
10184
 
10191
10185
  if (found == false) {
10192
- bool r = len_a > len_b;
10186
+ bool r = Py_SIZE(a) > Py_SIZE(b);
10193
10187
 
10194
10188
  // Convert to target type.
10195
10189
  PyObject *result = BOOL_FROM(r);
10196
- Py_INCREF(result);
10190
+ Py_INCREF_IMMORTAL(result);
10197
10191
  return result;
10198
10192
  }
10199
10193
 
@@ -10233,7 +10227,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10233
10227
  return result;
10234
10228
  }
10235
10229
 
10236
- Py_DECREF(result);
10230
+ Py_DECREF_IMMORTAL(result);
10237
10231
  }
10238
10232
 
10239
10233
  // No rich comparison worked, but maybe compare works.
@@ -10274,7 +10268,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10274
10268
 
10275
10269
  bool r = c != 0;
10276
10270
  PyObject *result = BOOL_FROM(r);
10277
- Py_INCREF(result);
10271
+ Py_INCREF_IMMORTAL(result);
10278
10272
  return result;
10279
10273
  }
10280
10274
  }
@@ -10294,11 +10288,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10294
10288
  return result;
10295
10289
  }
10296
10290
 
10297
- Py_DECREF(result);
10291
+ Py_DECREF_IMMORTAL(result);
10298
10292
  }
10299
10293
  }
10300
10294
 
10301
- f = RICHCOMPARE(type1);
10295
+ f = TP_RICHCOMPARE(type1);
10302
10296
  if (f != NULL) {
10303
10297
  PyObject *result = (*f)(operand1, operand2, Py_GT);
10304
10298
 
@@ -10308,7 +10302,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10308
10302
  return result;
10309
10303
  }
10310
10304
 
10311
- Py_DECREF(result);
10305
+ Py_DECREF_IMMORTAL(result);
10312
10306
  }
10313
10307
 
10314
10308
  f = PyList_Type.tp_richcompare;
@@ -10321,7 +10315,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10321
10315
  return result;
10322
10316
  }
10323
10317
 
10324
- Py_DECREF(result);
10318
+ Py_DECREF_IMMORTAL(result);
10325
10319
  }
10326
10320
 
10327
10321
  int c;
@@ -10409,7 +10403,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10409
10403
 
10410
10404
  bool r = c != 0;
10411
10405
  PyObject *result = BOOL_FROM(r);
10412
- Py_INCREF(result);
10406
+ Py_INCREF_IMMORTAL(result);
10413
10407
  return result;
10414
10408
  #else
10415
10409
  bool checked_reverse_op = false;
@@ -10429,11 +10423,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10429
10423
  return result;
10430
10424
  }
10431
10425
 
10432
- Py_DECREF(result);
10426
+ Py_DECREF_IMMORTAL(result);
10433
10427
  }
10434
10428
  }
10435
10429
 
10436
- f = RICHCOMPARE(type1);
10430
+ f = TP_RICHCOMPARE(type1);
10437
10431
 
10438
10432
  if (f != NULL) {
10439
10433
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -10444,7 +10438,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10444
10438
  return result;
10445
10439
  }
10446
10440
 
10447
- Py_DECREF(result);
10441
+ Py_DECREF_IMMORTAL(result);
10448
10442
  }
10449
10443
 
10450
10444
  if (checked_reverse_op == false) {
@@ -10459,7 +10453,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10459
10453
  return result;
10460
10454
  }
10461
10455
 
10462
- Py_DECREF(result);
10456
+ Py_DECREF_IMMORTAL(result);
10463
10457
  }
10464
10458
  }
10465
10459
 
@@ -10471,13 +10465,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10471
10465
  case Py_EQ: {
10472
10466
  bool r = operand1 == operand2;
10473
10467
  PyObject *result = BOOL_FROM(r);
10474
- Py_INCREF(result);
10468
+ Py_INCREF_IMMORTAL(result);
10475
10469
  return result;
10476
10470
  }
10477
10471
  case Py_NE: {
10478
10472
  bool r = operand1 != operand2;
10479
10473
  PyObject *result = BOOL_FROM(r);
10480
- Py_INCREF(result);
10474
+ Py_INCREF_IMMORTAL(result);
10481
10475
  return result;
10482
10476
  }
10483
10477
  default:
@@ -10525,7 +10519,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10525
10519
  return result;
10526
10520
  }
10527
10521
 
10528
- Py_DECREF(result);
10522
+ Py_DECREF_IMMORTAL(result);
10529
10523
  }
10530
10524
 
10531
10525
  // No rich comparison worked, but maybe compare works.
@@ -10566,7 +10560,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10566
10560
 
10567
10561
  bool r = c != 0;
10568
10562
  PyObject *result = BOOL_FROM(r);
10569
- Py_INCREF(result);
10563
+ Py_INCREF_IMMORTAL(result);
10570
10564
  return result;
10571
10565
  }
10572
10566
  }
@@ -10575,7 +10569,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10575
10569
  richcmpfunc f;
10576
10570
 
10577
10571
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10578
- f = RICHCOMPARE(type2);
10572
+ f = TP_RICHCOMPARE(type2);
10579
10573
 
10580
10574
  if (f != NULL) {
10581
10575
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -10586,7 +10580,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10586
10580
  return result;
10587
10581
  }
10588
10582
 
10589
- Py_DECREF(result);
10583
+ Py_DECREF_IMMORTAL(result);
10590
10584
  }
10591
10585
  }
10592
10586
 
@@ -10600,10 +10594,10 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10600
10594
  return result;
10601
10595
  }
10602
10596
 
10603
- Py_DECREF(result);
10597
+ Py_DECREF_IMMORTAL(result);
10604
10598
  }
10605
10599
 
10606
- f = RICHCOMPARE(type2);
10600
+ f = TP_RICHCOMPARE(type2);
10607
10601
  if (f != NULL) {
10608
10602
  PyObject *result = (*f)(operand2, operand1, Py_LT);
10609
10603
 
@@ -10613,7 +10607,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10613
10607
  return result;
10614
10608
  }
10615
10609
 
10616
- Py_DECREF(result);
10610
+ Py_DECREF_IMMORTAL(result);
10617
10611
  }
10618
10612
 
10619
10613
  int c;
@@ -10701,14 +10695,14 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10701
10695
 
10702
10696
  bool r = c != 0;
10703
10697
  PyObject *result = BOOL_FROM(r);
10704
- Py_INCREF(result);
10698
+ Py_INCREF_IMMORTAL(result);
10705
10699
  return result;
10706
10700
  #else
10707
10701
  bool checked_reverse_op = false;
10708
10702
  richcmpfunc f;
10709
10703
 
10710
10704
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10711
- f = RICHCOMPARE(type2);
10705
+ f = TP_RICHCOMPARE(type2);
10712
10706
 
10713
10707
  if (f != NULL) {
10714
10708
  checked_reverse_op = true;
@@ -10721,7 +10715,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10721
10715
  return result;
10722
10716
  }
10723
10717
 
10724
- Py_DECREF(result);
10718
+ Py_DECREF_IMMORTAL(result);
10725
10719
  }
10726
10720
  }
10727
10721
 
@@ -10736,11 +10730,11 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10736
10730
  return result;
10737
10731
  }
10738
10732
 
10739
- Py_DECREF(result);
10733
+ Py_DECREF_IMMORTAL(result);
10740
10734
  }
10741
10735
 
10742
10736
  if (checked_reverse_op == false) {
10743
- f = RICHCOMPARE(type2);
10737
+ f = TP_RICHCOMPARE(type2);
10744
10738
 
10745
10739
  if (f != NULL) {
10746
10740
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -10751,7 +10745,7 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10751
10745
  return result;
10752
10746
  }
10753
10747
 
10754
- Py_DECREF(result);
10748
+ Py_DECREF_IMMORTAL(result);
10755
10749
  }
10756
10750
  }
10757
10751
 
@@ -10763,13 +10757,13 @@ PyObject *RICH_COMPARE_GT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10763
10757
  case Py_EQ: {
10764
10758
  bool r = operand1 == operand2;
10765
10759
  PyObject *result = BOOL_FROM(r);
10766
- Py_INCREF(result);
10760
+ Py_INCREF_IMMORTAL(result);
10767
10761
  return result;
10768
10762
  }
10769
10763
  case Py_NE: {
10770
10764
  bool r = operand1 != operand2;
10771
10765
  PyObject *result = BOOL_FROM(r);
10772
- Py_INCREF(result);
10766
+ Py_INCREF_IMMORTAL(result);
10773
10767
  return result;
10774
10768
  }
10775
10769
  default:
@@ -10798,14 +10792,11 @@ static nuitka_bool COMPARE_GT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10798
10792
  PyListObject *a = (PyListObject *)operand1;
10799
10793
  PyListObject *b = (PyListObject *)operand2;
10800
10794
 
10801
- Py_ssize_t len_a = Py_SIZE(a);
10802
- Py_ssize_t len_b = Py_SIZE(b);
10803
-
10804
10795
  bool found = false;
10805
10796
  nuitka_bool res = NUITKA_BOOL_TRUE;
10806
10797
 
10807
10798
  Py_ssize_t i;
10808
- for (i = 0; i < len_a && i < len_b; i++) {
10799
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10809
10800
  PyObject *aa = a->ob_item[i];
10810
10801
  PyObject *bb = b->ob_item[i];
10811
10802
 
@@ -10813,7 +10804,11 @@ static nuitka_bool COMPARE_GT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10813
10804
  continue;
10814
10805
  }
10815
10806
 
10807
+ Py_INCREF(aa);
10808
+ Py_INCREF(bb);
10816
10809
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10810
+ Py_DECREF(aa);
10811
+ Py_DECREF(bb);
10817
10812
 
10818
10813
  if (res == NUITKA_BOOL_EXCEPTION) {
10819
10814
  return NUITKA_BOOL_EXCEPTION;
@@ -10826,7 +10821,7 @@ static nuitka_bool COMPARE_GT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10826
10821
  }
10827
10822
 
10828
10823
  if (found == false) {
10829
- bool r = len_a > len_b;
10824
+ bool r = Py_SIZE(a) > Py_SIZE(b);
10830
10825
 
10831
10826
  // Convert to target type.
10832
10827
  nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
@@ -10878,7 +10873,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10878
10873
  }
10879
10874
  }
10880
10875
 
10881
- Py_DECREF(result);
10876
+ Py_DECREF_IMMORTAL(result);
10882
10877
  }
10883
10878
 
10884
10879
  // No rich comparison worked, but maybe compare works.
@@ -10947,11 +10942,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10947
10942
  }
10948
10943
  }
10949
10944
 
10950
- Py_DECREF(result);
10945
+ Py_DECREF_IMMORTAL(result);
10951
10946
  }
10952
10947
  }
10953
10948
 
10954
- f = RICHCOMPARE(type1);
10949
+ f = TP_RICHCOMPARE(type1);
10955
10950
  if (f != NULL) {
10956
10951
  PyObject *result = (*f)(operand1, operand2, Py_GT);
10957
10952
 
@@ -10969,7 +10964,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10969
10964
  }
10970
10965
  }
10971
10966
 
10972
- Py_DECREF(result);
10967
+ Py_DECREF_IMMORTAL(result);
10973
10968
  }
10974
10969
 
10975
10970
  f = PyList_Type.tp_richcompare;
@@ -10990,7 +10985,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10990
10985
  }
10991
10986
  }
10992
10987
 
10993
- Py_DECREF(result);
10988
+ Py_DECREF_IMMORTAL(result);
10994
10989
  }
10995
10990
 
10996
10991
  int c;
@@ -11106,11 +11101,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11106
11101
  }
11107
11102
  }
11108
11103
 
11109
- Py_DECREF(result);
11104
+ Py_DECREF_IMMORTAL(result);
11110
11105
  }
11111
11106
  }
11112
11107
 
11113
- f = RICHCOMPARE(type1);
11108
+ f = TP_RICHCOMPARE(type1);
11114
11109
 
11115
11110
  if (f != NULL) {
11116
11111
  PyObject *result = (*f)(operand1, operand2, Py_GT);
@@ -11129,7 +11124,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11129
11124
  }
11130
11125
  }
11131
11126
 
11132
- Py_DECREF(result);
11127
+ Py_DECREF_IMMORTAL(result);
11133
11128
  }
11134
11129
 
11135
11130
  if (checked_reverse_op == false) {
@@ -11152,7 +11147,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11152
11147
  }
11153
11148
  }
11154
11149
 
11155
- Py_DECREF(result);
11150
+ Py_DECREF_IMMORTAL(result);
11156
11151
  }
11157
11152
  }
11158
11153
 
@@ -11226,7 +11221,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11226
11221
  }
11227
11222
  }
11228
11223
 
11229
- Py_DECREF(result);
11224
+ Py_DECREF_IMMORTAL(result);
11230
11225
  }
11231
11226
 
11232
11227
  // No rich comparison worked, but maybe compare works.
@@ -11276,7 +11271,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11276
11271
  richcmpfunc f;
11277
11272
 
11278
11273
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11279
- f = RICHCOMPARE(type2);
11274
+ f = TP_RICHCOMPARE(type2);
11280
11275
 
11281
11276
  if (f != NULL) {
11282
11277
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -11295,7 +11290,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11295
11290
  }
11296
11291
  }
11297
11292
 
11298
- Py_DECREF(result);
11293
+ Py_DECREF_IMMORTAL(result);
11299
11294
  }
11300
11295
  }
11301
11296
 
@@ -11317,10 +11312,10 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11317
11312
  }
11318
11313
  }
11319
11314
 
11320
- Py_DECREF(result);
11315
+ Py_DECREF_IMMORTAL(result);
11321
11316
  }
11322
11317
 
11323
- f = RICHCOMPARE(type2);
11318
+ f = TP_RICHCOMPARE(type2);
11324
11319
  if (f != NULL) {
11325
11320
  PyObject *result = (*f)(operand2, operand1, Py_LT);
11326
11321
 
@@ -11338,7 +11333,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11338
11333
  }
11339
11334
  }
11340
11335
 
11341
- Py_DECREF(result);
11336
+ Py_DECREF_IMMORTAL(result);
11342
11337
  }
11343
11338
 
11344
11339
  int c;
@@ -11433,7 +11428,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11433
11428
  richcmpfunc f;
11434
11429
 
11435
11430
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11436
- f = RICHCOMPARE(type2);
11431
+ f = TP_RICHCOMPARE(type2);
11437
11432
 
11438
11433
  if (f != NULL) {
11439
11434
  checked_reverse_op = true;
@@ -11454,7 +11449,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11454
11449
  }
11455
11450
  }
11456
11451
 
11457
- Py_DECREF(result);
11452
+ Py_DECREF_IMMORTAL(result);
11458
11453
  }
11459
11454
  }
11460
11455
 
@@ -11477,11 +11472,11 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11477
11472
  }
11478
11473
  }
11479
11474
 
11480
- Py_DECREF(result);
11475
+ Py_DECREF_IMMORTAL(result);
11481
11476
  }
11482
11477
 
11483
11478
  if (checked_reverse_op == false) {
11484
- f = RICHCOMPARE(type2);
11479
+ f = TP_RICHCOMPARE(type2);
11485
11480
 
11486
11481
  if (f != NULL) {
11487
11482
  PyObject *result = (*f)(operand2, operand1, Py_LT);
@@ -11500,7 +11495,7 @@ nuitka_bool RICH_COMPARE_GT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11500
11495
  }
11501
11496
  }
11502
11497
 
11503
- Py_DECREF(result);
11498
+ Py_DECREF_IMMORTAL(result);
11504
11499
  }
11505
11500
  }
11506
11501
 
@@ -11557,7 +11552,7 @@ static PyObject *COMPARE_GT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11557
11552
  }
11558
11553
 
11559
11554
  Py_ssize_t operand2_digit_count = 0;
11560
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11555
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11561
11556
  {
11562
11557
  unsigned long t = operand2_abs_ival;
11563
11558
 
@@ -11574,15 +11569,15 @@ static PyObject *COMPARE_GT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11574
11569
 
11575
11570
  bool r;
11576
11571
 
11577
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11578
- r = Py_SIZE(operand1_long_object) - operand2_size > 0;
11572
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11573
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size > 0;
11579
11574
  } else {
11580
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11575
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11581
11576
  r = false;
11582
11577
  while (--i >= 0) {
11583
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11584
- r = operand1_long_object->ob_digit[i] > operand2_digits[i];
11585
- if (Py_SIZE(operand1_long_object) < 0) {
11578
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11579
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > operand2_digits[i];
11580
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11586
11581
  r = !r;
11587
11582
  }
11588
11583
  break;
@@ -11592,7 +11587,7 @@ static PyObject *COMPARE_GT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11592
11587
 
11593
11588
  // Convert to target type.
11594
11589
  PyObject *result = BOOL_FROM(r);
11595
- Py_INCREF(result);
11590
+ Py_INCREF_IMMORTAL(result);
11596
11591
  return result;
11597
11592
  }
11598
11593
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
@@ -11621,7 +11616,7 @@ static bool COMPARE_GT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11621
11616
  }
11622
11617
 
11623
11618
  Py_ssize_t operand2_digit_count = 0;
11624
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11619
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11625
11620
  {
11626
11621
  unsigned long t = operand2_abs_ival;
11627
11622
 
@@ -11638,15 +11633,15 @@ static bool COMPARE_GT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11638
11633
 
11639
11634
  bool r;
11640
11635
 
11641
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11642
- r = Py_SIZE(operand1_long_object) - operand2_size > 0;
11636
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11637
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size > 0;
11643
11638
  } else {
11644
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11639
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11645
11640
  r = false;
11646
11641
  while (--i >= 0) {
11647
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11648
- r = operand1_long_object->ob_digit[i] > operand2_digits[i];
11649
- if (Py_SIZE(operand1_long_object) < 0) {
11642
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11643
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > operand2_digits[i];
11644
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11650
11645
  r = !r;
11651
11646
  }
11652
11647
  break;
@@ -11678,7 +11673,7 @@ static PyObject *COMPARE_GT_OBJECT_INT_CLONG(PyObject *operand1, long operand2)
11678
11673
 
11679
11674
  // Convert to target type.
11680
11675
  PyObject *result = BOOL_FROM(r);
11681
- Py_INCREF(result);
11676
+ Py_INCREF_IMMORTAL(result);
11682
11677
  return result;
11683
11678
  }
11684
11679
  /* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
@@ -11719,15 +11714,18 @@ static PyObject *COMPARE_GT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11719
11714
 
11720
11715
  bool r;
11721
11716
 
11722
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11723
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) > 0;
11717
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11718
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11719
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11720
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) >
11721
+ 0;
11724
11722
  } else {
11725
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11723
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11726
11724
  r = false;
11727
11725
  while (--i >= 0) {
11728
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11729
- r = operand1_long_object->ob_digit[i] > (digit)Py_ABS(operand2);
11730
- if (Py_SIZE(operand1_long_object) < 0) {
11726
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11727
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > (digit)Py_ABS(operand2);
11728
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11731
11729
  r = !r;
11732
11730
  }
11733
11731
  break;
@@ -11737,7 +11735,7 @@ static PyObject *COMPARE_GT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11737
11735
 
11738
11736
  // Convert to target type.
11739
11737
  PyObject *result = BOOL_FROM(r);
11740
- Py_INCREF(result);
11738
+ Py_INCREF_IMMORTAL(result);
11741
11739
  return result;
11742
11740
  }
11743
11741
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "DIGIT" to C platform digit value for long
@@ -11756,15 +11754,18 @@ static bool COMPARE_GT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {
11756
11754
 
11757
11755
  bool r;
11758
11756
 
11759
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11760
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) > 0;
11757
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11758
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11759
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11760
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) >
11761
+ 0;
11761
11762
  } else {
11762
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11763
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11763
11764
  r = false;
11764
11765
  while (--i >= 0) {
11765
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11766
- r = operand1_long_object->ob_digit[i] > (digit)Py_ABS(operand2);
11767
- if (Py_SIZE(operand1_long_object) < 0) {
11766
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11767
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > (digit)Py_ABS(operand2);
11768
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11768
11769
  r = !r;
11769
11770
  }
11770
11771
  break;
@@ -11795,7 +11796,7 @@ static PyObject *COMPARE_GT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double opera
11795
11796
 
11796
11797
  // Convert to target type.
11797
11798
  PyObject *result = BOOL_FROM(r);
11798
- Py_INCREF(result);
11799
+ Py_INCREF_IMMORTAL(result);
11799
11800
  return result;
11800
11801
  }
11801
11802
  /* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
@@ -11823,3 +11824,18 @@ bool RICH_COMPARE_GT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
11823
11824
 
11824
11825
  return COMPARE_GT_CBOOL_FLOAT_CFLOAT(operand1, operand2);
11825
11826
  }
11827
+
11828
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
11829
+ // integrates with CPython, but also works on its own.
11830
+ //
11831
+ // Licensed under the Apache License, Version 2.0 (the "License");
11832
+ // you may not use this file except in compliance with the License.
11833
+ // You may obtain a copy of the License at
11834
+ //
11835
+ // http://www.apache.org/licenses/LICENSE-2.0
11836
+ //
11837
+ // Unless required by applicable law or agreed to in writing, software
11838
+ // distributed under the License is distributed on an "AS IS" BASIS,
11839
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11840
+ // See the License for the specific language governing permissions and
11841
+ // limitations under the License.