Nuitka-winsvc 1.8__cp311-cp311-win_amd64.whl → 2.5.1__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 (728) hide show
  1. Nuitka_winsvc-1.8.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.5.1.data/scripts/nuitka-run.cmd +9 -9
  2. Nuitka_winsvc-1.8.data/scripts/nuitka.bat → Nuitka_winsvc-2.5.1.data/scripts/nuitka.cmd +15 -15
  3. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/METADATA +5 -3
  4. Nuitka_winsvc-2.5.1.dist-info/RECORD +977 -0
  5. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/WHEEL +1 -1
  6. nuitka/Builtins.py +49 -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 +408 -0
  13. nuitka/MainControl.py +209 -116
  14. nuitka/ModuleRegistry.py +83 -20
  15. nuitka/OptionParsing.py +467 -221
  16. nuitka/Options.py +701 -225
  17. nuitka/OutputDirectories.py +47 -23
  18. nuitka/PostProcessing.py +133 -79
  19. nuitka/Progress.py +73 -24
  20. nuitka/PythonFlavors.py +141 -32
  21. nuitka/PythonOperators.py +18 -17
  22. nuitka/PythonVersions.py +107 -19
  23. nuitka/Serialization.py +70 -55
  24. nuitka/SourceCodeReferences.py +19 -17
  25. nuitka/Tracing.py +176 -70
  26. nuitka/TreeXML.py +31 -26
  27. nuitka/Variables.py +39 -41
  28. nuitka/Version.py +22 -8
  29. nuitka/__init__.py +5 -4
  30. nuitka/__main__.py +95 -29
  31. nuitka/__past__.py +44 -34
  32. nuitka/build/Backend.scons +243 -141
  33. nuitka/build/CCompilerVersion.scons +45 -31
  34. nuitka/build/DataComposerInterface.py +20 -17
  35. nuitka/build/Onefile.scons +56 -54
  36. nuitka/build/SconsCaching.py +105 -92
  37. nuitka/build/SconsCompilerSettings.py +167 -68
  38. nuitka/build/SconsHacks.py +25 -19
  39. nuitka/build/SconsInterface.py +155 -54
  40. nuitka/build/SconsProgress.py +19 -18
  41. nuitka/build/SconsSpawn.py +62 -33
  42. nuitka/build/SconsUtils.py +152 -55
  43. nuitka/build/__init__.py +5 -4
  44. nuitka/build/include/nuitka/allocator.h +228 -22
  45. nuitka/build/include/nuitka/builtins.h +17 -17
  46. nuitka/build/include/nuitka/calling.h +24 -24
  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 +28 -25
  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 +93 -54
  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 +35 -18
  57. nuitka/build/include/nuitka/constants_blob.h +17 -17
  58. nuitka/build/include/nuitka/debug_settings.h +60 -0
  59. nuitka/build/include/nuitka/environment_variables.h +30 -0
  60. nuitka/build/include/nuitka/environment_variables_system.h +45 -0
  61. nuitka/build/include/nuitka/exception_groups.h +23 -26
  62. nuitka/build/include/nuitka/exceptions.h +717 -171
  63. nuitka/build/include/nuitka/filesystem_paths.h +26 -20
  64. nuitka/build/include/nuitka/freelists.h +38 -18
  65. nuitka/build/include/nuitka/helper/attributes.h +24 -22
  66. nuitka/build/include/nuitka/helper/boolean.h +17 -17
  67. nuitka/build/include/nuitka/helper/bytearrays.h +17 -17
  68. nuitka/build/include/nuitka/helper/bytes.h +14 -15
  69. nuitka/build/include/nuitka/helper/calling_generated.h +69 -69
  70. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  71. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  72. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  73. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  74. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  75. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  76. nuitka/build/include/nuitka/helper/comparisons_eq.h +17 -17
  77. nuitka/build/include/nuitka/helper/comparisons_ge.h +17 -17
  78. nuitka/build/include/nuitka/helper/comparisons_gt.h +17 -17
  79. nuitka/build/include/nuitka/helper/comparisons_le.h +17 -17
  80. nuitka/build/include/nuitka/helper/comparisons_lt.h +17 -17
  81. nuitka/build/include/nuitka/helper/comparisons_ne.h +17 -17
  82. nuitka/build/include/nuitka/helper/complex.h +17 -17
  83. nuitka/build/include/nuitka/helper/dictionaries.h +89 -51
  84. nuitka/build/include/nuitka/helper/floats.h +17 -18
  85. nuitka/build/include/nuitka/helper/import_hard.h +25 -17
  86. nuitka/build/include/nuitka/helper/indexes.h +17 -18
  87. nuitka/build/include/nuitka/helper/ints.h +115 -54
  88. nuitka/build/include/nuitka/helper/iterators.h +99 -51
  89. nuitka/build/include/nuitka/helper/lists.h +26 -24
  90. nuitka/build/include/nuitka/helper/lists_generated.h +22 -22
  91. nuitka/build/include/nuitka/helper/mappings.h +17 -18
  92. nuitka/build/include/nuitka/helper/operations.h +20 -17
  93. nuitka/build/include/nuitka/helper/operations_binary_add.h +23 -17
  94. nuitka/build/include/nuitka/helper/operations_binary_bitand.h +17 -17
  95. nuitka/build/include/nuitka/helper/operations_binary_bitor.h +17 -17
  96. nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +17 -17
  97. nuitka/build/include/nuitka/helper/operations_binary_divmod.h +17 -17
  98. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  99. nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +17 -17
  100. nuitka/build/include/nuitka/helper/operations_binary_lshift.h +17 -17
  101. nuitka/build/include/nuitka/helper/operations_binary_matmult.h +17 -17
  102. nuitka/build/include/nuitka/helper/operations_binary_mod.h +17 -17
  103. nuitka/build/include/nuitka/helper/operations_binary_mult.h +17 -17
  104. nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +17 -17
  105. nuitka/build/include/nuitka/helper/operations_binary_pow.h +17 -17
  106. nuitka/build/include/nuitka/helper/operations_binary_rshift.h +17 -17
  107. nuitka/build/include/nuitka/helper/operations_binary_sub.h +23 -17
  108. nuitka/build/include/nuitka/helper/operations_binary_truediv.h +17 -17
  109. nuitka/build/include/nuitka/helper/operations_builtin_types.h +17 -17
  110. nuitka/build/include/nuitka/helper/operations_inplace_add.h +20 -17
  111. nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +17 -17
  112. nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +17 -17
  113. nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +17 -17
  114. nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +17 -17
  115. nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +17 -17
  116. nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +17 -17
  117. nuitka/build/include/nuitka/helper/operations_inplace_mod.h +17 -17
  118. nuitka/build/include/nuitka/helper/operations_inplace_mult.h +17 -17
  119. nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +17 -17
  120. nuitka/build/include/nuitka/helper/operations_inplace_pow.h +17 -17
  121. nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +17 -17
  122. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +20 -17
  123. nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +17 -17
  124. nuitka/build/include/nuitka/helper/raising.h +68 -37
  125. nuitka/build/include/nuitka/helper/rangeobjects.h +17 -17
  126. nuitka/build/include/nuitka/helper/richcomparisons.h +21 -14
  127. nuitka/build/include/nuitka/helper/sequences.h +19 -13
  128. nuitka/build/include/nuitka/helper/sets.h +11 -12
  129. nuitka/build/include/nuitka/helper/slices.h +31 -25
  130. nuitka/build/include/nuitka/helper/strings.h +16 -17
  131. nuitka/build/include/nuitka/helper/subscripts.h +18 -201
  132. nuitka/build/include/nuitka/helper/tuples.h +64 -52
  133. nuitka/build/include/nuitka/helpers.h +50 -22
  134. nuitka/build/include/nuitka/importing.h +28 -21
  135. nuitka/build/include/nuitka/jit_sources.h +25 -0
  136. nuitka/build/include/nuitka/prelude.h +163 -71
  137. nuitka/build/include/nuitka/printing.h +29 -22
  138. nuitka/build/include/nuitka/python_pgo.h +19 -18
  139. nuitka/build/include/nuitka/safe_string_ops.h +20 -18
  140. nuitka/build/include/nuitka/threading.h +45 -32
  141. nuitka/build/include/nuitka/tracing.h +28 -18
  142. nuitka/build/include/nuitka/type_aliases.h +30 -0
  143. nuitka/build/include/nuitka/unfreezing.h +29 -23
  144. nuitka/build/inline_copy/bin/scons.py +14 -0
  145. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +6 -6
  146. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
  147. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  148. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  149. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  150. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  151. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  152. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  153. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  154. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  155. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  156. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  157. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  158. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  159. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  160. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  161. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  162. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  163. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  164. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  165. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  166. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  167. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  168. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  169. nuitka/build/inline_copy/stubgen/six.py +998 -0
  170. nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
  171. nuitka/build/inline_copy/tqdm/tqdm/__init__.py +2 -2
  172. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  173. nuitka/build/inline_copy/tqdm/tqdm/utils.py +14 -8
  174. nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -8
  175. nuitka/build/inline_copy/zlib/LICENSE +22 -0
  176. nuitka/build/inline_copy/zlib/crc32.c +1049 -0
  177. nuitka/build/inline_copy/zlib/crc32.h +9446 -0
  178. nuitka/build/inline_copy/zlib/zconf.h +551 -0
  179. nuitka/build/inline_copy/zlib/zlib.h +1938 -0
  180. nuitka/build/inline_copy/zlib/zutil.h +275 -0
  181. nuitka/build/static_src/CompiledAsyncgenType.c +221 -221
  182. nuitka/build/static_src/CompiledCellType.c +69 -44
  183. nuitka/build/static_src/CompiledCodeHelpers.c +276 -159
  184. nuitka/build/static_src/CompiledCoroutineType.c +229 -226
  185. nuitka/build/static_src/CompiledFrameType.c +323 -138
  186. nuitka/build/static_src/CompiledFunctionType.c +547 -231
  187. nuitka/build/static_src/CompiledGeneratorType.c +416 -290
  188. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +593 -228
  189. nuitka/build/static_src/CompiledMethodType.c +91 -82
  190. nuitka/build/static_src/HelpersAllocator.c +352 -45
  191. nuitka/build/static_src/HelpersAttributes.c +30 -72
  192. nuitka/build/static_src/HelpersBuiltin.c +65 -46
  193. nuitka/build/static_src/HelpersBuiltinTypeMethods.c +17 -17
  194. nuitka/build/static_src/HelpersBytes.c +19 -20
  195. nuitka/build/static_src/HelpersCalling.c +40 -37
  196. nuitka/build/static_src/HelpersCallingGenerated.c +1061 -242
  197. nuitka/build/static_src/HelpersChecksumTools.c +35 -21
  198. nuitka/build/static_src/HelpersClasses.c +17 -17
  199. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  200. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  201. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  202. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  203. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  204. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  205. nuitka/build/static_src/HelpersComparisonEq.c +536 -496
  206. nuitka/build/static_src/HelpersComparisonEqUtils.c +22 -19
  207. nuitka/build/static_src/HelpersComparisonGe.c +531 -501
  208. nuitka/build/static_src/HelpersComparisonGt.c +530 -500
  209. nuitka/build/static_src/HelpersComparisonLe.c +531 -501
  210. nuitka/build/static_src/HelpersComparisonLt.c +530 -500
  211. nuitka/build/static_src/HelpersComparisonNe.c +538 -496
  212. nuitka/build/static_src/HelpersConsole.c +122 -0
  213. nuitka/build/static_src/HelpersConstantsBlob.c +550 -521
  214. nuitka/build/static_src/HelpersDeepcopy.c +33 -33
  215. nuitka/build/static_src/HelpersDictionaries.c +232 -63
  216. nuitka/build/static_src/HelpersDictionariesGenerated.c +130 -127
  217. nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
  218. nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
  219. nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +93 -0
  220. nuitka/build/static_src/HelpersExceptions.c +147 -62
  221. nuitka/build/static_src/HelpersFiles.c +116 -22
  222. nuitka/build/static_src/HelpersFilesystemPaths.c +292 -181
  223. nuitka/build/static_src/HelpersFloats.c +37 -31
  224. nuitka/build/static_src/HelpersHeapStorage.c +21 -17
  225. nuitka/build/static_src/HelpersImport.c +61 -29
  226. nuitka/build/static_src/HelpersImportHard.c +74 -61
  227. nuitka/build/static_src/HelpersJitSources.c +46 -0
  228. nuitka/build/static_src/HelpersLists.c +237 -58
  229. nuitka/build/static_src/HelpersListsGenerated.c +41 -41
  230. nuitka/build/static_src/HelpersMappings.c +17 -17
  231. nuitka/build/static_src/HelpersMatching.c +137 -51
  232. nuitka/build/static_src/HelpersOperationBinaryAdd.c +397 -152
  233. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +102 -52
  234. nuitka/build/static_src/HelpersOperationBinaryBitand.c +55 -55
  235. nuitka/build/static_src/HelpersOperationBinaryBitor.c +55 -55
  236. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +55 -55
  237. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +49 -43
  238. nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +17 -17
  239. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  240. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +55 -49
  241. nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +20 -21
  242. nuitka/build/static_src/HelpersOperationBinaryLshift.c +83 -83
  243. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +25 -24
  244. nuitka/build/static_src/HelpersOperationBinaryMod.c +129 -117
  245. nuitka/build/static_src/HelpersOperationBinaryMult.c +98 -82
  246. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +33 -30
  247. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +55 -49
  248. nuitka/build/static_src/HelpersOperationBinaryPow.c +68 -68
  249. nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +12 -12
  250. nuitka/build/static_src/HelpersOperationBinaryRshift.c +51 -51
  251. nuitka/build/static_src/HelpersOperationBinarySub.c +309 -88
  252. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +49 -43
  253. nuitka/build/static_src/HelpersOperationInplaceAdd.c +333 -163
  254. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +24 -22
  255. nuitka/build/static_src/HelpersOperationInplaceBitand.c +58 -58
  256. nuitka/build/static_src/HelpersOperationInplaceBitor.c +58 -58
  257. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +58 -58
  258. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +73 -68
  259. nuitka/build/static_src/HelpersOperationInplaceLshift.c +64 -64
  260. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +38 -37
  261. nuitka/build/static_src/HelpersOperationInplaceMod.c +145 -140
  262. nuitka/build/static_src/HelpersOperationInplaceMult.c +89 -84
  263. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +73 -68
  264. nuitka/build/static_src/HelpersOperationInplacePow.c +82 -82
  265. nuitka/build/static_src/HelpersOperationInplaceRshift.c +48 -48
  266. nuitka/build/static_src/HelpersOperationInplaceSub.c +275 -122
  267. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +68 -63
  268. nuitka/build/static_src/HelpersProfiling.c +25 -24
  269. nuitka/build/static_src/HelpersPythonPgo.c +22 -22
  270. nuitka/build/static_src/HelpersRaising.c +296 -283
  271. nuitka/build/static_src/HelpersSafeStrings.c +34 -22
  272. nuitka/build/static_src/HelpersSequences.c +18 -19
  273. nuitka/build/static_src/HelpersSlices.c +29 -23
  274. nuitka/build/static_src/HelpersStrings.c +235 -38
  275. nuitka/build/static_src/HelpersTuples.c +46 -34
  276. nuitka/build/static_src/HelpersTypes.c +166 -25
  277. nuitka/build/static_src/InspectPatcher.c +108 -27
  278. nuitka/build/static_src/MainProgram.c +464 -280
  279. nuitka/build/static_src/MetaPathBasedLoader.c +381 -257
  280. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +39 -26
  281. nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +17 -18
  282. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +227 -29
  283. nuitka/build/static_src/OnefileBootstrap.c +281 -164
  284. nuitka/build/static_src/OnefileSplashScreen.cpp +51 -27
  285. nuitka/code_generation/AsyncgenCodes.py +21 -23
  286. nuitka/code_generation/AttributeCodes.py +31 -27
  287. nuitka/code_generation/BinaryOperationHelperDefinitions.py +290 -184
  288. nuitka/code_generation/BranchCodes.py +19 -17
  289. nuitka/code_generation/BuiltinCodes.py +29 -18
  290. nuitka/code_generation/CallCodes.py +35 -33
  291. nuitka/code_generation/ClassCodes.py +19 -17
  292. nuitka/code_generation/CodeGeneration.py +61 -28
  293. nuitka/code_generation/CodeHelperSelection.py +20 -18
  294. nuitka/code_generation/CodeHelpers.py +28 -21
  295. nuitka/code_generation/CodeObjectCodes.py +36 -26
  296. nuitka/code_generation/ComparisonCodes.py +51 -22
  297. nuitka/code_generation/ComparisonHelperDefinitions.py +42 -25
  298. nuitka/code_generation/ConditionalCodes.py +19 -17
  299. nuitka/code_generation/ConstantCodes.py +82 -28
  300. nuitka/code_generation/Contexts.py +180 -42
  301. nuitka/code_generation/CoroutineCodes.py +21 -23
  302. nuitka/code_generation/CtypesCodes.py +19 -17
  303. nuitka/code_generation/DictCodes.py +28 -26
  304. nuitka/code_generation/Emission.py +21 -18
  305. nuitka/code_generation/ErrorCodes.py +57 -79
  306. nuitka/code_generation/EvalCodes.py +24 -20
  307. nuitka/code_generation/ExceptionCodes.py +182 -104
  308. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +45 -27
  309. nuitka/code_generation/ExpressionCodes.py +19 -17
  310. nuitka/code_generation/FrameCodes.py +28 -31
  311. nuitka/code_generation/FunctionCodes.py +26 -27
  312. nuitka/code_generation/GeneratorCodes.py +25 -26
  313. nuitka/code_generation/GlobalConstants.py +51 -25
  314. nuitka/code_generation/GlobalsLocalsCodes.py +23 -21
  315. nuitka/code_generation/IdCodes.py +19 -17
  316. nuitka/code_generation/ImportCodes.py +90 -50
  317. nuitka/code_generation/Indentation.py +23 -22
  318. nuitka/code_generation/IndexCodes.py +19 -17
  319. nuitka/code_generation/InjectCCodes.py +14 -12
  320. nuitka/code_generation/IntegerCodes.py +19 -17
  321. nuitka/code_generation/IteratorCodes.py +86 -71
  322. nuitka/code_generation/JitCodes.py +44 -0
  323. nuitka/code_generation/LabelCodes.py +19 -17
  324. nuitka/code_generation/LineNumberCodes.py +20 -20
  325. nuitka/code_generation/ListCodes.py +32 -36
  326. nuitka/code_generation/LoaderCodes.py +22 -17
  327. nuitka/code_generation/LocalsDictCodes.py +56 -32
  328. nuitka/code_generation/LoopCodes.py +19 -17
  329. nuitka/code_generation/MatchCodes.py +42 -22
  330. nuitka/code_generation/ModuleCodes.py +71 -29
  331. nuitka/code_generation/Namify.py +27 -23
  332. nuitka/code_generation/NetworkxCodes.py +51 -0
  333. nuitka/code_generation/OperationCodes.py +80 -51
  334. nuitka/code_generation/PackageResourceCodes.py +96 -23
  335. nuitka/code_generation/PrintCodes.py +19 -17
  336. nuitka/code_generation/PythonAPICodes.py +19 -17
  337. nuitka/code_generation/RaisingCodes.py +183 -107
  338. nuitka/code_generation/Reports.py +32 -22
  339. nuitka/code_generation/ReturnCodes.py +20 -32
  340. nuitka/code_generation/SetCodes.py +19 -17
  341. nuitka/code_generation/SliceCodes.py +22 -20
  342. nuitka/code_generation/StringCodes.py +19 -17
  343. nuitka/code_generation/SubscriptCodes.py +24 -30
  344. nuitka/code_generation/TensorflowCodes.py +54 -0
  345. nuitka/code_generation/TryCodes.py +31 -41
  346. nuitka/code_generation/TupleCodes.py +20 -18
  347. nuitka/code_generation/TypeAliasCodes.py +119 -0
  348. nuitka/code_generation/VariableCodes.py +118 -55
  349. nuitka/code_generation/VariableDeclarations.py +28 -25
  350. nuitka/code_generation/YieldCodes.py +23 -21
  351. nuitka/code_generation/__init__.py +5 -4
  352. nuitka/code_generation/c_types/CTypeBases.py +29 -19
  353. nuitka/code_generation/c_types/CTypeBooleans.py +19 -17
  354. nuitka/code_generation/c_types/CTypeCFloats.py +19 -17
  355. nuitka/code_generation/c_types/CTypeCLongs.py +19 -18
  356. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +22 -17
  357. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +22 -21
  358. nuitka/code_generation/c_types/CTypeNuitkaInts.py +89 -43
  359. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +20 -18
  360. nuitka/code_generation/c_types/CTypePyObjectPointers.py +43 -31
  361. nuitka/code_generation/c_types/CTypeVoids.py +20 -17
  362. nuitka/code_generation/c_types/__init__.py +5 -4
  363. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +20 -19
  364. nuitka/code_generation/templates/CodeTemplatesConstants.py +143 -39
  365. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +20 -19
  366. nuitka/code_generation/templates/CodeTemplatesExceptions.py +33 -33
  367. nuitka/code_generation/templates/CodeTemplatesFrames.py +36 -27
  368. nuitka/code_generation/templates/CodeTemplatesFunction.py +20 -19
  369. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +21 -19
  370. nuitka/code_generation/templates/CodeTemplatesIterators.py +19 -53
  371. nuitka/code_generation/templates/CodeTemplatesLoader.py +25 -19
  372. nuitka/code_generation/templates/CodeTemplatesModules.py +278 -169
  373. nuitka/code_generation/templates/CodeTemplatesVariables.py +115 -27
  374. nuitka/code_generation/templates/TemplateDebugWrapper.py +19 -18
  375. nuitka/code_generation/templates/__init__.py +5 -4
  376. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +19 -19
  377. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +21 -21
  378. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +79 -28
  379. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +22 -22
  380. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +19 -19
  381. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +19 -19
  382. nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +17 -17
  383. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +74 -106
  384. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +19 -20
  385. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +19 -19
  386. nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +6 -6
  387. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +23 -23
  388. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  389. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +35 -35
  390. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +37 -37
  391. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  392. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +17 -17
  393. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +18 -18
  394. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +50 -38
  395. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +27 -27
  396. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +37 -37
  397. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +31 -31
  398. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +35 -31
  399. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +20 -20
  400. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +28 -28
  401. nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +17 -17
  402. nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +17 -17
  403. nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +17 -17
  404. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +48 -48
  405. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +21 -18
  406. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +27 -25
  407. nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +17 -17
  408. nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +17 -17
  409. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +21 -18
  410. nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +17 -17
  411. nuitka/containers/Namedtuples.py +25 -18
  412. nuitka/containers/OrderedSets.py +105 -5
  413. nuitka/containers/OrderedSetsFallback.py +19 -17
  414. nuitka/containers/__init__.py +5 -4
  415. nuitka/distutils/Build.py +33 -18
  416. nuitka/distutils/DistutilCommands.py +84 -33
  417. nuitka/distutils/__init__.py +5 -4
  418. nuitka/finalizations/Finalization.py +21 -18
  419. nuitka/finalizations/FinalizeMarkups.py +31 -55
  420. nuitka/finalizations/__init__.py +5 -4
  421. nuitka/freezer/DependsExe.py +60 -30
  422. nuitka/freezer/DllDependenciesCommon.py +47 -20
  423. nuitka/freezer/DllDependenciesMacOS.py +165 -58
  424. nuitka/freezer/DllDependenciesPosix.py +29 -19
  425. nuitka/freezer/DllDependenciesWin32.py +55 -33
  426. nuitka/freezer/ImportDetection.py +23 -17
  427. nuitka/freezer/IncludedDataFiles.py +142 -48
  428. nuitka/freezer/IncludedEntryPoints.py +104 -39
  429. nuitka/freezer/Onefile.py +32 -22
  430. nuitka/freezer/Standalone.py +166 -53
  431. nuitka/freezer/__init__.py +5 -4
  432. nuitka/importing/IgnoreListing.py +19 -17
  433. nuitka/importing/ImportCache.py +24 -21
  434. nuitka/importing/ImportResolving.py +103 -95
  435. nuitka/importing/Importing.py +319 -98
  436. nuitka/importing/PreloadedPackages.py +21 -18
  437. nuitka/importing/Recursion.py +142 -47
  438. nuitka/importing/StandardLibrary.py +96 -80
  439. nuitka/importing/__init__.py +5 -4
  440. nuitka/nodes/AsyncgenNodes.py +22 -23
  441. nuitka/nodes/AttributeLookupNodes.py +19 -17
  442. nuitka/nodes/AttributeNodes.py +19 -17
  443. nuitka/nodes/AttributeNodesGenerated.py +49 -24
  444. nuitka/nodes/BuiltinAllNodes.py +19 -17
  445. nuitka/nodes/BuiltinAnyNodes.py +19 -17
  446. nuitka/nodes/BuiltinComplexNodes.py +20 -17
  447. nuitka/nodes/BuiltinDecodingNodes.py +19 -17
  448. nuitka/nodes/BuiltinDecoratorNodes.py +19 -17
  449. nuitka/nodes/BuiltinDictNodes.py +19 -17
  450. nuitka/nodes/BuiltinFormatNodes.py +20 -17
  451. nuitka/nodes/BuiltinHashNodes.py +19 -17
  452. nuitka/nodes/BuiltinInputNodes.py +19 -17
  453. nuitka/nodes/BuiltinIntegerNodes.py +19 -17
  454. nuitka/nodes/BuiltinIteratorNodes.py +25 -21
  455. nuitka/nodes/BuiltinLenNodes.py +19 -17
  456. nuitka/nodes/BuiltinNextNodes.py +19 -17
  457. nuitka/nodes/BuiltinOpenNodes.py +52 -18
  458. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +40 -23
  459. nuitka/nodes/BuiltinRangeNodes.py +21 -19
  460. nuitka/nodes/BuiltinRefNodes.py +73 -40
  461. nuitka/nodes/BuiltinSumNodes.py +20 -18
  462. nuitka/nodes/BuiltinTypeNodes.py +19 -17
  463. nuitka/nodes/BuiltinVarsNodes.py +19 -18
  464. nuitka/nodes/BytesNodes.py +19 -17
  465. nuitka/nodes/CallNodes.py +19 -17
  466. nuitka/nodes/Checkers.py +19 -17
  467. nuitka/nodes/ChildrenHavingMixins.py +1624 -283
  468. nuitka/nodes/ClassNodes.py +49 -29
  469. nuitka/nodes/CodeObjectSpecs.py +29 -18
  470. nuitka/nodes/ComparisonNodes.py +19 -17
  471. nuitka/nodes/ConditionalNodes.py +24 -25
  472. nuitka/nodes/ConstantRefNodes.py +57 -17
  473. nuitka/nodes/ContainerMakingNodes.py +19 -17
  474. nuitka/nodes/ContainerOperationNodes.py +19 -17
  475. nuitka/nodes/CoroutineNodes.py +22 -23
  476. nuitka/nodes/CtypesNodes.py +19 -18
  477. nuitka/nodes/DictionaryNodes.py +19 -18
  478. nuitka/nodes/ExceptionNodes.py +131 -43
  479. nuitka/nodes/ExecEvalNodes.py +19 -17
  480. nuitka/nodes/ExpressionBases.py +34 -26
  481. nuitka/nodes/ExpressionBasesGenerated.py +341 -35
  482. nuitka/nodes/ExpressionShapeMixins.py +19 -17
  483. nuitka/nodes/FrameNodes.py +41 -28
  484. nuitka/nodes/FunctionAttributeNodes.py +19 -17
  485. nuitka/nodes/FunctionNodes.py +84 -38
  486. nuitka/nodes/FutureSpecs.py +35 -20
  487. nuitka/nodes/GeneratorNodes.py +24 -25
  488. nuitka/nodes/GlobalsLocalsNodes.py +22 -17
  489. nuitka/nodes/HardImportNodesGenerated.py +746 -148
  490. nuitka/nodes/ImportHardNodes.py +46 -38
  491. nuitka/nodes/ImportNodes.py +438 -448
  492. nuitka/nodes/IndicatorMixins.py +19 -17
  493. nuitka/nodes/InjectCNodes.py +19 -18
  494. nuitka/nodes/IterationHandles.py +55 -34
  495. nuitka/nodes/KeyValuePairNodes.py +19 -17
  496. nuitka/nodes/ListOperationNodes.py +33 -21
  497. nuitka/nodes/LocalsDictNodes.py +19 -17
  498. nuitka/nodes/LocalsScopes.py +41 -41
  499. nuitka/nodes/LoopNodes.py +28 -17
  500. nuitka/nodes/MatchNodes.py +37 -24
  501. nuitka/nodes/ModuleAttributeNodes.py +18 -35
  502. nuitka/nodes/ModuleNodes.py +90 -31
  503. nuitka/nodes/NetworkxNodes.py +45 -0
  504. nuitka/nodes/NodeBases.py +73 -44
  505. nuitka/nodes/NodeMakingHelpers.py +92 -69
  506. nuitka/nodes/NodeMetaClasses.py +45 -28
  507. nuitka/nodes/OperatorNodes.py +28 -26
  508. nuitka/nodes/OperatorNodesUnary.py +148 -20
  509. nuitka/nodes/OsSysNodes.py +97 -18
  510. nuitka/nodes/OutlineNodes.py +24 -22
  511. nuitka/nodes/PackageMetadataNodes.py +37 -27
  512. nuitka/nodes/PackageResourceNodes.py +29 -23
  513. nuitka/nodes/PrintNodes.py +19 -17
  514. nuitka/nodes/ReturnNodes.py +20 -18
  515. nuitka/nodes/SideEffectNodes.py +19 -17
  516. nuitka/nodes/SliceNodes.py +20 -18
  517. nuitka/nodes/StatementBasesGenerated.py +125 -79
  518. nuitka/nodes/StatementNodes.py +27 -24
  519. nuitka/nodes/StrNodes.py +19 -17
  520. nuitka/nodes/StringConcatenationNodes.py +20 -17
  521. nuitka/nodes/SubscriptNodes.py +27 -25
  522. nuitka/nodes/TensorflowNodes.py +38 -0
  523. nuitka/nodes/TryNodes.py +19 -17
  524. nuitka/nodes/TypeMatchNodes.py +19 -17
  525. nuitka/nodes/TypeNodes.py +68 -18
  526. nuitka/nodes/VariableAssignNodes.py +122 -64
  527. nuitka/nodes/VariableDelNodes.py +19 -17
  528. nuitka/nodes/VariableNameNodes.py +19 -17
  529. nuitka/nodes/VariableRefNodes.py +63 -26
  530. nuitka/nodes/VariableReleaseNodes.py +19 -17
  531. nuitka/nodes/YieldNodes.py +21 -19
  532. nuitka/nodes/__init__.py +5 -4
  533. nuitka/nodes/shapes/BuiltinTypeShapes.py +169 -46
  534. nuitka/nodes/shapes/ControlFlowDescriptions.py +19 -17
  535. nuitka/nodes/shapes/ShapeMixins.py +57 -17
  536. nuitka/nodes/shapes/StandardShapes.py +80 -21
  537. nuitka/nodes/shapes/__init__.py +5 -4
  538. nuitka/optimizations/BytecodeDemotion.py +21 -18
  539. nuitka/optimizations/FunctionInlining.py +22 -23
  540. nuitka/optimizations/Graphs.py +19 -17
  541. nuitka/optimizations/Optimization.py +39 -35
  542. nuitka/optimizations/OptimizeBuiltinCalls.py +31 -27
  543. nuitka/optimizations/Tags.py +19 -18
  544. nuitka/optimizations/TraceCollections.py +67 -24
  545. nuitka/optimizations/ValueTraces.py +92 -25
  546. nuitka/optimizations/__init__.py +5 -4
  547. nuitka/pgo/PGO.py +33 -23
  548. nuitka/pgo/__init__.py +5 -4
  549. nuitka/plugins/PluginBase.py +655 -112
  550. nuitka/plugins/Plugins.py +247 -61
  551. nuitka/plugins/YamlPluginBase.py +121 -0
  552. nuitka/plugins/__init__.py +5 -4
  553. nuitka/plugins/standard/AntiBloatPlugin.py +374 -135
  554. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +20 -19
  555. nuitka/plugins/standard/DataFilesPlugin.py +65 -29
  556. nuitka/plugins/standard/DelvewheelPlugin.py +32 -24
  557. nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
  558. nuitka/plugins/standard/DillPlugin/dill-postLoad.py +256 -0
  559. nuitka/plugins/standard/DillPlugin.py +42 -134
  560. nuitka/plugins/standard/DllFilesPlugin.py +125 -42
  561. nuitka/plugins/standard/EnumPlugin.py +19 -17
  562. nuitka/plugins/standard/EventletPlugin.py +19 -17
  563. nuitka/plugins/standard/GeventPlugin.py +19 -17
  564. nuitka/plugins/standard/GiPlugin.py +44 -28
  565. nuitka/plugins/standard/GlfwPlugin.py +20 -17
  566. nuitka/plugins/standard/ImplicitImports.py +403 -54
  567. nuitka/plugins/standard/KivyPlugin.py +24 -20
  568. nuitka/plugins/standard/MatplotlibPlugin.py +99 -42
  569. nuitka/plugins/standard/MultiprocessingPlugin.py +35 -39
  570. nuitka/plugins/standard/NumpyPlugin.py +19 -17
  571. nuitka/plugins/standard/OptionsNannyPlugin.py +48 -76
  572. nuitka/plugins/standard/PbrPlugin.py +21 -19
  573. nuitka/plugins/standard/PkgResourcesPlugin.py +34 -23
  574. nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
  575. nuitka/plugins/standard/PmwPlugin.py +30 -27
  576. nuitka/plugins/standard/PySidePyQtPlugin.py +82 -80
  577. nuitka/plugins/standard/PywebViewPlugin.py +19 -17
  578. nuitka/plugins/standard/SpacyPlugin.py +136 -0
  579. nuitka/plugins/standard/TensorflowPlugin.py +20 -17
  580. nuitka/plugins/standard/TkinterPlugin.py +102 -108
  581. nuitka/plugins/standard/TorchPlugin.py +20 -17
  582. nuitka/plugins/standard/TransformersPlugin.py +90 -231
  583. nuitka/plugins/standard/TrioPlugin.py +18 -15
  584. nuitka/plugins/standard/UpxPlugin.py +21 -19
  585. nuitka/plugins/standard/__init__.py +5 -4
  586. nuitka/plugins/standard/standard.nuitka-package.config.yml +3925 -1293
  587. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +14 -14
  588. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +154 -66
  589. nuitka/reports/CompilationReportReader.py +79 -0
  590. nuitka/reports/LicenseReport.rst.j2 +21 -21
  591. nuitka/reports/Reports.py +363 -76
  592. nuitka/reports/__init__.py +5 -4
  593. nuitka/specs/BuiltinBytesOperationSpecs.py +18 -17
  594. nuitka/specs/BuiltinDictOperationSpecs.py +18 -17
  595. nuitka/specs/BuiltinListOperationSpecs.py +18 -17
  596. nuitka/specs/BuiltinParameterSpecs.py +35 -21
  597. nuitka/specs/BuiltinStrOperationSpecs.py +19 -18
  598. nuitka/specs/BuiltinTypeOperationSpecs.py +18 -18
  599. nuitka/specs/BuiltinUnicodeOperationSpecs.py +18 -17
  600. nuitka/specs/HardImportSpecs.py +74 -22
  601. nuitka/specs/ParameterSpecs.py +60 -45
  602. nuitka/specs/__init__.py +5 -4
  603. nuitka/tools/Basics.py +20 -18
  604. nuitka/tools/__init__.py +5 -4
  605. nuitka/tools/commercial/__init__.py +7 -6
  606. nuitka/tools/data_composer/DataComposer.py +78 -62
  607. nuitka/tools/data_composer/__init__.py +5 -4
  608. nuitka/tools/data_composer/__main__.py +18 -17
  609. nuitka/tools/environments/CreateEnvironment.py +20 -17
  610. nuitka/tools/environments/Virtualenv.py +60 -32
  611. nuitka/tools/environments/__init__.py +5 -4
  612. nuitka/tools/general/__init__.py +5 -4
  613. nuitka/tools/general/dll_report/__init__.py +5 -4
  614. nuitka/tools/general/dll_report/__main__.py +29 -22
  615. nuitka/tools/general/find_module/FindModuleCode.py +35 -22
  616. nuitka/tools/general/find_module/__init__.py +5 -4
  617. nuitka/tools/onefile_compressor/OnefileCompressor.py +213 -131
  618. nuitka/tools/onefile_compressor/__init__.py +5 -4
  619. nuitka/tools/onefile_compressor/__main__.py +18 -17
  620. nuitka/tools/podman/Podman.py +19 -17
  621. nuitka/tools/podman/__init__.py +5 -4
  622. nuitka/tools/podman/__main__.py +35 -19
  623. nuitka/tools/profiler/__init__.py +5 -4
  624. nuitka/tools/profiler/__main__.py +18 -17
  625. nuitka/tools/scanning/DisplayPackageDLLs.py +47 -22
  626. nuitka/tools/scanning/DisplayPackageData.py +31 -19
  627. nuitka/tools/scanning/__init__.py +5 -4
  628. nuitka/tools/specialize/CTypeDescriptions.py +251 -80
  629. nuitka/tools/specialize/Common.py +18 -17
  630. nuitka/tools/specialize/SpecializeC.py +248 -82
  631. nuitka/tools/specialize/SpecializePython.py +108 -45
  632. nuitka/tools/specialize/__init__.py +5 -4
  633. nuitka/tools/testing/Common.py +175 -114
  634. nuitka/tools/testing/Constructs.py +19 -17
  635. nuitka/tools/testing/OutputComparison.py +54 -18
  636. nuitka/tools/testing/Pythons.py +19 -18
  637. nuitka/tools/testing/RuntimeTracing.py +20 -19
  638. nuitka/tools/testing/SearchModes.py +26 -20
  639. nuitka/tools/testing/Valgrind.py +19 -17
  640. nuitka/tools/testing/__init__.py +5 -4
  641. nuitka/tools/testing/check_reference_counts/__init__.py +5 -4
  642. nuitka/tools/testing/check_reference_counts/__main__.py +18 -18
  643. nuitka/tools/testing/compare_with_cpython/__init__.py +5 -4
  644. nuitka/tools/testing/compare_with_cpython/__main__.py +39 -30
  645. nuitka/tools/testing/find_sxs_modules/__init__.py +5 -4
  646. nuitka/tools/testing/find_sxs_modules/__main__.py +17 -17
  647. nuitka/tools/testing/measure_construct_performance/__init__.py +5 -4
  648. nuitka/tools/testing/measure_construct_performance/__main__.py +23 -33
  649. nuitka/tools/testing/run_nuitka_tests/__init__.py +5 -4
  650. nuitka/tools/testing/run_nuitka_tests/__main__.py +134 -51
  651. nuitka/tools/watch/AutoStage.py +145 -0
  652. nuitka/tools/watch/GitHub.py +113 -0
  653. nuitka/tools/watch/__init__.py +5 -4
  654. nuitka/tools/watch/__main__.py +322 -91
  655. nuitka/tree/Building.py +184 -182
  656. nuitka/tree/ComplexCallHelperFunctions.py +84 -58
  657. nuitka/tree/Extractions.py +19 -17
  658. nuitka/tree/InternalModule.py +29 -20
  659. nuitka/tree/Operations.py +19 -17
  660. nuitka/tree/ReformulationAssertStatements.py +51 -31
  661. nuitka/tree/ReformulationAssignmentStatements.py +96 -91
  662. nuitka/tree/ReformulationBooleanExpressions.py +19 -17
  663. nuitka/tree/ReformulationCallExpressions.py +20 -18
  664. nuitka/tree/ReformulationClasses.py +45 -39
  665. nuitka/tree/ReformulationClasses3.py +239 -116
  666. nuitka/tree/ReformulationComparisonExpressions.py +29 -35
  667. nuitka/tree/ReformulationContractionExpressions.py +58 -55
  668. nuitka/tree/ReformulationDictionaryCreation.py +41 -35
  669. nuitka/tree/ReformulationExecStatements.py +42 -39
  670. nuitka/tree/ReformulationForLoopStatements.py +30 -34
  671. nuitka/tree/ReformulationFunctionStatements.py +59 -55
  672. nuitka/tree/ReformulationImportStatements.py +34 -29
  673. nuitka/tree/ReformulationLambdaExpressions.py +23 -24
  674. nuitka/tree/ReformulationMatchStatements.py +246 -92
  675. nuitka/tree/ReformulationMultidist.py +22 -18
  676. nuitka/tree/ReformulationNamespacePackages.py +55 -46
  677. nuitka/tree/ReformulationPrintStatements.py +23 -24
  678. nuitka/tree/ReformulationSequenceCreation.py +50 -49
  679. nuitka/tree/ReformulationSubscriptExpressions.py +19 -17
  680. nuitka/tree/ReformulationTryExceptStatements.py +19 -17
  681. nuitka/tree/ReformulationTryFinallyStatements.py +34 -17
  682. nuitka/tree/ReformulationWhileLoopStatements.py +19 -17
  683. nuitka/tree/ReformulationWithStatements.py +39 -41
  684. nuitka/tree/ReformulationYieldExpressions.py +44 -24
  685. nuitka/tree/SourceHandling.py +76 -31
  686. nuitka/tree/SyntaxErrors.py +19 -17
  687. nuitka/tree/TreeHelpers.py +33 -20
  688. nuitka/tree/VariableClosure.py +35 -39
  689. nuitka/tree/__init__.py +5 -4
  690. nuitka/utils/AppDirs.py +41 -20
  691. nuitka/utils/CStrings.py +66 -21
  692. nuitka/utils/CommandLineOptions.py +111 -22
  693. nuitka/utils/Distributions.py +445 -54
  694. nuitka/utils/Download.py +89 -57
  695. nuitka/utils/Execution.py +102 -58
  696. nuitka/utils/FileOperations.py +357 -128
  697. nuitka/utils/Hashing.py +55 -33
  698. nuitka/utils/Images.py +26 -19
  699. nuitka/utils/Importing.py +119 -37
  700. nuitka/utils/InlineCopies.py +52 -0
  701. nuitka/utils/InstalledPythons.py +85 -75
  702. nuitka/utils/InstanceCounters.py +20 -17
  703. nuitka/utils/Jinja2.py +30 -22
  704. nuitka/utils/Json.py +21 -19
  705. nuitka/utils/MacOSApp.py +26 -18
  706. nuitka/utils/MemoryUsage.py +20 -18
  707. nuitka/utils/ModuleNames.py +42 -26
  708. nuitka/utils/PackageResources.py +44 -0
  709. nuitka/utils/ReExecute.py +50 -28
  710. nuitka/utils/Rest.py +20 -17
  711. nuitka/utils/SharedLibraries.py +161 -75
  712. nuitka/utils/Shebang.py +20 -17
  713. nuitka/utils/Signing.py +63 -18
  714. nuitka/utils/SlotMetaClasses.py +57 -0
  715. nuitka/utils/StaticLibraries.py +83 -56
  716. nuitka/utils/ThreadedExecutor.py +18 -17
  717. nuitka/utils/Timing.py +22 -20
  718. nuitka/utils/Utils.py +132 -25
  719. nuitka/utils/WindowsFileUsage.py +22 -20
  720. nuitka/utils/WindowsResources.py +25 -18
  721. nuitka/utils/Yaml.py +62 -24
  722. nuitka/utils/__init__.py +5 -4
  723. Nuitka_winsvc-1.8.dist-info/RECORD +0 -905
  724. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_gui.py +0 -9
  725. nuitka/build/inline_copy/tqdm/tqdm/gui.py +0 -191
  726. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/LICENSE.txt +0 -0
  727. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/entry_points.txt +0 -0
  728. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.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_LE_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
@@ -73,7 +58,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
73
58
  if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {
74
59
  bool r = true;
75
60
  PyObject *result = BOOL_FROM(r);
76
- Py_INCREF(result);
61
+ Py_INCREF_IMMORTAL(result);
77
62
  return result;
78
63
  }
79
64
 
@@ -94,7 +79,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
94
79
  // If the types are equal, we may get away immediately except for instances.
95
80
  if (type1 == type2 && !PyInstance_Check(operand1)) {
96
81
 
97
- richcmpfunc frich = RICHCOMPARE(type1);
82
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
98
83
 
99
84
  if (frich != NULL) {
100
85
  PyObject *result = (*frich)(operand1, operand2, Py_LE);
@@ -105,7 +90,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
105
90
  return result;
106
91
  }
107
92
 
108
- Py_DECREF(result);
93
+ Py_DECREF_IMMORTAL(result);
109
94
  }
110
95
 
111
96
  // No rich comparison worked, but maybe compare works.
@@ -146,7 +131,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
146
131
 
147
132
  bool r = c != 0;
148
133
  PyObject *result = BOOL_FROM(r);
149
- Py_INCREF(result);
134
+ Py_INCREF_IMMORTAL(result);
150
135
  return result;
151
136
  }
152
137
  }
@@ -155,7 +140,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
155
140
  richcmpfunc f;
156
141
 
157
142
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
158
- f = RICHCOMPARE(type2);
143
+ f = TP_RICHCOMPARE(type2);
159
144
 
160
145
  if (f != NULL) {
161
146
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -166,11 +151,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
166
151
  return result;
167
152
  }
168
153
 
169
- Py_DECREF(result);
154
+ Py_DECREF_IMMORTAL(result);
170
155
  }
171
156
  }
172
157
 
173
- f = RICHCOMPARE(type1);
158
+ f = TP_RICHCOMPARE(type1);
174
159
  if (f != NULL) {
175
160
  PyObject *result = (*f)(operand1, operand2, Py_LE);
176
161
 
@@ -180,10 +165,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
180
165
  return result;
181
166
  }
182
167
 
183
- Py_DECREF(result);
168
+ Py_DECREF_IMMORTAL(result);
184
169
  }
185
170
 
186
- f = RICHCOMPARE(type2);
171
+ f = TP_RICHCOMPARE(type2);
187
172
  if (f != NULL) {
188
173
  PyObject *result = (*f)(operand2, operand1, Py_GE);
189
174
 
@@ -193,7 +178,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
193
178
  return result;
194
179
  }
195
180
 
196
- Py_DECREF(result);
181
+ Py_DECREF_IMMORTAL(result);
197
182
  }
198
183
 
199
184
  int c;
@@ -281,14 +266,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
281
266
 
282
267
  bool r = c != 0;
283
268
  PyObject *result = BOOL_FROM(r);
284
- Py_INCREF(result);
269
+ Py_INCREF_IMMORTAL(result);
285
270
  return result;
286
271
  #else
287
272
  bool checked_reverse_op = false;
288
273
  richcmpfunc f;
289
274
 
290
275
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
291
- f = RICHCOMPARE(type2);
276
+ f = TP_RICHCOMPARE(type2);
292
277
 
293
278
  if (f != NULL) {
294
279
  checked_reverse_op = true;
@@ -301,11 +286,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
301
286
  return result;
302
287
  }
303
288
 
304
- Py_DECREF(result);
289
+ Py_DECREF_IMMORTAL(result);
305
290
  }
306
291
  }
307
292
 
308
- f = RICHCOMPARE(type1);
293
+ f = TP_RICHCOMPARE(type1);
309
294
 
310
295
  if (f != NULL) {
311
296
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -316,11 +301,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
316
301
  return result;
317
302
  }
318
303
 
319
- Py_DECREF(result);
304
+ Py_DECREF_IMMORTAL(result);
320
305
  }
321
306
 
322
307
  if (checked_reverse_op == false) {
323
- f = RICHCOMPARE(type2);
308
+ f = TP_RICHCOMPARE(type2);
324
309
 
325
310
  if (f != NULL) {
326
311
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -331,7 +316,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
331
316
  return result;
332
317
  }
333
318
 
334
- Py_DECREF(result);
319
+ Py_DECREF_IMMORTAL(result);
335
320
  }
336
321
  }
337
322
 
@@ -343,13 +328,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
343
328
  case Py_EQ: {
344
329
  bool r = operand1 == operand2;
345
330
  PyObject *result = BOOL_FROM(r);
346
- Py_INCREF(result);
331
+ Py_INCREF_IMMORTAL(result);
347
332
  return result;
348
333
  }
349
334
  case Py_NE: {
350
335
  bool r = operand1 != operand2;
351
336
  PyObject *result = BOOL_FROM(r);
352
- Py_INCREF(result);
337
+ Py_INCREF_IMMORTAL(result);
353
338
  return result;
354
339
  }
355
340
  default:
@@ -398,7 +383,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
398
383
  // If the types are equal, we may get away immediately except for instances.
399
384
  if (type1 == type2 && !PyInstance_Check(operand1)) {
400
385
 
401
- richcmpfunc frich = RICHCOMPARE(type1);
386
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
402
387
 
403
388
  if (frich != NULL) {
404
389
  PyObject *result = (*frich)(operand1, operand2, Py_LE);
@@ -417,7 +402,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
417
402
  }
418
403
  }
419
404
 
420
- Py_DECREF(result);
405
+ Py_DECREF_IMMORTAL(result);
421
406
  }
422
407
 
423
408
  // No rich comparison worked, but maybe compare works.
@@ -467,7 +452,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
467
452
  richcmpfunc f;
468
453
 
469
454
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
470
- f = RICHCOMPARE(type2);
455
+ f = TP_RICHCOMPARE(type2);
471
456
 
472
457
  if (f != NULL) {
473
458
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -486,11 +471,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
486
471
  }
487
472
  }
488
473
 
489
- Py_DECREF(result);
474
+ Py_DECREF_IMMORTAL(result);
490
475
  }
491
476
  }
492
477
 
493
- f = RICHCOMPARE(type1);
478
+ f = TP_RICHCOMPARE(type1);
494
479
  if (f != NULL) {
495
480
  PyObject *result = (*f)(operand1, operand2, Py_LE);
496
481
 
@@ -508,10 +493,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
508
493
  }
509
494
  }
510
495
 
511
- Py_DECREF(result);
496
+ Py_DECREF_IMMORTAL(result);
512
497
  }
513
498
 
514
- f = RICHCOMPARE(type2);
499
+ f = TP_RICHCOMPARE(type2);
515
500
  if (f != NULL) {
516
501
  PyObject *result = (*f)(operand2, operand1, Py_GE);
517
502
 
@@ -529,7 +514,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
529
514
  }
530
515
  }
531
516
 
532
- Py_DECREF(result);
517
+ Py_DECREF_IMMORTAL(result);
533
518
  }
534
519
 
535
520
  int c;
@@ -624,7 +609,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
624
609
  richcmpfunc f;
625
610
 
626
611
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
627
- f = RICHCOMPARE(type2);
612
+ f = TP_RICHCOMPARE(type2);
628
613
 
629
614
  if (f != NULL) {
630
615
  checked_reverse_op = true;
@@ -645,11 +630,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
645
630
  }
646
631
  }
647
632
 
648
- Py_DECREF(result);
633
+ Py_DECREF_IMMORTAL(result);
649
634
  }
650
635
  }
651
636
 
652
- f = RICHCOMPARE(type1);
637
+ f = TP_RICHCOMPARE(type1);
653
638
 
654
639
  if (f != NULL) {
655
640
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -668,11 +653,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
668
653
  }
669
654
  }
670
655
 
671
- Py_DECREF(result);
656
+ Py_DECREF_IMMORTAL(result);
672
657
  }
673
658
 
674
659
  if (checked_reverse_op == false) {
675
- f = RICHCOMPARE(type2);
660
+ f = TP_RICHCOMPARE(type2);
676
661
 
677
662
  if (f != NULL) {
678
663
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -691,7 +676,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
691
676
  }
692
677
  }
693
678
 
694
- Py_DECREF(result);
679
+ Py_DECREF_IMMORTAL(result);
695
680
  }
696
681
  }
697
682
 
@@ -740,7 +725,7 @@ static PyObject *COMPARE_LE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
740
725
 
741
726
  // Convert to target type.
742
727
  PyObject *result = BOOL_FROM(r);
743
- Py_INCREF(result);
728
+ Py_INCREF_IMMORTAL(result);
744
729
  return result;
745
730
  }
746
731
 
@@ -768,9 +753,11 @@ static PyObject *COMPARE_LE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
768
753
 
769
754
  // Convert to target type.
770
755
  PyObject *result = BOOL_FROM(c != 0);
771
- Py_INCREF(result);
756
+ Py_INCREF_IMMORTAL(result);
772
757
  return result;
773
758
  }
759
+ #endif
760
+ #if PYTHON_VERSION < 0x300
774
761
  /* Code referring to "OBJECT" corresponds to any Python object and "STR" to Python2 'str'. */
775
762
  PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {
776
763
 
@@ -805,7 +792,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
805
792
  return result;
806
793
  }
807
794
 
808
- Py_DECREF(result);
795
+ Py_DECREF_IMMORTAL(result);
809
796
  }
810
797
 
811
798
  // No rich comparison worked, but maybe compare works.
@@ -846,7 +833,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
846
833
 
847
834
  bool r = c != 0;
848
835
  PyObject *result = BOOL_FROM(r);
849
- Py_INCREF(result);
836
+ Py_INCREF_IMMORTAL(result);
850
837
  return result;
851
838
  }
852
839
  }
@@ -866,11 +853,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
866
853
  return result;
867
854
  }
868
855
 
869
- Py_DECREF(result);
856
+ Py_DECREF_IMMORTAL(result);
870
857
  }
871
858
  }
872
859
 
873
- f = RICHCOMPARE(type1);
860
+ f = TP_RICHCOMPARE(type1);
874
861
  if (f != NULL) {
875
862
  PyObject *result = (*f)(operand1, operand2, Py_LE);
876
863
 
@@ -880,7 +867,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
880
867
  return result;
881
868
  }
882
869
 
883
- Py_DECREF(result);
870
+ Py_DECREF_IMMORTAL(result);
884
871
  }
885
872
 
886
873
  f = PyString_Type.tp_richcompare;
@@ -893,7 +880,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
893
880
  return result;
894
881
  }
895
882
 
896
- Py_DECREF(result);
883
+ Py_DECREF_IMMORTAL(result);
897
884
  }
898
885
 
899
886
  int c;
@@ -981,7 +968,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
981
968
 
982
969
  bool r = c != 0;
983
970
  PyObject *result = BOOL_FROM(r);
984
- Py_INCREF(result);
971
+ Py_INCREF_IMMORTAL(result);
985
972
  return result;
986
973
  #else
987
974
  bool checked_reverse_op = false;
@@ -1001,11 +988,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1001
988
  return result;
1002
989
  }
1003
990
 
1004
- Py_DECREF(result);
991
+ Py_DECREF_IMMORTAL(result);
1005
992
  }
1006
993
  }
1007
994
 
1008
- f = RICHCOMPARE(type1);
995
+ f = TP_RICHCOMPARE(type1);
1009
996
 
1010
997
  if (f != NULL) {
1011
998
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -1016,7 +1003,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1016
1003
  return result;
1017
1004
  }
1018
1005
 
1019
- Py_DECREF(result);
1006
+ Py_DECREF_IMMORTAL(result);
1020
1007
  }
1021
1008
 
1022
1009
  if (checked_reverse_op == false) {
@@ -1031,7 +1018,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1031
1018
  return result;
1032
1019
  }
1033
1020
 
1034
- Py_DECREF(result);
1021
+ Py_DECREF_IMMORTAL(result);
1035
1022
  }
1036
1023
  }
1037
1024
 
@@ -1043,13 +1030,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1043
1030
  case Py_EQ: {
1044
1031
  bool r = operand1 == operand2;
1045
1032
  PyObject *result = BOOL_FROM(r);
1046
- Py_INCREF(result);
1033
+ Py_INCREF_IMMORTAL(result);
1047
1034
  return result;
1048
1035
  }
1049
1036
  case Py_NE: {
1050
1037
  bool r = operand1 != operand2;
1051
1038
  PyObject *result = BOOL_FROM(r);
1052
- Py_INCREF(result);
1039
+ Py_INCREF_IMMORTAL(result);
1053
1040
  return result;
1054
1041
  }
1055
1042
  default:
@@ -1099,7 +1086,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1099
1086
  return result;
1100
1087
  }
1101
1088
 
1102
- Py_DECREF(result);
1089
+ Py_DECREF_IMMORTAL(result);
1103
1090
  }
1104
1091
 
1105
1092
  // No rich comparison worked, but maybe compare works.
@@ -1140,7 +1127,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1140
1127
 
1141
1128
  bool r = c != 0;
1142
1129
  PyObject *result = BOOL_FROM(r);
1143
- Py_INCREF(result);
1130
+ Py_INCREF_IMMORTAL(result);
1144
1131
  return result;
1145
1132
  }
1146
1133
  }
@@ -1149,7 +1136,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1149
1136
  richcmpfunc f;
1150
1137
 
1151
1138
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1152
- f = RICHCOMPARE(type2);
1139
+ f = TP_RICHCOMPARE(type2);
1153
1140
 
1154
1141
  if (f != NULL) {
1155
1142
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -1160,7 +1147,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1160
1147
  return result;
1161
1148
  }
1162
1149
 
1163
- Py_DECREF(result);
1150
+ Py_DECREF_IMMORTAL(result);
1164
1151
  }
1165
1152
  }
1166
1153
 
@@ -1174,10 +1161,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1174
1161
  return result;
1175
1162
  }
1176
1163
 
1177
- Py_DECREF(result);
1164
+ Py_DECREF_IMMORTAL(result);
1178
1165
  }
1179
1166
 
1180
- f = RICHCOMPARE(type2);
1167
+ f = TP_RICHCOMPARE(type2);
1181
1168
  if (f != NULL) {
1182
1169
  PyObject *result = (*f)(operand2, operand1, Py_GE);
1183
1170
 
@@ -1187,7 +1174,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1187
1174
  return result;
1188
1175
  }
1189
1176
 
1190
- Py_DECREF(result);
1177
+ Py_DECREF_IMMORTAL(result);
1191
1178
  }
1192
1179
 
1193
1180
  int c;
@@ -1275,14 +1262,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1275
1262
 
1276
1263
  bool r = c != 0;
1277
1264
  PyObject *result = BOOL_FROM(r);
1278
- Py_INCREF(result);
1265
+ Py_INCREF_IMMORTAL(result);
1279
1266
  return result;
1280
1267
  #else
1281
1268
  bool checked_reverse_op = false;
1282
1269
  richcmpfunc f;
1283
1270
 
1284
1271
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1285
- f = RICHCOMPARE(type2);
1272
+ f = TP_RICHCOMPARE(type2);
1286
1273
 
1287
1274
  if (f != NULL) {
1288
1275
  checked_reverse_op = true;
@@ -1295,7 +1282,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1295
1282
  return result;
1296
1283
  }
1297
1284
 
1298
- Py_DECREF(result);
1285
+ Py_DECREF_IMMORTAL(result);
1299
1286
  }
1300
1287
  }
1301
1288
 
@@ -1310,11 +1297,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1310
1297
  return result;
1311
1298
  }
1312
1299
 
1313
- Py_DECREF(result);
1300
+ Py_DECREF_IMMORTAL(result);
1314
1301
  }
1315
1302
 
1316
1303
  if (checked_reverse_op == false) {
1317
- f = RICHCOMPARE(type2);
1304
+ f = TP_RICHCOMPARE(type2);
1318
1305
 
1319
1306
  if (f != NULL) {
1320
1307
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -1325,7 +1312,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1325
1312
  return result;
1326
1313
  }
1327
1314
 
1328
- Py_DECREF(result);
1315
+ Py_DECREF_IMMORTAL(result);
1329
1316
  }
1330
1317
  }
1331
1318
 
@@ -1337,13 +1324,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1337
1324
  case Py_EQ: {
1338
1325
  bool r = operand1 == operand2;
1339
1326
  PyObject *result = BOOL_FROM(r);
1340
- Py_INCREF(result);
1327
+ Py_INCREF_IMMORTAL(result);
1341
1328
  return result;
1342
1329
  }
1343
1330
  case Py_NE: {
1344
1331
  bool r = operand1 != operand2;
1345
1332
  PyObject *result = BOOL_FROM(r);
1346
- Py_INCREF(result);
1333
+ Py_INCREF_IMMORTAL(result);
1347
1334
  return result;
1348
1335
  }
1349
1336
  default:
@@ -1413,6 +1400,8 @@ static bool COMPARE_LE_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {
1413
1400
 
1414
1401
  return result;
1415
1402
  }
1403
+ #endif
1404
+ #if PYTHON_VERSION < 0x300
1416
1405
  /* Code referring to "STR" corresponds to Python2 'str' and "STR" to Python2 'str'. */
1417
1406
  bool RICH_COMPARE_LE_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {
1418
1407
 
@@ -1463,7 +1452,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1463
1452
  }
1464
1453
  }
1465
1454
 
1466
- Py_DECREF(result);
1455
+ Py_DECREF_IMMORTAL(result);
1467
1456
  }
1468
1457
 
1469
1458
  // No rich comparison worked, but maybe compare works.
@@ -1532,11 +1521,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1532
1521
  }
1533
1522
  }
1534
1523
 
1535
- Py_DECREF(result);
1524
+ Py_DECREF_IMMORTAL(result);
1536
1525
  }
1537
1526
  }
1538
1527
 
1539
- f = RICHCOMPARE(type1);
1528
+ f = TP_RICHCOMPARE(type1);
1540
1529
  if (f != NULL) {
1541
1530
  PyObject *result = (*f)(operand1, operand2, Py_LE);
1542
1531
 
@@ -1554,7 +1543,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1554
1543
  }
1555
1544
  }
1556
1545
 
1557
- Py_DECREF(result);
1546
+ Py_DECREF_IMMORTAL(result);
1558
1547
  }
1559
1548
 
1560
1549
  f = PyString_Type.tp_richcompare;
@@ -1575,7 +1564,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1575
1564
  }
1576
1565
  }
1577
1566
 
1578
- Py_DECREF(result);
1567
+ Py_DECREF_IMMORTAL(result);
1579
1568
  }
1580
1569
 
1581
1570
  int c;
@@ -1691,11 +1680,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1691
1680
  }
1692
1681
  }
1693
1682
 
1694
- Py_DECREF(result);
1683
+ Py_DECREF_IMMORTAL(result);
1695
1684
  }
1696
1685
  }
1697
1686
 
1698
- f = RICHCOMPARE(type1);
1687
+ f = TP_RICHCOMPARE(type1);
1699
1688
 
1700
1689
  if (f != NULL) {
1701
1690
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -1714,7 +1703,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1714
1703
  }
1715
1704
  }
1716
1705
 
1717
- Py_DECREF(result);
1706
+ Py_DECREF_IMMORTAL(result);
1718
1707
  }
1719
1708
 
1720
1709
  if (checked_reverse_op == false) {
@@ -1737,7 +1726,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1737
1726
  }
1738
1727
  }
1739
1728
 
1740
- Py_DECREF(result);
1729
+ Py_DECREF_IMMORTAL(result);
1741
1730
  }
1742
1731
  }
1743
1732
 
@@ -1813,7 +1802,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1813
1802
  }
1814
1803
  }
1815
1804
 
1816
- Py_DECREF(result);
1805
+ Py_DECREF_IMMORTAL(result);
1817
1806
  }
1818
1807
 
1819
1808
  // No rich comparison worked, but maybe compare works.
@@ -1863,7 +1852,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1863
1852
  richcmpfunc f;
1864
1853
 
1865
1854
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1866
- f = RICHCOMPARE(type2);
1855
+ f = TP_RICHCOMPARE(type2);
1867
1856
 
1868
1857
  if (f != NULL) {
1869
1858
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -1882,7 +1871,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1882
1871
  }
1883
1872
  }
1884
1873
 
1885
- Py_DECREF(result);
1874
+ Py_DECREF_IMMORTAL(result);
1886
1875
  }
1887
1876
  }
1888
1877
 
@@ -1904,10 +1893,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1904
1893
  }
1905
1894
  }
1906
1895
 
1907
- Py_DECREF(result);
1896
+ Py_DECREF_IMMORTAL(result);
1908
1897
  }
1909
1898
 
1910
- f = RICHCOMPARE(type2);
1899
+ f = TP_RICHCOMPARE(type2);
1911
1900
  if (f != NULL) {
1912
1901
  PyObject *result = (*f)(operand2, operand1, Py_GE);
1913
1902
 
@@ -1925,7 +1914,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1925
1914
  }
1926
1915
  }
1927
1916
 
1928
- Py_DECREF(result);
1917
+ Py_DECREF_IMMORTAL(result);
1929
1918
  }
1930
1919
 
1931
1920
  int c;
@@ -2020,7 +2009,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2020
2009
  richcmpfunc f;
2021
2010
 
2022
2011
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
2023
- f = RICHCOMPARE(type2);
2012
+ f = TP_RICHCOMPARE(type2);
2024
2013
 
2025
2014
  if (f != NULL) {
2026
2015
  checked_reverse_op = true;
@@ -2041,7 +2030,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2041
2030
  }
2042
2031
  }
2043
2032
 
2044
- Py_DECREF(result);
2033
+ Py_DECREF_IMMORTAL(result);
2045
2034
  }
2046
2035
  }
2047
2036
 
@@ -2064,11 +2053,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2064
2053
  }
2065
2054
  }
2066
2055
 
2067
- Py_DECREF(result);
2056
+ Py_DECREF_IMMORTAL(result);
2068
2057
  }
2069
2058
 
2070
2059
  if (checked_reverse_op == false) {
2071
- f = RICHCOMPARE(type2);
2060
+ f = TP_RICHCOMPARE(type2);
2072
2061
 
2073
2062
  if (f != NULL) {
2074
2063
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -2087,7 +2076,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2087
2076
  }
2088
2077
  }
2089
2078
 
2090
- Py_DECREF(result);
2079
+ Py_DECREF_IMMORTAL(result);
2091
2080
  }
2092
2081
  }
2093
2082
 
@@ -2135,7 +2124,7 @@ static PyObject *COMPARE_LE_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject
2135
2124
 
2136
2125
  // Convert to target type.
2137
2126
  PyObject *result = BOOL_FROM(r);
2138
- Py_INCREF(result);
2127
+ Py_INCREF_IMMORTAL(result);
2139
2128
  return result;
2140
2129
  }
2141
2130
 
@@ -2178,7 +2167,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2178
2167
  return result;
2179
2168
  }
2180
2169
 
2181
- Py_DECREF(result);
2170
+ Py_DECREF_IMMORTAL(result);
2182
2171
  }
2183
2172
 
2184
2173
  // No rich comparison worked, but maybe compare works.
@@ -2219,7 +2208,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2219
2208
 
2220
2209
  bool r = c != 0;
2221
2210
  PyObject *result = BOOL_FROM(r);
2222
- Py_INCREF(result);
2211
+ Py_INCREF_IMMORTAL(result);
2223
2212
  return result;
2224
2213
  }
2225
2214
  }
@@ -2239,11 +2228,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2239
2228
  return result;
2240
2229
  }
2241
2230
 
2242
- Py_DECREF(result);
2231
+ Py_DECREF_IMMORTAL(result);
2243
2232
  }
2244
2233
  }
2245
2234
 
2246
- f = RICHCOMPARE(type1);
2235
+ f = TP_RICHCOMPARE(type1);
2247
2236
  if (f != NULL) {
2248
2237
  PyObject *result = (*f)(operand1, operand2, Py_LE);
2249
2238
 
@@ -2253,7 +2242,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2253
2242
  return result;
2254
2243
  }
2255
2244
 
2256
- Py_DECREF(result);
2245
+ Py_DECREF_IMMORTAL(result);
2257
2246
  }
2258
2247
 
2259
2248
  f = PyUnicode_Type.tp_richcompare;
@@ -2266,7 +2255,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2266
2255
  return result;
2267
2256
  }
2268
2257
 
2269
- Py_DECREF(result);
2258
+ Py_DECREF_IMMORTAL(result);
2270
2259
  }
2271
2260
 
2272
2261
  int c;
@@ -2354,7 +2343,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2354
2343
 
2355
2344
  bool r = c != 0;
2356
2345
  PyObject *result = BOOL_FROM(r);
2357
- Py_INCREF(result);
2346
+ Py_INCREF_IMMORTAL(result);
2358
2347
  return result;
2359
2348
  #else
2360
2349
  bool checked_reverse_op = false;
@@ -2374,11 +2363,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2374
2363
  return result;
2375
2364
  }
2376
2365
 
2377
- Py_DECREF(result);
2366
+ Py_DECREF_IMMORTAL(result);
2378
2367
  }
2379
2368
  }
2380
2369
 
2381
- f = RICHCOMPARE(type1);
2370
+ f = TP_RICHCOMPARE(type1);
2382
2371
 
2383
2372
  if (f != NULL) {
2384
2373
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -2389,7 +2378,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2389
2378
  return result;
2390
2379
  }
2391
2380
 
2392
- Py_DECREF(result);
2381
+ Py_DECREF_IMMORTAL(result);
2393
2382
  }
2394
2383
 
2395
2384
  if (checked_reverse_op == false) {
@@ -2404,7 +2393,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2404
2393
  return result;
2405
2394
  }
2406
2395
 
2407
- Py_DECREF(result);
2396
+ Py_DECREF_IMMORTAL(result);
2408
2397
  }
2409
2398
  }
2410
2399
 
@@ -2416,13 +2405,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2416
2405
  case Py_EQ: {
2417
2406
  bool r = operand1 == operand2;
2418
2407
  PyObject *result = BOOL_FROM(r);
2419
- Py_INCREF(result);
2408
+ Py_INCREF_IMMORTAL(result);
2420
2409
  return result;
2421
2410
  }
2422
2411
  case Py_NE: {
2423
2412
  bool r = operand1 != operand2;
2424
2413
  PyObject *result = BOOL_FROM(r);
2425
- Py_INCREF(result);
2414
+ Py_INCREF_IMMORTAL(result);
2426
2415
  return result;
2427
2416
  }
2428
2417
  default:
@@ -2472,7 +2461,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2472
2461
  return result;
2473
2462
  }
2474
2463
 
2475
- Py_DECREF(result);
2464
+ Py_DECREF_IMMORTAL(result);
2476
2465
  }
2477
2466
 
2478
2467
  // No rich comparison worked, but maybe compare works.
@@ -2513,7 +2502,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2513
2502
 
2514
2503
  bool r = c != 0;
2515
2504
  PyObject *result = BOOL_FROM(r);
2516
- Py_INCREF(result);
2505
+ Py_INCREF_IMMORTAL(result);
2517
2506
  return result;
2518
2507
  }
2519
2508
  }
@@ -2522,7 +2511,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2522
2511
  richcmpfunc f;
2523
2512
 
2524
2513
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2525
- f = RICHCOMPARE(type2);
2514
+ f = TP_RICHCOMPARE(type2);
2526
2515
 
2527
2516
  if (f != NULL) {
2528
2517
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -2533,7 +2522,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2533
2522
  return result;
2534
2523
  }
2535
2524
 
2536
- Py_DECREF(result);
2525
+ Py_DECREF_IMMORTAL(result);
2537
2526
  }
2538
2527
  }
2539
2528
 
@@ -2547,10 +2536,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2547
2536
  return result;
2548
2537
  }
2549
2538
 
2550
- Py_DECREF(result);
2539
+ Py_DECREF_IMMORTAL(result);
2551
2540
  }
2552
2541
 
2553
- f = RICHCOMPARE(type2);
2542
+ f = TP_RICHCOMPARE(type2);
2554
2543
  if (f != NULL) {
2555
2544
  PyObject *result = (*f)(operand2, operand1, Py_GE);
2556
2545
 
@@ -2560,7 +2549,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2560
2549
  return result;
2561
2550
  }
2562
2551
 
2563
- Py_DECREF(result);
2552
+ Py_DECREF_IMMORTAL(result);
2564
2553
  }
2565
2554
 
2566
2555
  int c;
@@ -2648,14 +2637,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2648
2637
 
2649
2638
  bool r = c != 0;
2650
2639
  PyObject *result = BOOL_FROM(r);
2651
- Py_INCREF(result);
2640
+ Py_INCREF_IMMORTAL(result);
2652
2641
  return result;
2653
2642
  #else
2654
2643
  bool checked_reverse_op = false;
2655
2644
  richcmpfunc f;
2656
2645
 
2657
2646
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2658
- f = RICHCOMPARE(type2);
2647
+ f = TP_RICHCOMPARE(type2);
2659
2648
 
2660
2649
  if (f != NULL) {
2661
2650
  checked_reverse_op = true;
@@ -2668,7 +2657,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2668
2657
  return result;
2669
2658
  }
2670
2659
 
2671
- Py_DECREF(result);
2660
+ Py_DECREF_IMMORTAL(result);
2672
2661
  }
2673
2662
  }
2674
2663
 
@@ -2683,11 +2672,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2683
2672
  return result;
2684
2673
  }
2685
2674
 
2686
- Py_DECREF(result);
2675
+ Py_DECREF_IMMORTAL(result);
2687
2676
  }
2688
2677
 
2689
2678
  if (checked_reverse_op == false) {
2690
- f = RICHCOMPARE(type2);
2679
+ f = TP_RICHCOMPARE(type2);
2691
2680
 
2692
2681
  if (f != NULL) {
2693
2682
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -2698,7 +2687,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2698
2687
  return result;
2699
2688
  }
2700
2689
 
2701
- Py_DECREF(result);
2690
+ Py_DECREF_IMMORTAL(result);
2702
2691
  }
2703
2692
  }
2704
2693
 
@@ -2710,13 +2699,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2710
2699
  case Py_EQ: {
2711
2700
  bool r = operand1 == operand2;
2712
2701
  PyObject *result = BOOL_FROM(r);
2713
- Py_INCREF(result);
2702
+ Py_INCREF_IMMORTAL(result);
2714
2703
  return result;
2715
2704
  }
2716
2705
  case Py_NE: {
2717
2706
  bool r = operand1 != operand2;
2718
2707
  PyObject *result = BOOL_FROM(r);
2719
- Py_INCREF(result);
2708
+ Py_INCREF_IMMORTAL(result);
2720
2709
  return result;
2721
2710
  }
2722
2711
  default:
@@ -2763,7 +2752,7 @@ static bool COMPARE_LE_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *opera
2763
2752
 
2764
2753
  // Convert to target type if necessary
2765
2754
  bool result = r == Py_True;
2766
- Py_DECREF(r);
2755
+ Py_DECREF_IMMORTAL(r);
2767
2756
 
2768
2757
  return result;
2769
2758
  }
@@ -2816,7 +2805,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2816
2805
  }
2817
2806
  }
2818
2807
 
2819
- Py_DECREF(result);
2808
+ Py_DECREF_IMMORTAL(result);
2820
2809
  }
2821
2810
 
2822
2811
  // No rich comparison worked, but maybe compare works.
@@ -2885,11 +2874,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2885
2874
  }
2886
2875
  }
2887
2876
 
2888
- Py_DECREF(result);
2877
+ Py_DECREF_IMMORTAL(result);
2889
2878
  }
2890
2879
  }
2891
2880
 
2892
- f = RICHCOMPARE(type1);
2881
+ f = TP_RICHCOMPARE(type1);
2893
2882
  if (f != NULL) {
2894
2883
  PyObject *result = (*f)(operand1, operand2, Py_LE);
2895
2884
 
@@ -2907,7 +2896,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2907
2896
  }
2908
2897
  }
2909
2898
 
2910
- Py_DECREF(result);
2899
+ Py_DECREF_IMMORTAL(result);
2911
2900
  }
2912
2901
 
2913
2902
  f = PyUnicode_Type.tp_richcompare;
@@ -2928,7 +2917,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2928
2917
  }
2929
2918
  }
2930
2919
 
2931
- Py_DECREF(result);
2920
+ Py_DECREF_IMMORTAL(result);
2932
2921
  }
2933
2922
 
2934
2923
  int c;
@@ -3044,11 +3033,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3044
3033
  }
3045
3034
  }
3046
3035
 
3047
- Py_DECREF(result);
3036
+ Py_DECREF_IMMORTAL(result);
3048
3037
  }
3049
3038
  }
3050
3039
 
3051
- f = RICHCOMPARE(type1);
3040
+ f = TP_RICHCOMPARE(type1);
3052
3041
 
3053
3042
  if (f != NULL) {
3054
3043
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -3067,7 +3056,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3067
3056
  }
3068
3057
  }
3069
3058
 
3070
- Py_DECREF(result);
3059
+ Py_DECREF_IMMORTAL(result);
3071
3060
  }
3072
3061
 
3073
3062
  if (checked_reverse_op == false) {
@@ -3090,7 +3079,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3090
3079
  }
3091
3080
  }
3092
3081
 
3093
- Py_DECREF(result);
3082
+ Py_DECREF_IMMORTAL(result);
3094
3083
  }
3095
3084
  }
3096
3085
 
@@ -3166,7 +3155,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3166
3155
  }
3167
3156
  }
3168
3157
 
3169
- Py_DECREF(result);
3158
+ Py_DECREF_IMMORTAL(result);
3170
3159
  }
3171
3160
 
3172
3161
  // No rich comparison worked, but maybe compare works.
@@ -3216,7 +3205,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3216
3205
  richcmpfunc f;
3217
3206
 
3218
3207
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3219
- f = RICHCOMPARE(type2);
3208
+ f = TP_RICHCOMPARE(type2);
3220
3209
 
3221
3210
  if (f != NULL) {
3222
3211
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -3235,7 +3224,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3235
3224
  }
3236
3225
  }
3237
3226
 
3238
- Py_DECREF(result);
3227
+ Py_DECREF_IMMORTAL(result);
3239
3228
  }
3240
3229
  }
3241
3230
 
@@ -3257,10 +3246,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3257
3246
  }
3258
3247
  }
3259
3248
 
3260
- Py_DECREF(result);
3249
+ Py_DECREF_IMMORTAL(result);
3261
3250
  }
3262
3251
 
3263
- f = RICHCOMPARE(type2);
3252
+ f = TP_RICHCOMPARE(type2);
3264
3253
  if (f != NULL) {
3265
3254
  PyObject *result = (*f)(operand2, operand1, Py_GE);
3266
3255
 
@@ -3278,7 +3267,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3278
3267
  }
3279
3268
  }
3280
3269
 
3281
- Py_DECREF(result);
3270
+ Py_DECREF_IMMORTAL(result);
3282
3271
  }
3283
3272
 
3284
3273
  int c;
@@ -3373,7 +3362,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3373
3362
  richcmpfunc f;
3374
3363
 
3375
3364
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3376
- f = RICHCOMPARE(type2);
3365
+ f = TP_RICHCOMPARE(type2);
3377
3366
 
3378
3367
  if (f != NULL) {
3379
3368
  checked_reverse_op = true;
@@ -3394,7 +3383,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3394
3383
  }
3395
3384
  }
3396
3385
 
3397
- Py_DECREF(result);
3386
+ Py_DECREF_IMMORTAL(result);
3398
3387
  }
3399
3388
  }
3400
3389
 
@@ -3417,11 +3406,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3417
3406
  }
3418
3407
  }
3419
3408
 
3420
- Py_DECREF(result);
3409
+ Py_DECREF_IMMORTAL(result);
3421
3410
  }
3422
3411
 
3423
3412
  if (checked_reverse_op == false) {
3424
- f = RICHCOMPARE(type2);
3413
+ f = TP_RICHCOMPARE(type2);
3425
3414
 
3426
3415
  if (f != NULL) {
3427
3416
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -3440,7 +3429,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3440
3429
  }
3441
3430
  }
3442
3431
 
3443
- Py_DECREF(result);
3432
+ Py_DECREF_IMMORTAL(result);
3444
3433
  }
3445
3434
  }
3446
3435
 
@@ -3490,7 +3479,7 @@ static PyObject *COMPARE_LE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3490
3479
 
3491
3480
  // Convert to target type.
3492
3481
  PyObject *result = BOOL_FROM(r);
3493
- Py_INCREF(result);
3482
+ Py_INCREF_IMMORTAL(result);
3494
3483
  return result;
3495
3484
  }
3496
3485
 
@@ -3518,9 +3507,11 @@ static PyObject *COMPARE_LE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3518
3507
 
3519
3508
  // Convert to target type.
3520
3509
  PyObject *result = BOOL_FROM(c != 0);
3521
- Py_INCREF(result);
3510
+ Py_INCREF_IMMORTAL(result);
3522
3511
  return result;
3523
3512
  }
3513
+ #endif
3514
+ #if PYTHON_VERSION >= 0x300
3524
3515
  /* Code referring to "OBJECT" corresponds to any Python object and "BYTES" to Python3 'bytes'. */
3525
3516
  PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {
3526
3517
 
@@ -3555,7 +3546,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3555
3546
  return result;
3556
3547
  }
3557
3548
 
3558
- Py_DECREF(result);
3549
+ Py_DECREF_IMMORTAL(result);
3559
3550
  }
3560
3551
 
3561
3552
  // No rich comparison worked, but maybe compare works.
@@ -3596,7 +3587,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3596
3587
 
3597
3588
  bool r = c != 0;
3598
3589
  PyObject *result = BOOL_FROM(r);
3599
- Py_INCREF(result);
3590
+ Py_INCREF_IMMORTAL(result);
3600
3591
  return result;
3601
3592
  }
3602
3593
  }
@@ -3616,11 +3607,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3616
3607
  return result;
3617
3608
  }
3618
3609
 
3619
- Py_DECREF(result);
3610
+ Py_DECREF_IMMORTAL(result);
3620
3611
  }
3621
3612
  }
3622
3613
 
3623
- f = RICHCOMPARE(type1);
3614
+ f = TP_RICHCOMPARE(type1);
3624
3615
  if (f != NULL) {
3625
3616
  PyObject *result = (*f)(operand1, operand2, Py_LE);
3626
3617
 
@@ -3630,7 +3621,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3630
3621
  return result;
3631
3622
  }
3632
3623
 
3633
- Py_DECREF(result);
3624
+ Py_DECREF_IMMORTAL(result);
3634
3625
  }
3635
3626
 
3636
3627
  f = PyBytes_Type.tp_richcompare;
@@ -3643,7 +3634,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3643
3634
  return result;
3644
3635
  }
3645
3636
 
3646
- Py_DECREF(result);
3637
+ Py_DECREF_IMMORTAL(result);
3647
3638
  }
3648
3639
 
3649
3640
  int c;
@@ -3731,7 +3722,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3731
3722
 
3732
3723
  bool r = c != 0;
3733
3724
  PyObject *result = BOOL_FROM(r);
3734
- Py_INCREF(result);
3725
+ Py_INCREF_IMMORTAL(result);
3735
3726
  return result;
3736
3727
  #else
3737
3728
  bool checked_reverse_op = false;
@@ -3751,11 +3742,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3751
3742
  return result;
3752
3743
  }
3753
3744
 
3754
- Py_DECREF(result);
3745
+ Py_DECREF_IMMORTAL(result);
3755
3746
  }
3756
3747
  }
3757
3748
 
3758
- f = RICHCOMPARE(type1);
3749
+ f = TP_RICHCOMPARE(type1);
3759
3750
 
3760
3751
  if (f != NULL) {
3761
3752
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -3766,7 +3757,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3766
3757
  return result;
3767
3758
  }
3768
3759
 
3769
- Py_DECREF(result);
3760
+ Py_DECREF_IMMORTAL(result);
3770
3761
  }
3771
3762
 
3772
3763
  if (checked_reverse_op == false) {
@@ -3781,7 +3772,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3781
3772
  return result;
3782
3773
  }
3783
3774
 
3784
- Py_DECREF(result);
3775
+ Py_DECREF_IMMORTAL(result);
3785
3776
  }
3786
3777
  }
3787
3778
 
@@ -3793,13 +3784,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3793
3784
  case Py_EQ: {
3794
3785
  bool r = operand1 == operand2;
3795
3786
  PyObject *result = BOOL_FROM(r);
3796
- Py_INCREF(result);
3787
+ Py_INCREF_IMMORTAL(result);
3797
3788
  return result;
3798
3789
  }
3799
3790
  case Py_NE: {
3800
3791
  bool r = operand1 != operand2;
3801
3792
  PyObject *result = BOOL_FROM(r);
3802
- Py_INCREF(result);
3793
+ Py_INCREF_IMMORTAL(result);
3803
3794
  return result;
3804
3795
  }
3805
3796
  default:
@@ -3849,7 +3840,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3849
3840
  return result;
3850
3841
  }
3851
3842
 
3852
- Py_DECREF(result);
3843
+ Py_DECREF_IMMORTAL(result);
3853
3844
  }
3854
3845
 
3855
3846
  // No rich comparison worked, but maybe compare works.
@@ -3890,7 +3881,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3890
3881
 
3891
3882
  bool r = c != 0;
3892
3883
  PyObject *result = BOOL_FROM(r);
3893
- Py_INCREF(result);
3884
+ Py_INCREF_IMMORTAL(result);
3894
3885
  return result;
3895
3886
  }
3896
3887
  }
@@ -3899,7 +3890,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3899
3890
  richcmpfunc f;
3900
3891
 
3901
3892
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
3902
- f = RICHCOMPARE(type2);
3893
+ f = TP_RICHCOMPARE(type2);
3903
3894
 
3904
3895
  if (f != NULL) {
3905
3896
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -3910,7 +3901,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3910
3901
  return result;
3911
3902
  }
3912
3903
 
3913
- Py_DECREF(result);
3904
+ Py_DECREF_IMMORTAL(result);
3914
3905
  }
3915
3906
  }
3916
3907
 
@@ -3924,10 +3915,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3924
3915
  return result;
3925
3916
  }
3926
3917
 
3927
- Py_DECREF(result);
3918
+ Py_DECREF_IMMORTAL(result);
3928
3919
  }
3929
3920
 
3930
- f = RICHCOMPARE(type2);
3921
+ f = TP_RICHCOMPARE(type2);
3931
3922
  if (f != NULL) {
3932
3923
  PyObject *result = (*f)(operand2, operand1, Py_GE);
3933
3924
 
@@ -3937,7 +3928,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3937
3928
  return result;
3938
3929
  }
3939
3930
 
3940
- Py_DECREF(result);
3931
+ Py_DECREF_IMMORTAL(result);
3941
3932
  }
3942
3933
 
3943
3934
  int c;
@@ -4025,14 +4016,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4025
4016
 
4026
4017
  bool r = c != 0;
4027
4018
  PyObject *result = BOOL_FROM(r);
4028
- Py_INCREF(result);
4019
+ Py_INCREF_IMMORTAL(result);
4029
4020
  return result;
4030
4021
  #else
4031
4022
  bool checked_reverse_op = false;
4032
4023
  richcmpfunc f;
4033
4024
 
4034
4025
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4035
- f = RICHCOMPARE(type2);
4026
+ f = TP_RICHCOMPARE(type2);
4036
4027
 
4037
4028
  if (f != NULL) {
4038
4029
  checked_reverse_op = true;
@@ -4045,7 +4036,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4045
4036
  return result;
4046
4037
  }
4047
4038
 
4048
- Py_DECREF(result);
4039
+ Py_DECREF_IMMORTAL(result);
4049
4040
  }
4050
4041
  }
4051
4042
 
@@ -4060,11 +4051,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4060
4051
  return result;
4061
4052
  }
4062
4053
 
4063
- Py_DECREF(result);
4054
+ Py_DECREF_IMMORTAL(result);
4064
4055
  }
4065
4056
 
4066
4057
  if (checked_reverse_op == false) {
4067
- f = RICHCOMPARE(type2);
4058
+ f = TP_RICHCOMPARE(type2);
4068
4059
 
4069
4060
  if (f != NULL) {
4070
4061
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -4075,7 +4066,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4075
4066
  return result;
4076
4067
  }
4077
4068
 
4078
- Py_DECREF(result);
4069
+ Py_DECREF_IMMORTAL(result);
4079
4070
  }
4080
4071
  }
4081
4072
 
@@ -4087,13 +4078,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4087
4078
  case Py_EQ: {
4088
4079
  bool r = operand1 == operand2;
4089
4080
  PyObject *result = BOOL_FROM(r);
4090
- Py_INCREF(result);
4081
+ Py_INCREF_IMMORTAL(result);
4091
4082
  return result;
4092
4083
  }
4093
4084
  case Py_NE: {
4094
4085
  bool r = operand1 != operand2;
4095
4086
  PyObject *result = BOOL_FROM(r);
4096
- Py_INCREF(result);
4087
+ Py_INCREF_IMMORTAL(result);
4097
4088
  return result;
4098
4089
  }
4099
4090
  default:
@@ -4163,6 +4154,8 @@ static bool COMPARE_LE_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2)
4163
4154
 
4164
4155
  return result;
4165
4156
  }
4157
+ #endif
4158
+ #if PYTHON_VERSION >= 0x300
4166
4159
  /* Code referring to "BYTES" corresponds to Python3 'bytes' and "BYTES" to Python3 'bytes'. */
4167
4160
  bool RICH_COMPARE_LE_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {
4168
4161
 
@@ -4213,7 +4206,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4213
4206
  }
4214
4207
  }
4215
4208
 
4216
- Py_DECREF(result);
4209
+ Py_DECREF_IMMORTAL(result);
4217
4210
  }
4218
4211
 
4219
4212
  // No rich comparison worked, but maybe compare works.
@@ -4282,11 +4275,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4282
4275
  }
4283
4276
  }
4284
4277
 
4285
- Py_DECREF(result);
4278
+ Py_DECREF_IMMORTAL(result);
4286
4279
  }
4287
4280
  }
4288
4281
 
4289
- f = RICHCOMPARE(type1);
4282
+ f = TP_RICHCOMPARE(type1);
4290
4283
  if (f != NULL) {
4291
4284
  PyObject *result = (*f)(operand1, operand2, Py_LE);
4292
4285
 
@@ -4304,7 +4297,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4304
4297
  }
4305
4298
  }
4306
4299
 
4307
- Py_DECREF(result);
4300
+ Py_DECREF_IMMORTAL(result);
4308
4301
  }
4309
4302
 
4310
4303
  f = PyBytes_Type.tp_richcompare;
@@ -4325,7 +4318,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4325
4318
  }
4326
4319
  }
4327
4320
 
4328
- Py_DECREF(result);
4321
+ Py_DECREF_IMMORTAL(result);
4329
4322
  }
4330
4323
 
4331
4324
  int c;
@@ -4441,11 +4434,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4441
4434
  }
4442
4435
  }
4443
4436
 
4444
- Py_DECREF(result);
4437
+ Py_DECREF_IMMORTAL(result);
4445
4438
  }
4446
4439
  }
4447
4440
 
4448
- f = RICHCOMPARE(type1);
4441
+ f = TP_RICHCOMPARE(type1);
4449
4442
 
4450
4443
  if (f != NULL) {
4451
4444
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -4464,7 +4457,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4464
4457
  }
4465
4458
  }
4466
4459
 
4467
- Py_DECREF(result);
4460
+ Py_DECREF_IMMORTAL(result);
4468
4461
  }
4469
4462
 
4470
4463
  if (checked_reverse_op == false) {
@@ -4487,7 +4480,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4487
4480
  }
4488
4481
  }
4489
4482
 
4490
- Py_DECREF(result);
4483
+ Py_DECREF_IMMORTAL(result);
4491
4484
  }
4492
4485
  }
4493
4486
 
@@ -4563,7 +4556,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4563
4556
  }
4564
4557
  }
4565
4558
 
4566
- Py_DECREF(result);
4559
+ Py_DECREF_IMMORTAL(result);
4567
4560
  }
4568
4561
 
4569
4562
  // No rich comparison worked, but maybe compare works.
@@ -4613,7 +4606,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4613
4606
  richcmpfunc f;
4614
4607
 
4615
4608
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4616
- f = RICHCOMPARE(type2);
4609
+ f = TP_RICHCOMPARE(type2);
4617
4610
 
4618
4611
  if (f != NULL) {
4619
4612
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -4632,7 +4625,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4632
4625
  }
4633
4626
  }
4634
4627
 
4635
- Py_DECREF(result);
4628
+ Py_DECREF_IMMORTAL(result);
4636
4629
  }
4637
4630
  }
4638
4631
 
@@ -4654,10 +4647,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4654
4647
  }
4655
4648
  }
4656
4649
 
4657
- Py_DECREF(result);
4650
+ Py_DECREF_IMMORTAL(result);
4658
4651
  }
4659
4652
 
4660
- f = RICHCOMPARE(type2);
4653
+ f = TP_RICHCOMPARE(type2);
4661
4654
  if (f != NULL) {
4662
4655
  PyObject *result = (*f)(operand2, operand1, Py_GE);
4663
4656
 
@@ -4675,7 +4668,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4675
4668
  }
4676
4669
  }
4677
4670
 
4678
- Py_DECREF(result);
4671
+ Py_DECREF_IMMORTAL(result);
4679
4672
  }
4680
4673
 
4681
4674
  int c;
@@ -4770,7 +4763,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4770
4763
  richcmpfunc f;
4771
4764
 
4772
4765
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4773
- f = RICHCOMPARE(type2);
4766
+ f = TP_RICHCOMPARE(type2);
4774
4767
 
4775
4768
  if (f != NULL) {
4776
4769
  checked_reverse_op = true;
@@ -4791,7 +4784,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4791
4784
  }
4792
4785
  }
4793
4786
 
4794
- Py_DECREF(result);
4787
+ Py_DECREF_IMMORTAL(result);
4795
4788
  }
4796
4789
  }
4797
4790
 
@@ -4814,11 +4807,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4814
4807
  }
4815
4808
  }
4816
4809
 
4817
- Py_DECREF(result);
4810
+ Py_DECREF_IMMORTAL(result);
4818
4811
  }
4819
4812
 
4820
4813
  if (checked_reverse_op == false) {
4821
- f = RICHCOMPARE(type2);
4814
+ f = TP_RICHCOMPARE(type2);
4822
4815
 
4823
4816
  if (f != NULL) {
4824
4817
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -4837,7 +4830,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4837
4830
  }
4838
4831
  }
4839
4832
 
4840
- Py_DECREF(result);
4833
+ Py_DECREF_IMMORTAL(result);
4841
4834
  }
4842
4835
  }
4843
4836
 
@@ -4905,7 +4898,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4905
4898
  return result;
4906
4899
  }
4907
4900
 
4908
- Py_DECREF(result);
4901
+ Py_DECREF_IMMORTAL(result);
4909
4902
  }
4910
4903
 
4911
4904
  // No rich comparison worked, but maybe compare works.
@@ -4946,7 +4939,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4946
4939
 
4947
4940
  bool r = c != 0;
4948
4941
  PyObject *result = BOOL_FROM(r);
4949
- Py_INCREF(result);
4942
+ Py_INCREF_IMMORTAL(result);
4950
4943
  return result;
4951
4944
  }
4952
4945
  }
@@ -4966,11 +4959,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4966
4959
  return result;
4967
4960
  }
4968
4961
 
4969
- Py_DECREF(result);
4962
+ Py_DECREF_IMMORTAL(result);
4970
4963
  }
4971
4964
  }
4972
4965
 
4973
- f = RICHCOMPARE(type1);
4966
+ f = TP_RICHCOMPARE(type1);
4974
4967
  if (f != NULL) {
4975
4968
  PyObject *result = (*f)(operand1, operand2, Py_LE);
4976
4969
 
@@ -4980,7 +4973,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4980
4973
  return result;
4981
4974
  }
4982
4975
 
4983
- Py_DECREF(result);
4976
+ Py_DECREF_IMMORTAL(result);
4984
4977
  }
4985
4978
 
4986
4979
  f = NULL;
@@ -4993,7 +4986,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4993
4986
  return result;
4994
4987
  }
4995
4988
 
4996
- Py_DECREF(result);
4989
+ Py_DECREF_IMMORTAL(result);
4997
4990
  }
4998
4991
 
4999
4992
  int c;
@@ -5081,7 +5074,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5081
5074
 
5082
5075
  bool r = c != 0;
5083
5076
  PyObject *result = BOOL_FROM(r);
5084
- Py_INCREF(result);
5077
+ Py_INCREF_IMMORTAL(result);
5085
5078
  return result;
5086
5079
  #else
5087
5080
  bool checked_reverse_op = false;
@@ -5101,11 +5094,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5101
5094
  return result;
5102
5095
  }
5103
5096
 
5104
- Py_DECREF(result);
5097
+ Py_DECREF_IMMORTAL(result);
5105
5098
  }
5106
5099
  }
5107
5100
 
5108
- f = RICHCOMPARE(type1);
5101
+ f = TP_RICHCOMPARE(type1);
5109
5102
 
5110
5103
  if (f != NULL) {
5111
5104
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -5116,7 +5109,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5116
5109
  return result;
5117
5110
  }
5118
5111
 
5119
- Py_DECREF(result);
5112
+ Py_DECREF_IMMORTAL(result);
5120
5113
  }
5121
5114
 
5122
5115
  if (checked_reverse_op == false) {
@@ -5131,7 +5124,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5131
5124
  return result;
5132
5125
  }
5133
5126
 
5134
- Py_DECREF(result);
5127
+ Py_DECREF_IMMORTAL(result);
5135
5128
  }
5136
5129
  }
5137
5130
 
@@ -5143,13 +5136,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5143
5136
  case Py_EQ: {
5144
5137
  bool r = operand1 == operand2;
5145
5138
  PyObject *result = BOOL_FROM(r);
5146
- Py_INCREF(result);
5139
+ Py_INCREF_IMMORTAL(result);
5147
5140
  return result;
5148
5141
  }
5149
5142
  case Py_NE: {
5150
5143
  bool r = operand1 != operand2;
5151
5144
  PyObject *result = BOOL_FROM(r);
5152
- Py_INCREF(result);
5145
+ Py_INCREF_IMMORTAL(result);
5153
5146
  return result;
5154
5147
  }
5155
5148
  default:
@@ -5199,7 +5192,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5199
5192
  return result;
5200
5193
  }
5201
5194
 
5202
- Py_DECREF(result);
5195
+ Py_DECREF_IMMORTAL(result);
5203
5196
  }
5204
5197
 
5205
5198
  // No rich comparison worked, but maybe compare works.
@@ -5240,7 +5233,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5240
5233
 
5241
5234
  bool r = c != 0;
5242
5235
  PyObject *result = BOOL_FROM(r);
5243
- Py_INCREF(result);
5236
+ Py_INCREF_IMMORTAL(result);
5244
5237
  return result;
5245
5238
  }
5246
5239
  }
@@ -5249,7 +5242,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5249
5242
  richcmpfunc f;
5250
5243
 
5251
5244
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5252
- f = RICHCOMPARE(type2);
5245
+ f = TP_RICHCOMPARE(type2);
5253
5246
 
5254
5247
  if (f != NULL) {
5255
5248
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -5260,7 +5253,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5260
5253
  return result;
5261
5254
  }
5262
5255
 
5263
- Py_DECREF(result);
5256
+ Py_DECREF_IMMORTAL(result);
5264
5257
  }
5265
5258
  }
5266
5259
 
@@ -5274,10 +5267,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5274
5267
  return result;
5275
5268
  }
5276
5269
 
5277
- Py_DECREF(result);
5270
+ Py_DECREF_IMMORTAL(result);
5278
5271
  }
5279
5272
 
5280
- f = RICHCOMPARE(type2);
5273
+ f = TP_RICHCOMPARE(type2);
5281
5274
  if (f != NULL) {
5282
5275
  PyObject *result = (*f)(operand2, operand1, Py_GE);
5283
5276
 
@@ -5287,7 +5280,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5287
5280
  return result;
5288
5281
  }
5289
5282
 
5290
- Py_DECREF(result);
5283
+ Py_DECREF_IMMORTAL(result);
5291
5284
  }
5292
5285
 
5293
5286
  int c;
@@ -5375,14 +5368,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5375
5368
 
5376
5369
  bool r = c != 0;
5377
5370
  PyObject *result = BOOL_FROM(r);
5378
- Py_INCREF(result);
5371
+ Py_INCREF_IMMORTAL(result);
5379
5372
  return result;
5380
5373
  #else
5381
5374
  bool checked_reverse_op = false;
5382
5375
  richcmpfunc f;
5383
5376
 
5384
5377
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5385
- f = RICHCOMPARE(type2);
5378
+ f = TP_RICHCOMPARE(type2);
5386
5379
 
5387
5380
  if (f != NULL) {
5388
5381
  checked_reverse_op = true;
@@ -5395,7 +5388,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5395
5388
  return result;
5396
5389
  }
5397
5390
 
5398
- Py_DECREF(result);
5391
+ Py_DECREF_IMMORTAL(result);
5399
5392
  }
5400
5393
  }
5401
5394
 
@@ -5410,11 +5403,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5410
5403
  return result;
5411
5404
  }
5412
5405
 
5413
- Py_DECREF(result);
5406
+ Py_DECREF_IMMORTAL(result);
5414
5407
  }
5415
5408
 
5416
5409
  if (checked_reverse_op == false) {
5417
- f = RICHCOMPARE(type2);
5410
+ f = TP_RICHCOMPARE(type2);
5418
5411
 
5419
5412
  if (f != NULL) {
5420
5413
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -5425,7 +5418,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5425
5418
  return result;
5426
5419
  }
5427
5420
 
5428
- Py_DECREF(result);
5421
+ Py_DECREF_IMMORTAL(result);
5429
5422
  }
5430
5423
  }
5431
5424
 
@@ -5437,13 +5430,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5437
5430
  case Py_EQ: {
5438
5431
  bool r = operand1 == operand2;
5439
5432
  PyObject *result = BOOL_FROM(r);
5440
- Py_INCREF(result);
5433
+ Py_INCREF_IMMORTAL(result);
5441
5434
  return result;
5442
5435
  }
5443
5436
  case Py_NE: {
5444
5437
  bool r = operand1 != operand2;
5445
5438
  PyObject *result = BOOL_FROM(r);
5446
- Py_INCREF(result);
5439
+ Py_INCREF_IMMORTAL(result);
5447
5440
  return result;
5448
5441
  }
5449
5442
  default:
@@ -5517,7 +5510,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5517
5510
  }
5518
5511
  }
5519
5512
 
5520
- Py_DECREF(result);
5513
+ Py_DECREF_IMMORTAL(result);
5521
5514
  }
5522
5515
 
5523
5516
  // No rich comparison worked, but maybe compare works.
@@ -5586,11 +5579,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5586
5579
  }
5587
5580
  }
5588
5581
 
5589
- Py_DECREF(result);
5582
+ Py_DECREF_IMMORTAL(result);
5590
5583
  }
5591
5584
  }
5592
5585
 
5593
- f = RICHCOMPARE(type1);
5586
+ f = TP_RICHCOMPARE(type1);
5594
5587
  if (f != NULL) {
5595
5588
  PyObject *result = (*f)(operand1, operand2, Py_LE);
5596
5589
 
@@ -5608,7 +5601,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5608
5601
  }
5609
5602
  }
5610
5603
 
5611
- Py_DECREF(result);
5604
+ Py_DECREF_IMMORTAL(result);
5612
5605
  }
5613
5606
 
5614
5607
  f = NULL;
@@ -5629,7 +5622,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5629
5622
  }
5630
5623
  }
5631
5624
 
5632
- Py_DECREF(result);
5625
+ Py_DECREF_IMMORTAL(result);
5633
5626
  }
5634
5627
 
5635
5628
  int c;
@@ -5745,11 +5738,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5745
5738
  }
5746
5739
  }
5747
5740
 
5748
- Py_DECREF(result);
5741
+ Py_DECREF_IMMORTAL(result);
5749
5742
  }
5750
5743
  }
5751
5744
 
5752
- f = RICHCOMPARE(type1);
5745
+ f = TP_RICHCOMPARE(type1);
5753
5746
 
5754
5747
  if (f != NULL) {
5755
5748
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -5768,7 +5761,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5768
5761
  }
5769
5762
  }
5770
5763
 
5771
- Py_DECREF(result);
5764
+ Py_DECREF_IMMORTAL(result);
5772
5765
  }
5773
5766
 
5774
5767
  if (checked_reverse_op == false) {
@@ -5791,7 +5784,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5791
5784
  }
5792
5785
  }
5793
5786
 
5794
- Py_DECREF(result);
5787
+ Py_DECREF_IMMORTAL(result);
5795
5788
  }
5796
5789
  }
5797
5790
 
@@ -5867,7 +5860,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5867
5860
  }
5868
5861
  }
5869
5862
 
5870
- Py_DECREF(result);
5863
+ Py_DECREF_IMMORTAL(result);
5871
5864
  }
5872
5865
 
5873
5866
  // No rich comparison worked, but maybe compare works.
@@ -5917,7 +5910,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5917
5910
  richcmpfunc f;
5918
5911
 
5919
5912
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5920
- f = RICHCOMPARE(type2);
5913
+ f = TP_RICHCOMPARE(type2);
5921
5914
 
5922
5915
  if (f != NULL) {
5923
5916
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -5936,7 +5929,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5936
5929
  }
5937
5930
  }
5938
5931
 
5939
- Py_DECREF(result);
5932
+ Py_DECREF_IMMORTAL(result);
5940
5933
  }
5941
5934
  }
5942
5935
 
@@ -5958,10 +5951,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5958
5951
  }
5959
5952
  }
5960
5953
 
5961
- Py_DECREF(result);
5954
+ Py_DECREF_IMMORTAL(result);
5962
5955
  }
5963
5956
 
5964
- f = RICHCOMPARE(type2);
5957
+ f = TP_RICHCOMPARE(type2);
5965
5958
  if (f != NULL) {
5966
5959
  PyObject *result = (*f)(operand2, operand1, Py_GE);
5967
5960
 
@@ -5979,7 +5972,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5979
5972
  }
5980
5973
  }
5981
5974
 
5982
- Py_DECREF(result);
5975
+ Py_DECREF_IMMORTAL(result);
5983
5976
  }
5984
5977
 
5985
5978
  int c;
@@ -6074,7 +6067,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6074
6067
  richcmpfunc f;
6075
6068
 
6076
6069
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
6077
- f = RICHCOMPARE(type2);
6070
+ f = TP_RICHCOMPARE(type2);
6078
6071
 
6079
6072
  if (f != NULL) {
6080
6073
  checked_reverse_op = true;
@@ -6095,7 +6088,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6095
6088
  }
6096
6089
  }
6097
6090
 
6098
- Py_DECREF(result);
6091
+ Py_DECREF_IMMORTAL(result);
6099
6092
  }
6100
6093
  }
6101
6094
 
@@ -6118,11 +6111,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6118
6111
  }
6119
6112
  }
6120
6113
 
6121
- Py_DECREF(result);
6114
+ Py_DECREF_IMMORTAL(result);
6122
6115
  }
6123
6116
 
6124
6117
  if (checked_reverse_op == false) {
6125
- f = RICHCOMPARE(type2);
6118
+ f = TP_RICHCOMPARE(type2);
6126
6119
 
6127
6120
  if (f != NULL) {
6128
6121
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -6141,7 +6134,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6141
6134
  }
6142
6135
  }
6143
6136
 
6144
- Py_DECREF(result);
6137
+ Py_DECREF_IMMORTAL(result);
6145
6138
  }
6146
6139
  }
6147
6140
 
@@ -6188,15 +6181,19 @@ static PyObject *COMPARE_LE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6188
6181
 
6189
6182
  if (operand1_long_object == operand2_long_object) {
6190
6183
  r = true;
6191
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6192
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;
6184
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6185
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6186
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) <
6187
+ 0;
6193
6188
  } else {
6194
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6189
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6195
6190
  r = true;
6196
6191
  while (--i >= 0) {
6197
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6198
- r = operand1_long_object->ob_digit[i] < operand2_long_object->ob_digit[i];
6199
- if (Py_SIZE(operand1_long_object) < 0) {
6192
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6193
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6194
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <
6195
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6196
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6200
6197
  r = !r;
6201
6198
  }
6202
6199
  break;
@@ -6206,7 +6203,7 @@ static PyObject *COMPARE_LE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6206
6203
 
6207
6204
  // Convert to target type.
6208
6205
  PyObject *result = BOOL_FROM(r);
6209
- Py_INCREF(result);
6206
+ Py_INCREF_IMMORTAL(result);
6210
6207
  return result;
6211
6208
  }
6212
6209
  /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
@@ -6243,7 +6240,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6243
6240
  return result;
6244
6241
  }
6245
6242
 
6246
- Py_DECREF(result);
6243
+ Py_DECREF_IMMORTAL(result);
6247
6244
  }
6248
6245
 
6249
6246
  // No rich comparison worked, but maybe compare works.
@@ -6284,7 +6281,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6284
6281
 
6285
6282
  bool r = c != 0;
6286
6283
  PyObject *result = BOOL_FROM(r);
6287
- Py_INCREF(result);
6284
+ Py_INCREF_IMMORTAL(result);
6288
6285
  return result;
6289
6286
  }
6290
6287
  }
@@ -6304,11 +6301,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6304
6301
  return result;
6305
6302
  }
6306
6303
 
6307
- Py_DECREF(result);
6304
+ Py_DECREF_IMMORTAL(result);
6308
6305
  }
6309
6306
  }
6310
6307
 
6311
- f = RICHCOMPARE(type1);
6308
+ f = TP_RICHCOMPARE(type1);
6312
6309
  if (f != NULL) {
6313
6310
  PyObject *result = (*f)(operand1, operand2, Py_LE);
6314
6311
 
@@ -6318,7 +6315,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6318
6315
  return result;
6319
6316
  }
6320
6317
 
6321
- Py_DECREF(result);
6318
+ Py_DECREF_IMMORTAL(result);
6322
6319
  }
6323
6320
 
6324
6321
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6331,7 +6328,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6331
6328
  return result;
6332
6329
  }
6333
6330
 
6334
- Py_DECREF(result);
6331
+ Py_DECREF_IMMORTAL(result);
6335
6332
  }
6336
6333
 
6337
6334
  int c;
@@ -6419,7 +6416,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6419
6416
 
6420
6417
  bool r = c != 0;
6421
6418
  PyObject *result = BOOL_FROM(r);
6422
- Py_INCREF(result);
6419
+ Py_INCREF_IMMORTAL(result);
6423
6420
  return result;
6424
6421
  #else
6425
6422
  bool checked_reverse_op = false;
@@ -6439,11 +6436,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6439
6436
  return result;
6440
6437
  }
6441
6438
 
6442
- Py_DECREF(result);
6439
+ Py_DECREF_IMMORTAL(result);
6443
6440
  }
6444
6441
  }
6445
6442
 
6446
- f = RICHCOMPARE(type1);
6443
+ f = TP_RICHCOMPARE(type1);
6447
6444
 
6448
6445
  if (f != NULL) {
6449
6446
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -6454,7 +6451,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6454
6451
  return result;
6455
6452
  }
6456
6453
 
6457
- Py_DECREF(result);
6454
+ Py_DECREF_IMMORTAL(result);
6458
6455
  }
6459
6456
 
6460
6457
  if (checked_reverse_op == false) {
@@ -6469,7 +6466,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6469
6466
  return result;
6470
6467
  }
6471
6468
 
6472
- Py_DECREF(result);
6469
+ Py_DECREF_IMMORTAL(result);
6473
6470
  }
6474
6471
  }
6475
6472
 
@@ -6481,13 +6478,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6481
6478
  case Py_EQ: {
6482
6479
  bool r = operand1 == operand2;
6483
6480
  PyObject *result = BOOL_FROM(r);
6484
- Py_INCREF(result);
6481
+ Py_INCREF_IMMORTAL(result);
6485
6482
  return result;
6486
6483
  }
6487
6484
  case Py_NE: {
6488
6485
  bool r = operand1 != operand2;
6489
6486
  PyObject *result = BOOL_FROM(r);
6490
- Py_INCREF(result);
6487
+ Py_INCREF_IMMORTAL(result);
6491
6488
  return result;
6492
6489
  }
6493
6490
  default:
@@ -6537,7 +6534,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6537
6534
  return result;
6538
6535
  }
6539
6536
 
6540
- Py_DECREF(result);
6537
+ Py_DECREF_IMMORTAL(result);
6541
6538
  }
6542
6539
 
6543
6540
  // No rich comparison worked, but maybe compare works.
@@ -6578,7 +6575,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6578
6575
 
6579
6576
  bool r = c != 0;
6580
6577
  PyObject *result = BOOL_FROM(r);
6581
- Py_INCREF(result);
6578
+ Py_INCREF_IMMORTAL(result);
6582
6579
  return result;
6583
6580
  }
6584
6581
  }
@@ -6587,7 +6584,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6587
6584
  richcmpfunc f;
6588
6585
 
6589
6586
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6590
- f = RICHCOMPARE(type2);
6587
+ f = TP_RICHCOMPARE(type2);
6591
6588
 
6592
6589
  if (f != NULL) {
6593
6590
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -6598,7 +6595,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6598
6595
  return result;
6599
6596
  }
6600
6597
 
6601
- Py_DECREF(result);
6598
+ Py_DECREF_IMMORTAL(result);
6602
6599
  }
6603
6600
  }
6604
6601
 
@@ -6612,10 +6609,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6612
6609
  return result;
6613
6610
  }
6614
6611
 
6615
- Py_DECREF(result);
6612
+ Py_DECREF_IMMORTAL(result);
6616
6613
  }
6617
6614
 
6618
- f = RICHCOMPARE(type2);
6615
+ f = TP_RICHCOMPARE(type2);
6619
6616
  if (f != NULL) {
6620
6617
  PyObject *result = (*f)(operand2, operand1, Py_GE);
6621
6618
 
@@ -6625,7 +6622,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6625
6622
  return result;
6626
6623
  }
6627
6624
 
6628
- Py_DECREF(result);
6625
+ Py_DECREF_IMMORTAL(result);
6629
6626
  }
6630
6627
 
6631
6628
  int c;
@@ -6713,14 +6710,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6713
6710
 
6714
6711
  bool r = c != 0;
6715
6712
  PyObject *result = BOOL_FROM(r);
6716
- Py_INCREF(result);
6713
+ Py_INCREF_IMMORTAL(result);
6717
6714
  return result;
6718
6715
  #else
6719
6716
  bool checked_reverse_op = false;
6720
6717
  richcmpfunc f;
6721
6718
 
6722
6719
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6723
- f = RICHCOMPARE(type2);
6720
+ f = TP_RICHCOMPARE(type2);
6724
6721
 
6725
6722
  if (f != NULL) {
6726
6723
  checked_reverse_op = true;
@@ -6733,7 +6730,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6733
6730
  return result;
6734
6731
  }
6735
6732
 
6736
- Py_DECREF(result);
6733
+ Py_DECREF_IMMORTAL(result);
6737
6734
  }
6738
6735
  }
6739
6736
 
@@ -6748,11 +6745,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6748
6745
  return result;
6749
6746
  }
6750
6747
 
6751
- Py_DECREF(result);
6748
+ Py_DECREF_IMMORTAL(result);
6752
6749
  }
6753
6750
 
6754
6751
  if (checked_reverse_op == false) {
6755
- f = RICHCOMPARE(type2);
6752
+ f = TP_RICHCOMPARE(type2);
6756
6753
 
6757
6754
  if (f != NULL) {
6758
6755
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -6763,7 +6760,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6763
6760
  return result;
6764
6761
  }
6765
6762
 
6766
- Py_DECREF(result);
6763
+ Py_DECREF_IMMORTAL(result);
6767
6764
  }
6768
6765
  }
6769
6766
 
@@ -6775,13 +6772,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6775
6772
  case Py_EQ: {
6776
6773
  bool r = operand1 == operand2;
6777
6774
  PyObject *result = BOOL_FROM(r);
6778
- Py_INCREF(result);
6775
+ Py_INCREF_IMMORTAL(result);
6779
6776
  return result;
6780
6777
  }
6781
6778
  case Py_NE: {
6782
6779
  bool r = operand1 != operand2;
6783
6780
  PyObject *result = BOOL_FROM(r);
6784
- Py_INCREF(result);
6781
+ Py_INCREF_IMMORTAL(result);
6785
6782
  return result;
6786
6783
  }
6787
6784
  default:
@@ -6817,15 +6814,19 @@ static bool COMPARE_LE_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
6817
6814
 
6818
6815
  if (operand1_long_object == operand2_long_object) {
6819
6816
  r = true;
6820
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6821
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;
6817
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6818
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6819
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) <
6820
+ 0;
6822
6821
  } else {
6823
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6822
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6824
6823
  r = true;
6825
6824
  while (--i >= 0) {
6826
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6827
- r = operand1_long_object->ob_digit[i] < operand2_long_object->ob_digit[i];
6828
- if (Py_SIZE(operand1_long_object) < 0) {
6825
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6826
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6827
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <
6828
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6829
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6829
6830
  r = !r;
6830
6831
  }
6831
6832
  break;
@@ -6886,7 +6887,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6886
6887
  }
6887
6888
  }
6888
6889
 
6889
- Py_DECREF(result);
6890
+ Py_DECREF_IMMORTAL(result);
6890
6891
  }
6891
6892
 
6892
6893
  // No rich comparison worked, but maybe compare works.
@@ -6955,11 +6956,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6955
6956
  }
6956
6957
  }
6957
6958
 
6958
- Py_DECREF(result);
6959
+ Py_DECREF_IMMORTAL(result);
6959
6960
  }
6960
6961
  }
6961
6962
 
6962
- f = RICHCOMPARE(type1);
6963
+ f = TP_RICHCOMPARE(type1);
6963
6964
  if (f != NULL) {
6964
6965
  PyObject *result = (*f)(operand1, operand2, Py_LE);
6965
6966
 
@@ -6977,7 +6978,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6977
6978
  }
6978
6979
  }
6979
6980
 
6980
- Py_DECREF(result);
6981
+ Py_DECREF_IMMORTAL(result);
6981
6982
  }
6982
6983
 
6983
6984
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6998,7 +6999,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6998
6999
  }
6999
7000
  }
7000
7001
 
7001
- Py_DECREF(result);
7002
+ Py_DECREF_IMMORTAL(result);
7002
7003
  }
7003
7004
 
7004
7005
  int c;
@@ -7114,11 +7115,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7114
7115
  }
7115
7116
  }
7116
7117
 
7117
- Py_DECREF(result);
7118
+ Py_DECREF_IMMORTAL(result);
7118
7119
  }
7119
7120
  }
7120
7121
 
7121
- f = RICHCOMPARE(type1);
7122
+ f = TP_RICHCOMPARE(type1);
7122
7123
 
7123
7124
  if (f != NULL) {
7124
7125
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -7137,7 +7138,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7137
7138
  }
7138
7139
  }
7139
7140
 
7140
- Py_DECREF(result);
7141
+ Py_DECREF_IMMORTAL(result);
7141
7142
  }
7142
7143
 
7143
7144
  if (checked_reverse_op == false) {
@@ -7160,7 +7161,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7160
7161
  }
7161
7162
  }
7162
7163
 
7163
- Py_DECREF(result);
7164
+ Py_DECREF_IMMORTAL(result);
7164
7165
  }
7165
7166
  }
7166
7167
 
@@ -7236,7 +7237,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7236
7237
  }
7237
7238
  }
7238
7239
 
7239
- Py_DECREF(result);
7240
+ Py_DECREF_IMMORTAL(result);
7240
7241
  }
7241
7242
 
7242
7243
  // No rich comparison worked, but maybe compare works.
@@ -7286,7 +7287,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7286
7287
  richcmpfunc f;
7287
7288
 
7288
7289
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7289
- f = RICHCOMPARE(type2);
7290
+ f = TP_RICHCOMPARE(type2);
7290
7291
 
7291
7292
  if (f != NULL) {
7292
7293
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -7305,7 +7306,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7305
7306
  }
7306
7307
  }
7307
7308
 
7308
- Py_DECREF(result);
7309
+ Py_DECREF_IMMORTAL(result);
7309
7310
  }
7310
7311
  }
7311
7312
 
@@ -7327,10 +7328,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7327
7328
  }
7328
7329
  }
7329
7330
 
7330
- Py_DECREF(result);
7331
+ Py_DECREF_IMMORTAL(result);
7331
7332
  }
7332
7333
 
7333
- f = RICHCOMPARE(type2);
7334
+ f = TP_RICHCOMPARE(type2);
7334
7335
  if (f != NULL) {
7335
7336
  PyObject *result = (*f)(operand2, operand1, Py_GE);
7336
7337
 
@@ -7348,7 +7349,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7348
7349
  }
7349
7350
  }
7350
7351
 
7351
- Py_DECREF(result);
7352
+ Py_DECREF_IMMORTAL(result);
7352
7353
  }
7353
7354
 
7354
7355
  int c;
@@ -7443,7 +7444,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7443
7444
  richcmpfunc f;
7444
7445
 
7445
7446
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7446
- f = RICHCOMPARE(type2);
7447
+ f = TP_RICHCOMPARE(type2);
7447
7448
 
7448
7449
  if (f != NULL) {
7449
7450
  checked_reverse_op = true;
@@ -7464,7 +7465,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7464
7465
  }
7465
7466
  }
7466
7467
 
7467
- Py_DECREF(result);
7468
+ Py_DECREF_IMMORTAL(result);
7468
7469
  }
7469
7470
  }
7470
7471
 
@@ -7487,11 +7488,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7487
7488
  }
7488
7489
  }
7489
7490
 
7490
- Py_DECREF(result);
7491
+ Py_DECREF_IMMORTAL(result);
7491
7492
  }
7492
7493
 
7493
7494
  if (checked_reverse_op == false) {
7494
- f = RICHCOMPARE(type2);
7495
+ f = TP_RICHCOMPARE(type2);
7495
7496
 
7496
7497
  if (f != NULL) {
7497
7498
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -7510,7 +7511,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7510
7511
  }
7511
7512
  }
7512
7513
 
7513
- Py_DECREF(result);
7514
+ Py_DECREF_IMMORTAL(result);
7514
7515
  }
7515
7516
  }
7516
7517
 
@@ -7557,7 +7558,7 @@ static PyObject *COMPARE_LE_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *ope
7557
7558
 
7558
7559
  // Convert to target type.
7559
7560
  PyObject *result = BOOL_FROM(r);
7560
- Py_INCREF(result);
7561
+ Py_INCREF_IMMORTAL(result);
7561
7562
  return result;
7562
7563
  }
7563
7564
  /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
@@ -7594,7 +7595,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7594
7595
  return result;
7595
7596
  }
7596
7597
 
7597
- Py_DECREF(result);
7598
+ Py_DECREF_IMMORTAL(result);
7598
7599
  }
7599
7600
 
7600
7601
  // No rich comparison worked, but maybe compare works.
@@ -7635,7 +7636,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7635
7636
 
7636
7637
  bool r = c != 0;
7637
7638
  PyObject *result = BOOL_FROM(r);
7638
- Py_INCREF(result);
7639
+ Py_INCREF_IMMORTAL(result);
7639
7640
  return result;
7640
7641
  }
7641
7642
  }
@@ -7655,11 +7656,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7655
7656
  return result;
7656
7657
  }
7657
7658
 
7658
- Py_DECREF(result);
7659
+ Py_DECREF_IMMORTAL(result);
7659
7660
  }
7660
7661
  }
7661
7662
 
7662
- f = RICHCOMPARE(type1);
7663
+ f = TP_RICHCOMPARE(type1);
7663
7664
  if (f != NULL) {
7664
7665
  PyObject *result = (*f)(operand1, operand2, Py_LE);
7665
7666
 
@@ -7669,7 +7670,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7669
7670
  return result;
7670
7671
  }
7671
7672
 
7672
- Py_DECREF(result);
7673
+ Py_DECREF_IMMORTAL(result);
7673
7674
  }
7674
7675
 
7675
7676
  f = PyFloat_Type.tp_richcompare;
@@ -7682,7 +7683,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7682
7683
  return result;
7683
7684
  }
7684
7685
 
7685
- Py_DECREF(result);
7686
+ Py_DECREF_IMMORTAL(result);
7686
7687
  }
7687
7688
 
7688
7689
  int c;
@@ -7770,7 +7771,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7770
7771
 
7771
7772
  bool r = c != 0;
7772
7773
  PyObject *result = BOOL_FROM(r);
7773
- Py_INCREF(result);
7774
+ Py_INCREF_IMMORTAL(result);
7774
7775
  return result;
7775
7776
  #else
7776
7777
  bool checked_reverse_op = false;
@@ -7790,11 +7791,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7790
7791
  return result;
7791
7792
  }
7792
7793
 
7793
- Py_DECREF(result);
7794
+ Py_DECREF_IMMORTAL(result);
7794
7795
  }
7795
7796
  }
7796
7797
 
7797
- f = RICHCOMPARE(type1);
7798
+ f = TP_RICHCOMPARE(type1);
7798
7799
 
7799
7800
  if (f != NULL) {
7800
7801
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -7805,7 +7806,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7805
7806
  return result;
7806
7807
  }
7807
7808
 
7808
- Py_DECREF(result);
7809
+ Py_DECREF_IMMORTAL(result);
7809
7810
  }
7810
7811
 
7811
7812
  if (checked_reverse_op == false) {
@@ -7820,7 +7821,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7820
7821
  return result;
7821
7822
  }
7822
7823
 
7823
- Py_DECREF(result);
7824
+ Py_DECREF_IMMORTAL(result);
7824
7825
  }
7825
7826
  }
7826
7827
 
@@ -7832,13 +7833,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7832
7833
  case Py_EQ: {
7833
7834
  bool r = operand1 == operand2;
7834
7835
  PyObject *result = BOOL_FROM(r);
7835
- Py_INCREF(result);
7836
+ Py_INCREF_IMMORTAL(result);
7836
7837
  return result;
7837
7838
  }
7838
7839
  case Py_NE: {
7839
7840
  bool r = operand1 != operand2;
7840
7841
  PyObject *result = BOOL_FROM(r);
7841
- Py_INCREF(result);
7842
+ Py_INCREF_IMMORTAL(result);
7842
7843
  return result;
7843
7844
  }
7844
7845
  default:
@@ -7886,7 +7887,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7886
7887
  return result;
7887
7888
  }
7888
7889
 
7889
- Py_DECREF(result);
7890
+ Py_DECREF_IMMORTAL(result);
7890
7891
  }
7891
7892
 
7892
7893
  // No rich comparison worked, but maybe compare works.
@@ -7927,7 +7928,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7927
7928
 
7928
7929
  bool r = c != 0;
7929
7930
  PyObject *result = BOOL_FROM(r);
7930
- Py_INCREF(result);
7931
+ Py_INCREF_IMMORTAL(result);
7931
7932
  return result;
7932
7933
  }
7933
7934
  }
@@ -7936,7 +7937,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7936
7937
  richcmpfunc f;
7937
7938
 
7938
7939
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
7939
- f = RICHCOMPARE(type2);
7940
+ f = TP_RICHCOMPARE(type2);
7940
7941
 
7941
7942
  if (f != NULL) {
7942
7943
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -7947,7 +7948,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7947
7948
  return result;
7948
7949
  }
7949
7950
 
7950
- Py_DECREF(result);
7951
+ Py_DECREF_IMMORTAL(result);
7951
7952
  }
7952
7953
  }
7953
7954
 
@@ -7961,10 +7962,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7961
7962
  return result;
7962
7963
  }
7963
7964
 
7964
- Py_DECREF(result);
7965
+ Py_DECREF_IMMORTAL(result);
7965
7966
  }
7966
7967
 
7967
- f = RICHCOMPARE(type2);
7968
+ f = TP_RICHCOMPARE(type2);
7968
7969
  if (f != NULL) {
7969
7970
  PyObject *result = (*f)(operand2, operand1, Py_GE);
7970
7971
 
@@ -7974,7 +7975,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7974
7975
  return result;
7975
7976
  }
7976
7977
 
7977
- Py_DECREF(result);
7978
+ Py_DECREF_IMMORTAL(result);
7978
7979
  }
7979
7980
 
7980
7981
  int c;
@@ -8062,14 +8063,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8062
8063
 
8063
8064
  bool r = c != 0;
8064
8065
  PyObject *result = BOOL_FROM(r);
8065
- Py_INCREF(result);
8066
+ Py_INCREF_IMMORTAL(result);
8066
8067
  return result;
8067
8068
  #else
8068
8069
  bool checked_reverse_op = false;
8069
8070
  richcmpfunc f;
8070
8071
 
8071
8072
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8072
- f = RICHCOMPARE(type2);
8073
+ f = TP_RICHCOMPARE(type2);
8073
8074
 
8074
8075
  if (f != NULL) {
8075
8076
  checked_reverse_op = true;
@@ -8082,7 +8083,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8082
8083
  return result;
8083
8084
  }
8084
8085
 
8085
- Py_DECREF(result);
8086
+ Py_DECREF_IMMORTAL(result);
8086
8087
  }
8087
8088
  }
8088
8089
 
@@ -8097,11 +8098,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8097
8098
  return result;
8098
8099
  }
8099
8100
 
8100
- Py_DECREF(result);
8101
+ Py_DECREF_IMMORTAL(result);
8101
8102
  }
8102
8103
 
8103
8104
  if (checked_reverse_op == false) {
8104
- f = RICHCOMPARE(type2);
8105
+ f = TP_RICHCOMPARE(type2);
8105
8106
 
8106
8107
  if (f != NULL) {
8107
8108
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -8112,7 +8113,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8112
8113
  return result;
8113
8114
  }
8114
8115
 
8115
- Py_DECREF(result);
8116
+ Py_DECREF_IMMORTAL(result);
8116
8117
  }
8117
8118
  }
8118
8119
 
@@ -8124,13 +8125,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8124
8125
  case Py_EQ: {
8125
8126
  bool r = operand1 == operand2;
8126
8127
  PyObject *result = BOOL_FROM(r);
8127
- Py_INCREF(result);
8128
+ Py_INCREF_IMMORTAL(result);
8128
8129
  return result;
8129
8130
  }
8130
8131
  case Py_NE: {
8131
8132
  bool r = operand1 != operand2;
8132
8133
  PyObject *result = BOOL_FROM(r);
8133
- Py_INCREF(result);
8134
+ Py_INCREF_IMMORTAL(result);
8134
8135
  return result;
8135
8136
  }
8136
8137
  default:
@@ -8214,7 +8215,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8214
8215
  }
8215
8216
  }
8216
8217
 
8217
- Py_DECREF(result);
8218
+ Py_DECREF_IMMORTAL(result);
8218
8219
  }
8219
8220
 
8220
8221
  // No rich comparison worked, but maybe compare works.
@@ -8283,11 +8284,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8283
8284
  }
8284
8285
  }
8285
8286
 
8286
- Py_DECREF(result);
8287
+ Py_DECREF_IMMORTAL(result);
8287
8288
  }
8288
8289
  }
8289
8290
 
8290
- f = RICHCOMPARE(type1);
8291
+ f = TP_RICHCOMPARE(type1);
8291
8292
  if (f != NULL) {
8292
8293
  PyObject *result = (*f)(operand1, operand2, Py_LE);
8293
8294
 
@@ -8305,7 +8306,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8305
8306
  }
8306
8307
  }
8307
8308
 
8308
- Py_DECREF(result);
8309
+ Py_DECREF_IMMORTAL(result);
8309
8310
  }
8310
8311
 
8311
8312
  f = PyFloat_Type.tp_richcompare;
@@ -8326,7 +8327,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8326
8327
  }
8327
8328
  }
8328
8329
 
8329
- Py_DECREF(result);
8330
+ Py_DECREF_IMMORTAL(result);
8330
8331
  }
8331
8332
 
8332
8333
  int c;
@@ -8442,11 +8443,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8442
8443
  }
8443
8444
  }
8444
8445
 
8445
- Py_DECREF(result);
8446
+ Py_DECREF_IMMORTAL(result);
8446
8447
  }
8447
8448
  }
8448
8449
 
8449
- f = RICHCOMPARE(type1);
8450
+ f = TP_RICHCOMPARE(type1);
8450
8451
 
8451
8452
  if (f != NULL) {
8452
8453
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -8465,7 +8466,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8465
8466
  }
8466
8467
  }
8467
8468
 
8468
- Py_DECREF(result);
8469
+ Py_DECREF_IMMORTAL(result);
8469
8470
  }
8470
8471
 
8471
8472
  if (checked_reverse_op == false) {
@@ -8488,7 +8489,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8488
8489
  }
8489
8490
  }
8490
8491
 
8491
- Py_DECREF(result);
8492
+ Py_DECREF_IMMORTAL(result);
8492
8493
  }
8493
8494
  }
8494
8495
 
@@ -8562,7 +8563,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8562
8563
  }
8563
8564
  }
8564
8565
 
8565
- Py_DECREF(result);
8566
+ Py_DECREF_IMMORTAL(result);
8566
8567
  }
8567
8568
 
8568
8569
  // No rich comparison worked, but maybe compare works.
@@ -8612,7 +8613,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8612
8613
  richcmpfunc f;
8613
8614
 
8614
8615
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8615
- f = RICHCOMPARE(type2);
8616
+ f = TP_RICHCOMPARE(type2);
8616
8617
 
8617
8618
  if (f != NULL) {
8618
8619
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -8631,7 +8632,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8631
8632
  }
8632
8633
  }
8633
8634
 
8634
- Py_DECREF(result);
8635
+ Py_DECREF_IMMORTAL(result);
8635
8636
  }
8636
8637
  }
8637
8638
 
@@ -8653,10 +8654,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8653
8654
  }
8654
8655
  }
8655
8656
 
8656
- Py_DECREF(result);
8657
+ Py_DECREF_IMMORTAL(result);
8657
8658
  }
8658
8659
 
8659
- f = RICHCOMPARE(type2);
8660
+ f = TP_RICHCOMPARE(type2);
8660
8661
  if (f != NULL) {
8661
8662
  PyObject *result = (*f)(operand2, operand1, Py_GE);
8662
8663
 
@@ -8674,7 +8675,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8674
8675
  }
8675
8676
  }
8676
8677
 
8677
- Py_DECREF(result);
8678
+ Py_DECREF_IMMORTAL(result);
8678
8679
  }
8679
8680
 
8680
8681
  int c;
@@ -8769,7 +8770,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8769
8770
  richcmpfunc f;
8770
8771
 
8771
8772
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8772
- f = RICHCOMPARE(type2);
8773
+ f = TP_RICHCOMPARE(type2);
8773
8774
 
8774
8775
  if (f != NULL) {
8775
8776
  checked_reverse_op = true;
@@ -8790,7 +8791,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8790
8791
  }
8791
8792
  }
8792
8793
 
8793
- Py_DECREF(result);
8794
+ Py_DECREF_IMMORTAL(result);
8794
8795
  }
8795
8796
  }
8796
8797
 
@@ -8813,11 +8814,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8813
8814
  }
8814
8815
  }
8815
8816
 
8816
- Py_DECREF(result);
8817
+ Py_DECREF_IMMORTAL(result);
8817
8818
  }
8818
8819
 
8819
8820
  if (checked_reverse_op == false) {
8820
- f = RICHCOMPARE(type2);
8821
+ f = TP_RICHCOMPARE(type2);
8821
8822
 
8822
8823
  if (f != NULL) {
8823
8824
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -8836,7 +8837,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8836
8837
  }
8837
8838
  }
8838
8839
 
8839
- Py_DECREF(result);
8840
+ Py_DECREF_IMMORTAL(result);
8840
8841
  }
8841
8842
  }
8842
8843
 
@@ -8909,7 +8910,7 @@ static PyObject *COMPARE_LE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *ope
8909
8910
 
8910
8911
  // Convert to target type.
8911
8912
  PyObject *result = BOOL_FROM(r);
8912
- Py_INCREF(result);
8913
+ Py_INCREF_IMMORTAL(result);
8913
8914
  return result;
8914
8915
  }
8915
8916
 
@@ -8949,7 +8950,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8949
8950
  return result;
8950
8951
  }
8951
8952
 
8952
- Py_DECREF(result);
8953
+ Py_DECREF_IMMORTAL(result);
8953
8954
  }
8954
8955
 
8955
8956
  // No rich comparison worked, but maybe compare works.
@@ -8990,7 +8991,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8990
8991
 
8991
8992
  bool r = c != 0;
8992
8993
  PyObject *result = BOOL_FROM(r);
8993
- Py_INCREF(result);
8994
+ Py_INCREF_IMMORTAL(result);
8994
8995
  return result;
8995
8996
  }
8996
8997
  }
@@ -9010,11 +9011,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9010
9011
  return result;
9011
9012
  }
9012
9013
 
9013
- Py_DECREF(result);
9014
+ Py_DECREF_IMMORTAL(result);
9014
9015
  }
9015
9016
  }
9016
9017
 
9017
- f = RICHCOMPARE(type1);
9018
+ f = TP_RICHCOMPARE(type1);
9018
9019
  if (f != NULL) {
9019
9020
  PyObject *result = (*f)(operand1, operand2, Py_LE);
9020
9021
 
@@ -9024,7 +9025,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9024
9025
  return result;
9025
9026
  }
9026
9027
 
9027
- Py_DECREF(result);
9028
+ Py_DECREF_IMMORTAL(result);
9028
9029
  }
9029
9030
 
9030
9031
  f = PyTuple_Type.tp_richcompare;
@@ -9037,7 +9038,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9037
9038
  return result;
9038
9039
  }
9039
9040
 
9040
- Py_DECREF(result);
9041
+ Py_DECREF_IMMORTAL(result);
9041
9042
  }
9042
9043
 
9043
9044
  int c;
@@ -9125,7 +9126,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9125
9126
 
9126
9127
  bool r = c != 0;
9127
9128
  PyObject *result = BOOL_FROM(r);
9128
- Py_INCREF(result);
9129
+ Py_INCREF_IMMORTAL(result);
9129
9130
  return result;
9130
9131
  #else
9131
9132
  bool checked_reverse_op = false;
@@ -9145,11 +9146,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9145
9146
  return result;
9146
9147
  }
9147
9148
 
9148
- Py_DECREF(result);
9149
+ Py_DECREF_IMMORTAL(result);
9149
9150
  }
9150
9151
  }
9151
9152
 
9152
- f = RICHCOMPARE(type1);
9153
+ f = TP_RICHCOMPARE(type1);
9153
9154
 
9154
9155
  if (f != NULL) {
9155
9156
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -9160,7 +9161,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9160
9161
  return result;
9161
9162
  }
9162
9163
 
9163
- Py_DECREF(result);
9164
+ Py_DECREF_IMMORTAL(result);
9164
9165
  }
9165
9166
 
9166
9167
  if (checked_reverse_op == false) {
@@ -9175,7 +9176,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9175
9176
  return result;
9176
9177
  }
9177
9178
 
9178
- Py_DECREF(result);
9179
+ Py_DECREF_IMMORTAL(result);
9179
9180
  }
9180
9181
  }
9181
9182
 
@@ -9187,13 +9188,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9187
9188
  case Py_EQ: {
9188
9189
  bool r = operand1 == operand2;
9189
9190
  PyObject *result = BOOL_FROM(r);
9190
- Py_INCREF(result);
9191
+ Py_INCREF_IMMORTAL(result);
9191
9192
  return result;
9192
9193
  }
9193
9194
  case Py_NE: {
9194
9195
  bool r = operand1 != operand2;
9195
9196
  PyObject *result = BOOL_FROM(r);
9196
- Py_INCREF(result);
9197
+ Py_INCREF_IMMORTAL(result);
9197
9198
  return result;
9198
9199
  }
9199
9200
  default:
@@ -9241,7 +9242,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9241
9242
  return result;
9242
9243
  }
9243
9244
 
9244
- Py_DECREF(result);
9245
+ Py_DECREF_IMMORTAL(result);
9245
9246
  }
9246
9247
 
9247
9248
  // No rich comparison worked, but maybe compare works.
@@ -9282,7 +9283,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9282
9283
 
9283
9284
  bool r = c != 0;
9284
9285
  PyObject *result = BOOL_FROM(r);
9285
- Py_INCREF(result);
9286
+ Py_INCREF_IMMORTAL(result);
9286
9287
  return result;
9287
9288
  }
9288
9289
  }
@@ -9291,7 +9292,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9291
9292
  richcmpfunc f;
9292
9293
 
9293
9294
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9294
- f = RICHCOMPARE(type2);
9295
+ f = TP_RICHCOMPARE(type2);
9295
9296
 
9296
9297
  if (f != NULL) {
9297
9298
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -9302,7 +9303,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9302
9303
  return result;
9303
9304
  }
9304
9305
 
9305
- Py_DECREF(result);
9306
+ Py_DECREF_IMMORTAL(result);
9306
9307
  }
9307
9308
  }
9308
9309
 
@@ -9316,10 +9317,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9316
9317
  return result;
9317
9318
  }
9318
9319
 
9319
- Py_DECREF(result);
9320
+ Py_DECREF_IMMORTAL(result);
9320
9321
  }
9321
9322
 
9322
- f = RICHCOMPARE(type2);
9323
+ f = TP_RICHCOMPARE(type2);
9323
9324
  if (f != NULL) {
9324
9325
  PyObject *result = (*f)(operand2, operand1, Py_GE);
9325
9326
 
@@ -9329,7 +9330,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9329
9330
  return result;
9330
9331
  }
9331
9332
 
9332
- Py_DECREF(result);
9333
+ Py_DECREF_IMMORTAL(result);
9333
9334
  }
9334
9335
 
9335
9336
  int c;
@@ -9417,14 +9418,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9417
9418
 
9418
9419
  bool r = c != 0;
9419
9420
  PyObject *result = BOOL_FROM(r);
9420
- Py_INCREF(result);
9421
+ Py_INCREF_IMMORTAL(result);
9421
9422
  return result;
9422
9423
  #else
9423
9424
  bool checked_reverse_op = false;
9424
9425
  richcmpfunc f;
9425
9426
 
9426
9427
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9427
- f = RICHCOMPARE(type2);
9428
+ f = TP_RICHCOMPARE(type2);
9428
9429
 
9429
9430
  if (f != NULL) {
9430
9431
  checked_reverse_op = true;
@@ -9437,7 +9438,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9437
9438
  return result;
9438
9439
  }
9439
9440
 
9440
- Py_DECREF(result);
9441
+ Py_DECREF_IMMORTAL(result);
9441
9442
  }
9442
9443
  }
9443
9444
 
@@ -9452,11 +9453,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9452
9453
  return result;
9453
9454
  }
9454
9455
 
9455
- Py_DECREF(result);
9456
+ Py_DECREF_IMMORTAL(result);
9456
9457
  }
9457
9458
 
9458
9459
  if (checked_reverse_op == false) {
9459
- f = RICHCOMPARE(type2);
9460
+ f = TP_RICHCOMPARE(type2);
9460
9461
 
9461
9462
  if (f != NULL) {
9462
9463
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -9467,7 +9468,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9467
9468
  return result;
9468
9469
  }
9469
9470
 
9470
- Py_DECREF(result);
9471
+ Py_DECREF_IMMORTAL(result);
9471
9472
  }
9472
9473
  }
9473
9474
 
@@ -9479,13 +9480,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9479
9480
  case Py_EQ: {
9480
9481
  bool r = operand1 == operand2;
9481
9482
  PyObject *result = BOOL_FROM(r);
9482
- Py_INCREF(result);
9483
+ Py_INCREF_IMMORTAL(result);
9483
9484
  return result;
9484
9485
  }
9485
9486
  case Py_NE: {
9486
9487
  bool r = operand1 != operand2;
9487
9488
  PyObject *result = BOOL_FROM(r);
9488
- Py_INCREF(result);
9489
+ Py_INCREF_IMMORTAL(result);
9489
9490
  return result;
9490
9491
  }
9491
9492
  default:
@@ -9594,7 +9595,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9594
9595
  }
9595
9596
  }
9596
9597
 
9597
- Py_DECREF(result);
9598
+ Py_DECREF_IMMORTAL(result);
9598
9599
  }
9599
9600
 
9600
9601
  // No rich comparison worked, but maybe compare works.
@@ -9663,11 +9664,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9663
9664
  }
9664
9665
  }
9665
9666
 
9666
- Py_DECREF(result);
9667
+ Py_DECREF_IMMORTAL(result);
9667
9668
  }
9668
9669
  }
9669
9670
 
9670
- f = RICHCOMPARE(type1);
9671
+ f = TP_RICHCOMPARE(type1);
9671
9672
  if (f != NULL) {
9672
9673
  PyObject *result = (*f)(operand1, operand2, Py_LE);
9673
9674
 
@@ -9685,7 +9686,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9685
9686
  }
9686
9687
  }
9687
9688
 
9688
- Py_DECREF(result);
9689
+ Py_DECREF_IMMORTAL(result);
9689
9690
  }
9690
9691
 
9691
9692
  f = PyTuple_Type.tp_richcompare;
@@ -9706,7 +9707,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9706
9707
  }
9707
9708
  }
9708
9709
 
9709
- Py_DECREF(result);
9710
+ Py_DECREF_IMMORTAL(result);
9710
9711
  }
9711
9712
 
9712
9713
  int c;
@@ -9822,11 +9823,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9822
9823
  }
9823
9824
  }
9824
9825
 
9825
- Py_DECREF(result);
9826
+ Py_DECREF_IMMORTAL(result);
9826
9827
  }
9827
9828
  }
9828
9829
 
9829
- f = RICHCOMPARE(type1);
9830
+ f = TP_RICHCOMPARE(type1);
9830
9831
 
9831
9832
  if (f != NULL) {
9832
9833
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -9845,7 +9846,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9845
9846
  }
9846
9847
  }
9847
9848
 
9848
- Py_DECREF(result);
9849
+ Py_DECREF_IMMORTAL(result);
9849
9850
  }
9850
9851
 
9851
9852
  if (checked_reverse_op == false) {
@@ -9868,7 +9869,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9868
9869
  }
9869
9870
  }
9870
9871
 
9871
- Py_DECREF(result);
9872
+ Py_DECREF_IMMORTAL(result);
9872
9873
  }
9873
9874
  }
9874
9875
 
@@ -9942,7 +9943,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9942
9943
  }
9943
9944
  }
9944
9945
 
9945
- Py_DECREF(result);
9946
+ Py_DECREF_IMMORTAL(result);
9946
9947
  }
9947
9948
 
9948
9949
  // No rich comparison worked, but maybe compare works.
@@ -9992,7 +9993,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9992
9993
  richcmpfunc f;
9993
9994
 
9994
9995
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9995
- f = RICHCOMPARE(type2);
9996
+ f = TP_RICHCOMPARE(type2);
9996
9997
 
9997
9998
  if (f != NULL) {
9998
9999
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -10011,7 +10012,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10011
10012
  }
10012
10013
  }
10013
10014
 
10014
- Py_DECREF(result);
10015
+ Py_DECREF_IMMORTAL(result);
10015
10016
  }
10016
10017
  }
10017
10018
 
@@ -10033,10 +10034,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10033
10034
  }
10034
10035
  }
10035
10036
 
10036
- Py_DECREF(result);
10037
+ Py_DECREF_IMMORTAL(result);
10037
10038
  }
10038
10039
 
10039
- f = RICHCOMPARE(type2);
10040
+ f = TP_RICHCOMPARE(type2);
10040
10041
  if (f != NULL) {
10041
10042
  PyObject *result = (*f)(operand2, operand1, Py_GE);
10042
10043
 
@@ -10054,7 +10055,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10054
10055
  }
10055
10056
  }
10056
10057
 
10057
- Py_DECREF(result);
10058
+ Py_DECREF_IMMORTAL(result);
10058
10059
  }
10059
10060
 
10060
10061
  int c;
@@ -10149,7 +10150,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10149
10150
  richcmpfunc f;
10150
10151
 
10151
10152
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
10152
- f = RICHCOMPARE(type2);
10153
+ f = TP_RICHCOMPARE(type2);
10153
10154
 
10154
10155
  if (f != NULL) {
10155
10156
  checked_reverse_op = true;
@@ -10170,7 +10171,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10170
10171
  }
10171
10172
  }
10172
10173
 
10173
- Py_DECREF(result);
10174
+ Py_DECREF_IMMORTAL(result);
10174
10175
  }
10175
10176
  }
10176
10177
 
@@ -10193,11 +10194,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10193
10194
  }
10194
10195
  }
10195
10196
 
10196
- Py_DECREF(result);
10197
+ Py_DECREF_IMMORTAL(result);
10197
10198
  }
10198
10199
 
10199
10200
  if (checked_reverse_op == false) {
10200
- f = RICHCOMPARE(type2);
10201
+ f = TP_RICHCOMPARE(type2);
10201
10202
 
10202
10203
  if (f != NULL) {
10203
10204
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -10216,7 +10217,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10216
10217
  }
10217
10218
  }
10218
10219
 
10219
- Py_DECREF(result);
10220
+ Py_DECREF_IMMORTAL(result);
10220
10221
  }
10221
10222
  }
10222
10223
 
@@ -10263,14 +10264,11 @@ static PyObject *COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10263
10264
  PyListObject *a = (PyListObject *)operand1;
10264
10265
  PyListObject *b = (PyListObject *)operand2;
10265
10266
 
10266
- Py_ssize_t len_a = Py_SIZE(a);
10267
- Py_ssize_t len_b = Py_SIZE(b);
10268
-
10269
10267
  bool found = false;
10270
10268
  nuitka_bool res = NUITKA_BOOL_TRUE;
10271
10269
 
10272
10270
  Py_ssize_t i;
10273
- for (i = 0; i < len_a && i < len_b; i++) {
10271
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10274
10272
  PyObject *aa = a->ob_item[i];
10275
10273
  PyObject *bb = b->ob_item[i];
10276
10274
 
@@ -10278,7 +10276,11 @@ static PyObject *COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10278
10276
  continue;
10279
10277
  }
10280
10278
 
10279
+ Py_INCREF(aa);
10280
+ Py_INCREF(bb);
10281
10281
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10282
+ Py_DECREF(aa);
10283
+ Py_DECREF(bb);
10282
10284
 
10283
10285
  if (res == NUITKA_BOOL_EXCEPTION) {
10284
10286
  return NULL;
@@ -10291,11 +10293,11 @@ static PyObject *COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10291
10293
  }
10292
10294
 
10293
10295
  if (found == false) {
10294
- bool r = len_a <= len_b;
10296
+ bool r = Py_SIZE(a) <= Py_SIZE(b);
10295
10297
 
10296
10298
  // Convert to target type.
10297
10299
  PyObject *result = BOOL_FROM(r);
10298
- Py_INCREF(result);
10300
+ Py_INCREF_IMMORTAL(result);
10299
10301
  return result;
10300
10302
  }
10301
10303
 
@@ -10335,7 +10337,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10335
10337
  return result;
10336
10338
  }
10337
10339
 
10338
- Py_DECREF(result);
10340
+ Py_DECREF_IMMORTAL(result);
10339
10341
  }
10340
10342
 
10341
10343
  // No rich comparison worked, but maybe compare works.
@@ -10376,7 +10378,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10376
10378
 
10377
10379
  bool r = c != 0;
10378
10380
  PyObject *result = BOOL_FROM(r);
10379
- Py_INCREF(result);
10381
+ Py_INCREF_IMMORTAL(result);
10380
10382
  return result;
10381
10383
  }
10382
10384
  }
@@ -10396,11 +10398,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10396
10398
  return result;
10397
10399
  }
10398
10400
 
10399
- Py_DECREF(result);
10401
+ Py_DECREF_IMMORTAL(result);
10400
10402
  }
10401
10403
  }
10402
10404
 
10403
- f = RICHCOMPARE(type1);
10405
+ f = TP_RICHCOMPARE(type1);
10404
10406
  if (f != NULL) {
10405
10407
  PyObject *result = (*f)(operand1, operand2, Py_LE);
10406
10408
 
@@ -10410,7 +10412,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10410
10412
  return result;
10411
10413
  }
10412
10414
 
10413
- Py_DECREF(result);
10415
+ Py_DECREF_IMMORTAL(result);
10414
10416
  }
10415
10417
 
10416
10418
  f = PyList_Type.tp_richcompare;
@@ -10423,7 +10425,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10423
10425
  return result;
10424
10426
  }
10425
10427
 
10426
- Py_DECREF(result);
10428
+ Py_DECREF_IMMORTAL(result);
10427
10429
  }
10428
10430
 
10429
10431
  int c;
@@ -10511,7 +10513,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10511
10513
 
10512
10514
  bool r = c != 0;
10513
10515
  PyObject *result = BOOL_FROM(r);
10514
- Py_INCREF(result);
10516
+ Py_INCREF_IMMORTAL(result);
10515
10517
  return result;
10516
10518
  #else
10517
10519
  bool checked_reverse_op = false;
@@ -10531,11 +10533,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10531
10533
  return result;
10532
10534
  }
10533
10535
 
10534
- Py_DECREF(result);
10536
+ Py_DECREF_IMMORTAL(result);
10535
10537
  }
10536
10538
  }
10537
10539
 
10538
- f = RICHCOMPARE(type1);
10540
+ f = TP_RICHCOMPARE(type1);
10539
10541
 
10540
10542
  if (f != NULL) {
10541
10543
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -10546,7 +10548,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10546
10548
  return result;
10547
10549
  }
10548
10550
 
10549
- Py_DECREF(result);
10551
+ Py_DECREF_IMMORTAL(result);
10550
10552
  }
10551
10553
 
10552
10554
  if (checked_reverse_op == false) {
@@ -10561,7 +10563,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10561
10563
  return result;
10562
10564
  }
10563
10565
 
10564
- Py_DECREF(result);
10566
+ Py_DECREF_IMMORTAL(result);
10565
10567
  }
10566
10568
  }
10567
10569
 
@@ -10573,13 +10575,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10573
10575
  case Py_EQ: {
10574
10576
  bool r = operand1 == operand2;
10575
10577
  PyObject *result = BOOL_FROM(r);
10576
- Py_INCREF(result);
10578
+ Py_INCREF_IMMORTAL(result);
10577
10579
  return result;
10578
10580
  }
10579
10581
  case Py_NE: {
10580
10582
  bool r = operand1 != operand2;
10581
10583
  PyObject *result = BOOL_FROM(r);
10582
- Py_INCREF(result);
10584
+ Py_INCREF_IMMORTAL(result);
10583
10585
  return result;
10584
10586
  }
10585
10587
  default:
@@ -10627,7 +10629,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10627
10629
  return result;
10628
10630
  }
10629
10631
 
10630
- Py_DECREF(result);
10632
+ Py_DECREF_IMMORTAL(result);
10631
10633
  }
10632
10634
 
10633
10635
  // No rich comparison worked, but maybe compare works.
@@ -10668,7 +10670,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10668
10670
 
10669
10671
  bool r = c != 0;
10670
10672
  PyObject *result = BOOL_FROM(r);
10671
- Py_INCREF(result);
10673
+ Py_INCREF_IMMORTAL(result);
10672
10674
  return result;
10673
10675
  }
10674
10676
  }
@@ -10677,7 +10679,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10677
10679
  richcmpfunc f;
10678
10680
 
10679
10681
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10680
- f = RICHCOMPARE(type2);
10682
+ f = TP_RICHCOMPARE(type2);
10681
10683
 
10682
10684
  if (f != NULL) {
10683
10685
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -10688,7 +10690,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10688
10690
  return result;
10689
10691
  }
10690
10692
 
10691
- Py_DECREF(result);
10693
+ Py_DECREF_IMMORTAL(result);
10692
10694
  }
10693
10695
  }
10694
10696
 
@@ -10702,10 +10704,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10702
10704
  return result;
10703
10705
  }
10704
10706
 
10705
- Py_DECREF(result);
10707
+ Py_DECREF_IMMORTAL(result);
10706
10708
  }
10707
10709
 
10708
- f = RICHCOMPARE(type2);
10710
+ f = TP_RICHCOMPARE(type2);
10709
10711
  if (f != NULL) {
10710
10712
  PyObject *result = (*f)(operand2, operand1, Py_GE);
10711
10713
 
@@ -10715,7 +10717,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10715
10717
  return result;
10716
10718
  }
10717
10719
 
10718
- Py_DECREF(result);
10720
+ Py_DECREF_IMMORTAL(result);
10719
10721
  }
10720
10722
 
10721
10723
  int c;
@@ -10803,14 +10805,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10803
10805
 
10804
10806
  bool r = c != 0;
10805
10807
  PyObject *result = BOOL_FROM(r);
10806
- Py_INCREF(result);
10808
+ Py_INCREF_IMMORTAL(result);
10807
10809
  return result;
10808
10810
  #else
10809
10811
  bool checked_reverse_op = false;
10810
10812
  richcmpfunc f;
10811
10813
 
10812
10814
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10813
- f = RICHCOMPARE(type2);
10815
+ f = TP_RICHCOMPARE(type2);
10814
10816
 
10815
10817
  if (f != NULL) {
10816
10818
  checked_reverse_op = true;
@@ -10823,7 +10825,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10823
10825
  return result;
10824
10826
  }
10825
10827
 
10826
- Py_DECREF(result);
10828
+ Py_DECREF_IMMORTAL(result);
10827
10829
  }
10828
10830
  }
10829
10831
 
@@ -10838,11 +10840,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10838
10840
  return result;
10839
10841
  }
10840
10842
 
10841
- Py_DECREF(result);
10843
+ Py_DECREF_IMMORTAL(result);
10842
10844
  }
10843
10845
 
10844
10846
  if (checked_reverse_op == false) {
10845
- f = RICHCOMPARE(type2);
10847
+ f = TP_RICHCOMPARE(type2);
10846
10848
 
10847
10849
  if (f != NULL) {
10848
10850
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -10853,7 +10855,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10853
10855
  return result;
10854
10856
  }
10855
10857
 
10856
- Py_DECREF(result);
10858
+ Py_DECREF_IMMORTAL(result);
10857
10859
  }
10858
10860
  }
10859
10861
 
@@ -10865,13 +10867,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10865
10867
  case Py_EQ: {
10866
10868
  bool r = operand1 == operand2;
10867
10869
  PyObject *result = BOOL_FROM(r);
10868
- Py_INCREF(result);
10870
+ Py_INCREF_IMMORTAL(result);
10869
10871
  return result;
10870
10872
  }
10871
10873
  case Py_NE: {
10872
10874
  bool r = operand1 != operand2;
10873
10875
  PyObject *result = BOOL_FROM(r);
10874
- Py_INCREF(result);
10876
+ Py_INCREF_IMMORTAL(result);
10875
10877
  return result;
10876
10878
  }
10877
10879
  default:
@@ -10900,14 +10902,11 @@ static nuitka_bool COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10900
10902
  PyListObject *a = (PyListObject *)operand1;
10901
10903
  PyListObject *b = (PyListObject *)operand2;
10902
10904
 
10903
- Py_ssize_t len_a = Py_SIZE(a);
10904
- Py_ssize_t len_b = Py_SIZE(b);
10905
-
10906
10905
  bool found = false;
10907
10906
  nuitka_bool res = NUITKA_BOOL_TRUE;
10908
10907
 
10909
10908
  Py_ssize_t i;
10910
- for (i = 0; i < len_a && i < len_b; i++) {
10909
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10911
10910
  PyObject *aa = a->ob_item[i];
10912
10911
  PyObject *bb = b->ob_item[i];
10913
10912
 
@@ -10915,7 +10914,11 @@ static nuitka_bool COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10915
10914
  continue;
10916
10915
  }
10917
10916
 
10917
+ Py_INCREF(aa);
10918
+ Py_INCREF(bb);
10918
10919
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10920
+ Py_DECREF(aa);
10921
+ Py_DECREF(bb);
10919
10922
 
10920
10923
  if (res == NUITKA_BOOL_EXCEPTION) {
10921
10924
  return NUITKA_BOOL_EXCEPTION;
@@ -10928,7 +10931,7 @@ static nuitka_bool COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10928
10931
  }
10929
10932
 
10930
10933
  if (found == false) {
10931
- bool r = len_a <= len_b;
10934
+ bool r = Py_SIZE(a) <= Py_SIZE(b);
10932
10935
 
10933
10936
  // Convert to target type.
10934
10937
  nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
@@ -10980,7 +10983,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10980
10983
  }
10981
10984
  }
10982
10985
 
10983
- Py_DECREF(result);
10986
+ Py_DECREF_IMMORTAL(result);
10984
10987
  }
10985
10988
 
10986
10989
  // No rich comparison worked, but maybe compare works.
@@ -11049,11 +11052,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11049
11052
  }
11050
11053
  }
11051
11054
 
11052
- Py_DECREF(result);
11055
+ Py_DECREF_IMMORTAL(result);
11053
11056
  }
11054
11057
  }
11055
11058
 
11056
- f = RICHCOMPARE(type1);
11059
+ f = TP_RICHCOMPARE(type1);
11057
11060
  if (f != NULL) {
11058
11061
  PyObject *result = (*f)(operand1, operand2, Py_LE);
11059
11062
 
@@ -11071,7 +11074,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11071
11074
  }
11072
11075
  }
11073
11076
 
11074
- Py_DECREF(result);
11077
+ Py_DECREF_IMMORTAL(result);
11075
11078
  }
11076
11079
 
11077
11080
  f = PyList_Type.tp_richcompare;
@@ -11092,7 +11095,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11092
11095
  }
11093
11096
  }
11094
11097
 
11095
- Py_DECREF(result);
11098
+ Py_DECREF_IMMORTAL(result);
11096
11099
  }
11097
11100
 
11098
11101
  int c;
@@ -11208,11 +11211,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11208
11211
  }
11209
11212
  }
11210
11213
 
11211
- Py_DECREF(result);
11214
+ Py_DECREF_IMMORTAL(result);
11212
11215
  }
11213
11216
  }
11214
11217
 
11215
- f = RICHCOMPARE(type1);
11218
+ f = TP_RICHCOMPARE(type1);
11216
11219
 
11217
11220
  if (f != NULL) {
11218
11221
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -11231,7 +11234,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11231
11234
  }
11232
11235
  }
11233
11236
 
11234
- Py_DECREF(result);
11237
+ Py_DECREF_IMMORTAL(result);
11235
11238
  }
11236
11239
 
11237
11240
  if (checked_reverse_op == false) {
@@ -11254,7 +11257,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11254
11257
  }
11255
11258
  }
11256
11259
 
11257
- Py_DECREF(result);
11260
+ Py_DECREF_IMMORTAL(result);
11258
11261
  }
11259
11262
  }
11260
11263
 
@@ -11328,7 +11331,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11328
11331
  }
11329
11332
  }
11330
11333
 
11331
- Py_DECREF(result);
11334
+ Py_DECREF_IMMORTAL(result);
11332
11335
  }
11333
11336
 
11334
11337
  // No rich comparison worked, but maybe compare works.
@@ -11378,7 +11381,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11378
11381
  richcmpfunc f;
11379
11382
 
11380
11383
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11381
- f = RICHCOMPARE(type2);
11384
+ f = TP_RICHCOMPARE(type2);
11382
11385
 
11383
11386
  if (f != NULL) {
11384
11387
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -11397,7 +11400,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11397
11400
  }
11398
11401
  }
11399
11402
 
11400
- Py_DECREF(result);
11403
+ Py_DECREF_IMMORTAL(result);
11401
11404
  }
11402
11405
  }
11403
11406
 
@@ -11419,10 +11422,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11419
11422
  }
11420
11423
  }
11421
11424
 
11422
- Py_DECREF(result);
11425
+ Py_DECREF_IMMORTAL(result);
11423
11426
  }
11424
11427
 
11425
- f = RICHCOMPARE(type2);
11428
+ f = TP_RICHCOMPARE(type2);
11426
11429
  if (f != NULL) {
11427
11430
  PyObject *result = (*f)(operand2, operand1, Py_GE);
11428
11431
 
@@ -11440,7 +11443,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11440
11443
  }
11441
11444
  }
11442
11445
 
11443
- Py_DECREF(result);
11446
+ Py_DECREF_IMMORTAL(result);
11444
11447
  }
11445
11448
 
11446
11449
  int c;
@@ -11535,7 +11538,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11535
11538
  richcmpfunc f;
11536
11539
 
11537
11540
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11538
- f = RICHCOMPARE(type2);
11541
+ f = TP_RICHCOMPARE(type2);
11539
11542
 
11540
11543
  if (f != NULL) {
11541
11544
  checked_reverse_op = true;
@@ -11556,7 +11559,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11556
11559
  }
11557
11560
  }
11558
11561
 
11559
- Py_DECREF(result);
11562
+ Py_DECREF_IMMORTAL(result);
11560
11563
  }
11561
11564
  }
11562
11565
 
@@ -11579,11 +11582,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11579
11582
  }
11580
11583
  }
11581
11584
 
11582
- Py_DECREF(result);
11585
+ Py_DECREF_IMMORTAL(result);
11583
11586
  }
11584
11587
 
11585
11588
  if (checked_reverse_op == false) {
11586
- f = RICHCOMPARE(type2);
11589
+ f = TP_RICHCOMPARE(type2);
11587
11590
 
11588
11591
  if (f != NULL) {
11589
11592
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -11602,7 +11605,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11602
11605
  }
11603
11606
  }
11604
11607
 
11605
- Py_DECREF(result);
11608
+ Py_DECREF_IMMORTAL(result);
11606
11609
  }
11607
11610
  }
11608
11611
 
@@ -11640,7 +11643,6 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operan
11640
11643
  return COMPARE_LE_NBOOL_LIST_LIST(operand1, operand2);
11641
11644
  }
11642
11645
 
11643
- #if PYTHON_VERSION < 0x300
11644
11646
  static PyObject *COMPARE_LE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {
11645
11647
  CHECK_OBJECT(operand1);
11646
11648
  assert(PyLong_CheckExact(operand1));
@@ -11659,7 +11661,7 @@ static PyObject *COMPARE_LE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11659
11661
  }
11660
11662
 
11661
11663
  Py_ssize_t operand2_digit_count = 0;
11662
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11664
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11663
11665
  {
11664
11666
  unsigned long t = operand2_abs_ival;
11665
11667
 
@@ -11672,19 +11674,20 @@ static PyObject *COMPARE_LE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11672
11674
  }
11673
11675
  }
11674
11676
 
11675
- Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
11677
+ NUITKA_MAY_BE_UNUSED Py_ssize_t operand2_size =
11678
+ operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
11676
11679
 
11677
11680
  bool r;
11678
11681
 
11679
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11680
- r = Py_SIZE(operand1_long_object) - operand2_size < 0;
11682
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11683
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size < 0;
11681
11684
  } else {
11682
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11685
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11683
11686
  r = true;
11684
11687
  while (--i >= 0) {
11685
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11686
- r = operand1_long_object->ob_digit[i] < operand2_digits[i];
11687
- if (Py_SIZE(operand1_long_object) < 0) {
11688
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11689
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];
11690
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11688
11691
  r = !r;
11689
11692
  }
11690
11693
  break;
@@ -11694,9 +11697,10 @@ static PyObject *COMPARE_LE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11694
11697
 
11695
11698
  // Convert to target type.
11696
11699
  PyObject *result = BOOL_FROM(r);
11697
- Py_INCREF(result);
11700
+ Py_INCREF_IMMORTAL(result);
11698
11701
  return result;
11699
11702
  }
11703
+ #if PYTHON_VERSION < 0x300
11700
11704
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
11701
11705
  PyObject *RICH_COMPARE_LE_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
11702
11706
 
@@ -11704,7 +11708,6 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2
11704
11708
  }
11705
11709
  #endif
11706
11710
 
11707
- #if PYTHON_VERSION < 0x300
11708
11711
  static bool COMPARE_LE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11709
11712
  CHECK_OBJECT(operand1);
11710
11713
  assert(PyLong_CheckExact(operand1));
@@ -11723,7 +11726,7 @@ static bool COMPARE_LE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11723
11726
  }
11724
11727
 
11725
11728
  Py_ssize_t operand2_digit_count = 0;
11726
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11729
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11727
11730
  {
11728
11731
  unsigned long t = operand2_abs_ival;
11729
11732
 
@@ -11736,19 +11739,20 @@ static bool COMPARE_LE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11736
11739
  }
11737
11740
  }
11738
11741
 
11739
- Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
11742
+ NUITKA_MAY_BE_UNUSED Py_ssize_t operand2_size =
11743
+ operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
11740
11744
 
11741
11745
  bool r;
11742
11746
 
11743
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11744
- r = Py_SIZE(operand1_long_object) - operand2_size < 0;
11747
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11748
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size < 0;
11745
11749
  } else {
11746
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11750
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11747
11751
  r = true;
11748
11752
  while (--i >= 0) {
11749
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11750
- r = operand1_long_object->ob_digit[i] < operand2_digits[i];
11751
- if (Py_SIZE(operand1_long_object) < 0) {
11753
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11754
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];
11755
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11752
11756
  r = !r;
11753
11757
  }
11754
11758
  break;
@@ -11761,6 +11765,7 @@ static bool COMPARE_LE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11761
11765
 
11762
11766
  return result;
11763
11767
  }
11768
+ #if PYTHON_VERSION < 0x300
11764
11769
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
11765
11770
  bool RICH_COMPARE_LE_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
11766
11771
 
@@ -11780,9 +11785,11 @@ static PyObject *COMPARE_LE_OBJECT_INT_CLONG(PyObject *operand1, long operand2)
11780
11785
 
11781
11786
  // Convert to target type.
11782
11787
  PyObject *result = BOOL_FROM(r);
11783
- Py_INCREF(result);
11788
+ Py_INCREF_IMMORTAL(result);
11784
11789
  return result;
11785
11790
  }
11791
+ #endif
11792
+ #if PYTHON_VERSION < 0x300
11786
11793
  /* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
11787
11794
  PyObject *RICH_COMPARE_LE_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {
11788
11795
 
@@ -11805,6 +11812,8 @@ static bool COMPARE_LE_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {
11805
11812
 
11806
11813
  return result;
11807
11814
  }
11815
+ #endif
11816
+ #if PYTHON_VERSION < 0x300
11808
11817
  /* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
11809
11818
  bool RICH_COMPARE_LE_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {
11810
11819
 
@@ -11821,15 +11830,18 @@ static PyObject *COMPARE_LE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11821
11830
 
11822
11831
  bool r;
11823
11832
 
11824
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11825
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;
11833
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11834
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11835
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11836
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) <
11837
+ 0;
11826
11838
  } else {
11827
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11839
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11828
11840
  r = true;
11829
11841
  while (--i >= 0) {
11830
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11831
- r = operand1_long_object->ob_digit[i] < (digit)Py_ABS(operand2);
11832
- if (Py_SIZE(operand1_long_object) < 0) {
11842
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11843
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);
11844
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11833
11845
  r = !r;
11834
11846
  }
11835
11847
  break;
@@ -11839,7 +11851,7 @@ static PyObject *COMPARE_LE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11839
11851
 
11840
11852
  // Convert to target type.
11841
11853
  PyObject *result = BOOL_FROM(r);
11842
- Py_INCREF(result);
11854
+ Py_INCREF_IMMORTAL(result);
11843
11855
  return result;
11844
11856
  }
11845
11857
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "DIGIT" to C platform digit value for long
@@ -11858,15 +11870,18 @@ static bool COMPARE_LE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {
11858
11870
 
11859
11871
  bool r;
11860
11872
 
11861
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11862
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;
11873
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11874
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11875
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11876
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) <
11877
+ 0;
11863
11878
  } else {
11864
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11879
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11865
11880
  r = true;
11866
11881
  while (--i >= 0) {
11867
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11868
- r = operand1_long_object->ob_digit[i] < (digit)Py_ABS(operand2);
11869
- if (Py_SIZE(operand1_long_object) < 0) {
11882
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11883
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);
11884
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11870
11885
  r = !r;
11871
11886
  }
11872
11887
  break;
@@ -11897,7 +11912,7 @@ static PyObject *COMPARE_LE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double opera
11897
11912
 
11898
11913
  // Convert to target type.
11899
11914
  PyObject *result = BOOL_FROM(r);
11900
- Py_INCREF(result);
11915
+ Py_INCREF_IMMORTAL(result);
11901
11916
  return result;
11902
11917
  }
11903
11918
  /* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
@@ -11925,3 +11940,18 @@ bool RICH_COMPARE_LE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
11925
11940
 
11926
11941
  return COMPARE_LE_CBOOL_FLOAT_CFLOAT(operand1, operand2);
11927
11942
  }
11943
+
11944
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
11945
+ // integrates with CPython, but also works on its own.
11946
+ //
11947
+ // Licensed under the Apache License, Version 2.0 (the "License");
11948
+ // you may not use this file except in compliance with the License.
11949
+ // You may obtain a copy of the License at
11950
+ //
11951
+ // http://www.apache.org/licenses/LICENSE-2.0
11952
+ //
11953
+ // Unless required by applicable law or agreed to in writing, software
11954
+ // distributed under the License is distributed on an "AS IS" BASIS,
11955
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11956
+ // See the License for the specific language governing permissions and
11957
+ // limitations under the License.