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_LT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand
38
23
 
39
24
  // Convert to target type.
40
25
  PyObject *result = BOOL_FROM(r);
41
- Py_INCREF(result);
26
+ Py_INCREF_IMMORTAL(result);
42
27
  return result;
43
28
  }
44
29
  #endif
@@ -86,7 +71,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
86
71
  // If the types are equal, we may get away immediately except for instances.
87
72
  if (type1 == type2 && !PyInstance_Check(operand1)) {
88
73
 
89
- richcmpfunc frich = RICHCOMPARE(type1);
74
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
90
75
 
91
76
  if (frich != NULL) {
92
77
  PyObject *result = (*frich)(operand1, operand2, Py_LT);
@@ -97,7 +82,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
97
82
  return result;
98
83
  }
99
84
 
100
- Py_DECREF(result);
85
+ Py_DECREF_IMMORTAL(result);
101
86
  }
102
87
 
103
88
  // No rich comparison worked, but maybe compare works.
@@ -138,7 +123,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
138
123
 
139
124
  bool r = c != 0;
140
125
  PyObject *result = BOOL_FROM(r);
141
- Py_INCREF(result);
126
+ Py_INCREF_IMMORTAL(result);
142
127
  return result;
143
128
  }
144
129
  }
@@ -147,7 +132,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
147
132
  richcmpfunc f;
148
133
 
149
134
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
150
- f = RICHCOMPARE(type2);
135
+ f = TP_RICHCOMPARE(type2);
151
136
 
152
137
  if (f != NULL) {
153
138
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -158,11 +143,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
158
143
  return result;
159
144
  }
160
145
 
161
- Py_DECREF(result);
146
+ Py_DECREF_IMMORTAL(result);
162
147
  }
163
148
  }
164
149
 
165
- f = RICHCOMPARE(type1);
150
+ f = TP_RICHCOMPARE(type1);
166
151
  if (f != NULL) {
167
152
  PyObject *result = (*f)(operand1, operand2, Py_LT);
168
153
 
@@ -172,10 +157,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
172
157
  return result;
173
158
  }
174
159
 
175
- Py_DECREF(result);
160
+ Py_DECREF_IMMORTAL(result);
176
161
  }
177
162
 
178
- f = RICHCOMPARE(type2);
163
+ f = TP_RICHCOMPARE(type2);
179
164
  if (f != NULL) {
180
165
  PyObject *result = (*f)(operand2, operand1, Py_GT);
181
166
 
@@ -185,7 +170,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
185
170
  return result;
186
171
  }
187
172
 
188
- Py_DECREF(result);
173
+ Py_DECREF_IMMORTAL(result);
189
174
  }
190
175
 
191
176
  int c;
@@ -273,14 +258,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
273
258
 
274
259
  bool r = c != 0;
275
260
  PyObject *result = BOOL_FROM(r);
276
- Py_INCREF(result);
261
+ Py_INCREF_IMMORTAL(result);
277
262
  return result;
278
263
  #else
279
264
  bool checked_reverse_op = false;
280
265
  richcmpfunc f;
281
266
 
282
267
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
283
- f = RICHCOMPARE(type2);
268
+ f = TP_RICHCOMPARE(type2);
284
269
 
285
270
  if (f != NULL) {
286
271
  checked_reverse_op = true;
@@ -293,11 +278,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
293
278
  return result;
294
279
  }
295
280
 
296
- Py_DECREF(result);
281
+ Py_DECREF_IMMORTAL(result);
297
282
  }
298
283
  }
299
284
 
300
- f = RICHCOMPARE(type1);
285
+ f = TP_RICHCOMPARE(type1);
301
286
 
302
287
  if (f != NULL) {
303
288
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -308,11 +293,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
308
293
  return result;
309
294
  }
310
295
 
311
- Py_DECREF(result);
296
+ Py_DECREF_IMMORTAL(result);
312
297
  }
313
298
 
314
299
  if (checked_reverse_op == false) {
315
- f = RICHCOMPARE(type2);
300
+ f = TP_RICHCOMPARE(type2);
316
301
 
317
302
  if (f != NULL) {
318
303
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -323,7 +308,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
323
308
  return result;
324
309
  }
325
310
 
326
- Py_DECREF(result);
311
+ Py_DECREF_IMMORTAL(result);
327
312
  }
328
313
  }
329
314
 
@@ -335,13 +320,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
335
320
  case Py_EQ: {
336
321
  bool r = operand1 == operand2;
337
322
  PyObject *result = BOOL_FROM(r);
338
- Py_INCREF(result);
323
+ Py_INCREF_IMMORTAL(result);
339
324
  return result;
340
325
  }
341
326
  case Py_NE: {
342
327
  bool r = operand1 != operand2;
343
328
  PyObject *result = BOOL_FROM(r);
344
- Py_INCREF(result);
329
+ Py_INCREF_IMMORTAL(result);
345
330
  return result;
346
331
  }
347
332
  default:
@@ -382,7 +367,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
382
367
  // If the types are equal, we may get away immediately except for instances.
383
368
  if (type1 == type2 && !PyInstance_Check(operand1)) {
384
369
 
385
- richcmpfunc frich = RICHCOMPARE(type1);
370
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
386
371
 
387
372
  if (frich != NULL) {
388
373
  PyObject *result = (*frich)(operand1, operand2, Py_LT);
@@ -401,7 +386,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
401
386
  }
402
387
  }
403
388
 
404
- Py_DECREF(result);
389
+ Py_DECREF_IMMORTAL(result);
405
390
  }
406
391
 
407
392
  // No rich comparison worked, but maybe compare works.
@@ -451,7 +436,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
451
436
  richcmpfunc f;
452
437
 
453
438
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
454
- f = RICHCOMPARE(type2);
439
+ f = TP_RICHCOMPARE(type2);
455
440
 
456
441
  if (f != NULL) {
457
442
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -470,11 +455,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
470
455
  }
471
456
  }
472
457
 
473
- Py_DECREF(result);
458
+ Py_DECREF_IMMORTAL(result);
474
459
  }
475
460
  }
476
461
 
477
- f = RICHCOMPARE(type1);
462
+ f = TP_RICHCOMPARE(type1);
478
463
  if (f != NULL) {
479
464
  PyObject *result = (*f)(operand1, operand2, Py_LT);
480
465
 
@@ -492,10 +477,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
492
477
  }
493
478
  }
494
479
 
495
- Py_DECREF(result);
480
+ Py_DECREF_IMMORTAL(result);
496
481
  }
497
482
 
498
- f = RICHCOMPARE(type2);
483
+ f = TP_RICHCOMPARE(type2);
499
484
  if (f != NULL) {
500
485
  PyObject *result = (*f)(operand2, operand1, Py_GT);
501
486
 
@@ -513,7 +498,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
513
498
  }
514
499
  }
515
500
 
516
- Py_DECREF(result);
501
+ Py_DECREF_IMMORTAL(result);
517
502
  }
518
503
 
519
504
  int c;
@@ -608,7 +593,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
608
593
  richcmpfunc f;
609
594
 
610
595
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
611
- f = RICHCOMPARE(type2);
596
+ f = TP_RICHCOMPARE(type2);
612
597
 
613
598
  if (f != NULL) {
614
599
  checked_reverse_op = true;
@@ -629,11 +614,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
629
614
  }
630
615
  }
631
616
 
632
- Py_DECREF(result);
617
+ Py_DECREF_IMMORTAL(result);
633
618
  }
634
619
  }
635
620
 
636
- f = RICHCOMPARE(type1);
621
+ f = TP_RICHCOMPARE(type1);
637
622
 
638
623
  if (f != NULL) {
639
624
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -652,11 +637,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
652
637
  }
653
638
  }
654
639
 
655
- Py_DECREF(result);
640
+ Py_DECREF_IMMORTAL(result);
656
641
  }
657
642
 
658
643
  if (checked_reverse_op == false) {
659
- f = RICHCOMPARE(type2);
644
+ f = TP_RICHCOMPARE(type2);
660
645
 
661
646
  if (f != NULL) {
662
647
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -675,7 +660,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
675
660
  }
676
661
  }
677
662
 
678
- Py_DECREF(result);
663
+ Py_DECREF_IMMORTAL(result);
679
664
  }
680
665
  }
681
666
 
@@ -724,7 +709,7 @@ static PyObject *COMPARE_LT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
724
709
 
725
710
  // Convert to target type.
726
711
  PyObject *result = BOOL_FROM(r);
727
- Py_INCREF(result);
712
+ Py_INCREF_IMMORTAL(result);
728
713
  return result;
729
714
  }
730
715
 
@@ -752,9 +737,11 @@ static PyObject *COMPARE_LT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
752
737
 
753
738
  // Convert to target type.
754
739
  PyObject *result = BOOL_FROM(c != 0);
755
- Py_INCREF(result);
740
+ Py_INCREF_IMMORTAL(result);
756
741
  return result;
757
742
  }
743
+ #endif
744
+ #if PYTHON_VERSION < 0x300
758
745
  /* Code referring to "OBJECT" corresponds to any Python object and "STR" to Python2 'str'. */
759
746
  PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {
760
747
 
@@ -789,7 +776,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
789
776
  return result;
790
777
  }
791
778
 
792
- Py_DECREF(result);
779
+ Py_DECREF_IMMORTAL(result);
793
780
  }
794
781
 
795
782
  // No rich comparison worked, but maybe compare works.
@@ -830,7 +817,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
830
817
 
831
818
  bool r = c != 0;
832
819
  PyObject *result = BOOL_FROM(r);
833
- Py_INCREF(result);
820
+ Py_INCREF_IMMORTAL(result);
834
821
  return result;
835
822
  }
836
823
  }
@@ -850,11 +837,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
850
837
  return result;
851
838
  }
852
839
 
853
- Py_DECREF(result);
840
+ Py_DECREF_IMMORTAL(result);
854
841
  }
855
842
  }
856
843
 
857
- f = RICHCOMPARE(type1);
844
+ f = TP_RICHCOMPARE(type1);
858
845
  if (f != NULL) {
859
846
  PyObject *result = (*f)(operand1, operand2, Py_LT);
860
847
 
@@ -864,7 +851,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
864
851
  return result;
865
852
  }
866
853
 
867
- Py_DECREF(result);
854
+ Py_DECREF_IMMORTAL(result);
868
855
  }
869
856
 
870
857
  f = PyString_Type.tp_richcompare;
@@ -877,7 +864,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
877
864
  return result;
878
865
  }
879
866
 
880
- Py_DECREF(result);
867
+ Py_DECREF_IMMORTAL(result);
881
868
  }
882
869
 
883
870
  int c;
@@ -965,7 +952,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
965
952
 
966
953
  bool r = c != 0;
967
954
  PyObject *result = BOOL_FROM(r);
968
- Py_INCREF(result);
955
+ Py_INCREF_IMMORTAL(result);
969
956
  return result;
970
957
  #else
971
958
  bool checked_reverse_op = false;
@@ -985,11 +972,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
985
972
  return result;
986
973
  }
987
974
 
988
- Py_DECREF(result);
975
+ Py_DECREF_IMMORTAL(result);
989
976
  }
990
977
  }
991
978
 
992
- f = RICHCOMPARE(type1);
979
+ f = TP_RICHCOMPARE(type1);
993
980
 
994
981
  if (f != NULL) {
995
982
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -1000,7 +987,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1000
987
  return result;
1001
988
  }
1002
989
 
1003
- Py_DECREF(result);
990
+ Py_DECREF_IMMORTAL(result);
1004
991
  }
1005
992
 
1006
993
  if (checked_reverse_op == false) {
@@ -1015,7 +1002,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1015
1002
  return result;
1016
1003
  }
1017
1004
 
1018
- Py_DECREF(result);
1005
+ Py_DECREF_IMMORTAL(result);
1019
1006
  }
1020
1007
  }
1021
1008
 
@@ -1027,13 +1014,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1027
1014
  case Py_EQ: {
1028
1015
  bool r = operand1 == operand2;
1029
1016
  PyObject *result = BOOL_FROM(r);
1030
- Py_INCREF(result);
1017
+ Py_INCREF_IMMORTAL(result);
1031
1018
  return result;
1032
1019
  }
1033
1020
  case Py_NE: {
1034
1021
  bool r = operand1 != operand2;
1035
1022
  PyObject *result = BOOL_FROM(r);
1036
- Py_INCREF(result);
1023
+ Py_INCREF_IMMORTAL(result);
1037
1024
  return result;
1038
1025
  }
1039
1026
  default:
@@ -1083,7 +1070,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1083
1070
  return result;
1084
1071
  }
1085
1072
 
1086
- Py_DECREF(result);
1073
+ Py_DECREF_IMMORTAL(result);
1087
1074
  }
1088
1075
 
1089
1076
  // No rich comparison worked, but maybe compare works.
@@ -1124,7 +1111,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1124
1111
 
1125
1112
  bool r = c != 0;
1126
1113
  PyObject *result = BOOL_FROM(r);
1127
- Py_INCREF(result);
1114
+ Py_INCREF_IMMORTAL(result);
1128
1115
  return result;
1129
1116
  }
1130
1117
  }
@@ -1133,7 +1120,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1133
1120
  richcmpfunc f;
1134
1121
 
1135
1122
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1136
- f = RICHCOMPARE(type2);
1123
+ f = TP_RICHCOMPARE(type2);
1137
1124
 
1138
1125
  if (f != NULL) {
1139
1126
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -1144,7 +1131,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1144
1131
  return result;
1145
1132
  }
1146
1133
 
1147
- Py_DECREF(result);
1134
+ Py_DECREF_IMMORTAL(result);
1148
1135
  }
1149
1136
  }
1150
1137
 
@@ -1158,10 +1145,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1158
1145
  return result;
1159
1146
  }
1160
1147
 
1161
- Py_DECREF(result);
1148
+ Py_DECREF_IMMORTAL(result);
1162
1149
  }
1163
1150
 
1164
- f = RICHCOMPARE(type2);
1151
+ f = TP_RICHCOMPARE(type2);
1165
1152
  if (f != NULL) {
1166
1153
  PyObject *result = (*f)(operand2, operand1, Py_GT);
1167
1154
 
@@ -1171,7 +1158,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1171
1158
  return result;
1172
1159
  }
1173
1160
 
1174
- Py_DECREF(result);
1161
+ Py_DECREF_IMMORTAL(result);
1175
1162
  }
1176
1163
 
1177
1164
  int c;
@@ -1259,14 +1246,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1259
1246
 
1260
1247
  bool r = c != 0;
1261
1248
  PyObject *result = BOOL_FROM(r);
1262
- Py_INCREF(result);
1249
+ Py_INCREF_IMMORTAL(result);
1263
1250
  return result;
1264
1251
  #else
1265
1252
  bool checked_reverse_op = false;
1266
1253
  richcmpfunc f;
1267
1254
 
1268
1255
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1269
- f = RICHCOMPARE(type2);
1256
+ f = TP_RICHCOMPARE(type2);
1270
1257
 
1271
1258
  if (f != NULL) {
1272
1259
  checked_reverse_op = true;
@@ -1279,7 +1266,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1279
1266
  return result;
1280
1267
  }
1281
1268
 
1282
- Py_DECREF(result);
1269
+ Py_DECREF_IMMORTAL(result);
1283
1270
  }
1284
1271
  }
1285
1272
 
@@ -1294,11 +1281,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1294
1281
  return result;
1295
1282
  }
1296
1283
 
1297
- Py_DECREF(result);
1284
+ Py_DECREF_IMMORTAL(result);
1298
1285
  }
1299
1286
 
1300
1287
  if (checked_reverse_op == false) {
1301
- f = RICHCOMPARE(type2);
1288
+ f = TP_RICHCOMPARE(type2);
1302
1289
 
1303
1290
  if (f != NULL) {
1304
1291
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -1309,7 +1296,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1309
1296
  return result;
1310
1297
  }
1311
1298
 
1312
- Py_DECREF(result);
1299
+ Py_DECREF_IMMORTAL(result);
1313
1300
  }
1314
1301
  }
1315
1302
 
@@ -1321,13 +1308,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1321
1308
  case Py_EQ: {
1322
1309
  bool r = operand1 == operand2;
1323
1310
  PyObject *result = BOOL_FROM(r);
1324
- Py_INCREF(result);
1311
+ Py_INCREF_IMMORTAL(result);
1325
1312
  return result;
1326
1313
  }
1327
1314
  case Py_NE: {
1328
1315
  bool r = operand1 != operand2;
1329
1316
  PyObject *result = BOOL_FROM(r);
1330
- Py_INCREF(result);
1317
+ Py_INCREF_IMMORTAL(result);
1331
1318
  return result;
1332
1319
  }
1333
1320
  default:
@@ -1397,6 +1384,8 @@ static bool COMPARE_LT_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {
1397
1384
 
1398
1385
  return result;
1399
1386
  }
1387
+ #endif
1388
+ #if PYTHON_VERSION < 0x300
1400
1389
  /* Code referring to "STR" corresponds to Python2 'str' and "STR" to Python2 'str'. */
1401
1390
  bool RICH_COMPARE_LT_CBOOL_STR_STR(PyObject *operand1, PyObject *operand2) {
1402
1391
 
@@ -1447,7 +1436,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1447
1436
  }
1448
1437
  }
1449
1438
 
1450
- Py_DECREF(result);
1439
+ Py_DECREF_IMMORTAL(result);
1451
1440
  }
1452
1441
 
1453
1442
  // No rich comparison worked, but maybe compare works.
@@ -1516,11 +1505,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1516
1505
  }
1517
1506
  }
1518
1507
 
1519
- Py_DECREF(result);
1508
+ Py_DECREF_IMMORTAL(result);
1520
1509
  }
1521
1510
  }
1522
1511
 
1523
- f = RICHCOMPARE(type1);
1512
+ f = TP_RICHCOMPARE(type1);
1524
1513
  if (f != NULL) {
1525
1514
  PyObject *result = (*f)(operand1, operand2, Py_LT);
1526
1515
 
@@ -1538,7 +1527,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1538
1527
  }
1539
1528
  }
1540
1529
 
1541
- Py_DECREF(result);
1530
+ Py_DECREF_IMMORTAL(result);
1542
1531
  }
1543
1532
 
1544
1533
  f = PyString_Type.tp_richcompare;
@@ -1559,7 +1548,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1559
1548
  }
1560
1549
  }
1561
1550
 
1562
- Py_DECREF(result);
1551
+ Py_DECREF_IMMORTAL(result);
1563
1552
  }
1564
1553
 
1565
1554
  int c;
@@ -1675,11 +1664,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1675
1664
  }
1676
1665
  }
1677
1666
 
1678
- Py_DECREF(result);
1667
+ Py_DECREF_IMMORTAL(result);
1679
1668
  }
1680
1669
  }
1681
1670
 
1682
- f = RICHCOMPARE(type1);
1671
+ f = TP_RICHCOMPARE(type1);
1683
1672
 
1684
1673
  if (f != NULL) {
1685
1674
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -1698,7 +1687,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1698
1687
  }
1699
1688
  }
1700
1689
 
1701
- Py_DECREF(result);
1690
+ Py_DECREF_IMMORTAL(result);
1702
1691
  }
1703
1692
 
1704
1693
  if (checked_reverse_op == false) {
@@ -1721,7 +1710,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1721
1710
  }
1722
1711
  }
1723
1712
 
1724
- Py_DECREF(result);
1713
+ Py_DECREF_IMMORTAL(result);
1725
1714
  }
1726
1715
  }
1727
1716
 
@@ -1797,7 +1786,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1797
1786
  }
1798
1787
  }
1799
1788
 
1800
- Py_DECREF(result);
1789
+ Py_DECREF_IMMORTAL(result);
1801
1790
  }
1802
1791
 
1803
1792
  // No rich comparison worked, but maybe compare works.
@@ -1847,7 +1836,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1847
1836
  richcmpfunc f;
1848
1837
 
1849
1838
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1850
- f = RICHCOMPARE(type2);
1839
+ f = TP_RICHCOMPARE(type2);
1851
1840
 
1852
1841
  if (f != NULL) {
1853
1842
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -1866,7 +1855,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1866
1855
  }
1867
1856
  }
1868
1857
 
1869
- Py_DECREF(result);
1858
+ Py_DECREF_IMMORTAL(result);
1870
1859
  }
1871
1860
  }
1872
1861
 
@@ -1888,10 +1877,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1888
1877
  }
1889
1878
  }
1890
1879
 
1891
- Py_DECREF(result);
1880
+ Py_DECREF_IMMORTAL(result);
1892
1881
  }
1893
1882
 
1894
- f = RICHCOMPARE(type2);
1883
+ f = TP_RICHCOMPARE(type2);
1895
1884
  if (f != NULL) {
1896
1885
  PyObject *result = (*f)(operand2, operand1, Py_GT);
1897
1886
 
@@ -1909,7 +1898,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1909
1898
  }
1910
1899
  }
1911
1900
 
1912
- Py_DECREF(result);
1901
+ Py_DECREF_IMMORTAL(result);
1913
1902
  }
1914
1903
 
1915
1904
  int c;
@@ -2004,7 +1993,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2004
1993
  richcmpfunc f;
2005
1994
 
2006
1995
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
2007
- f = RICHCOMPARE(type2);
1996
+ f = TP_RICHCOMPARE(type2);
2008
1997
 
2009
1998
  if (f != NULL) {
2010
1999
  checked_reverse_op = true;
@@ -2025,7 +2014,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2025
2014
  }
2026
2015
  }
2027
2016
 
2028
- Py_DECREF(result);
2017
+ Py_DECREF_IMMORTAL(result);
2029
2018
  }
2030
2019
  }
2031
2020
 
@@ -2048,11 +2037,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2048
2037
  }
2049
2038
  }
2050
2039
 
2051
- Py_DECREF(result);
2040
+ Py_DECREF_IMMORTAL(result);
2052
2041
  }
2053
2042
 
2054
2043
  if (checked_reverse_op == false) {
2055
- f = RICHCOMPARE(type2);
2044
+ f = TP_RICHCOMPARE(type2);
2056
2045
 
2057
2046
  if (f != NULL) {
2058
2047
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -2071,7 +2060,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2071
2060
  }
2072
2061
  }
2073
2062
 
2074
- Py_DECREF(result);
2063
+ Py_DECREF_IMMORTAL(result);
2075
2064
  }
2076
2065
  }
2077
2066
 
@@ -2119,7 +2108,7 @@ static PyObject *COMPARE_LT_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject
2119
2108
 
2120
2109
  // Convert to target type.
2121
2110
  PyObject *result = BOOL_FROM(r);
2122
- Py_INCREF(result);
2111
+ Py_INCREF_IMMORTAL(result);
2123
2112
  return result;
2124
2113
  }
2125
2114
 
@@ -2162,7 +2151,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2162
2151
  return result;
2163
2152
  }
2164
2153
 
2165
- Py_DECREF(result);
2154
+ Py_DECREF_IMMORTAL(result);
2166
2155
  }
2167
2156
 
2168
2157
  // No rich comparison worked, but maybe compare works.
@@ -2203,7 +2192,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2203
2192
 
2204
2193
  bool r = c != 0;
2205
2194
  PyObject *result = BOOL_FROM(r);
2206
- Py_INCREF(result);
2195
+ Py_INCREF_IMMORTAL(result);
2207
2196
  return result;
2208
2197
  }
2209
2198
  }
@@ -2223,11 +2212,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2223
2212
  return result;
2224
2213
  }
2225
2214
 
2226
- Py_DECREF(result);
2215
+ Py_DECREF_IMMORTAL(result);
2227
2216
  }
2228
2217
  }
2229
2218
 
2230
- f = RICHCOMPARE(type1);
2219
+ f = TP_RICHCOMPARE(type1);
2231
2220
  if (f != NULL) {
2232
2221
  PyObject *result = (*f)(operand1, operand2, Py_LT);
2233
2222
 
@@ -2237,7 +2226,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2237
2226
  return result;
2238
2227
  }
2239
2228
 
2240
- Py_DECREF(result);
2229
+ Py_DECREF_IMMORTAL(result);
2241
2230
  }
2242
2231
 
2243
2232
  f = PyUnicode_Type.tp_richcompare;
@@ -2250,7 +2239,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2250
2239
  return result;
2251
2240
  }
2252
2241
 
2253
- Py_DECREF(result);
2242
+ Py_DECREF_IMMORTAL(result);
2254
2243
  }
2255
2244
 
2256
2245
  int c;
@@ -2338,7 +2327,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2338
2327
 
2339
2328
  bool r = c != 0;
2340
2329
  PyObject *result = BOOL_FROM(r);
2341
- Py_INCREF(result);
2330
+ Py_INCREF_IMMORTAL(result);
2342
2331
  return result;
2343
2332
  #else
2344
2333
  bool checked_reverse_op = false;
@@ -2358,11 +2347,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2358
2347
  return result;
2359
2348
  }
2360
2349
 
2361
- Py_DECREF(result);
2350
+ Py_DECREF_IMMORTAL(result);
2362
2351
  }
2363
2352
  }
2364
2353
 
2365
- f = RICHCOMPARE(type1);
2354
+ f = TP_RICHCOMPARE(type1);
2366
2355
 
2367
2356
  if (f != NULL) {
2368
2357
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -2373,7 +2362,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2373
2362
  return result;
2374
2363
  }
2375
2364
 
2376
- Py_DECREF(result);
2365
+ Py_DECREF_IMMORTAL(result);
2377
2366
  }
2378
2367
 
2379
2368
  if (checked_reverse_op == false) {
@@ -2388,7 +2377,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2388
2377
  return result;
2389
2378
  }
2390
2379
 
2391
- Py_DECREF(result);
2380
+ Py_DECREF_IMMORTAL(result);
2392
2381
  }
2393
2382
  }
2394
2383
 
@@ -2400,13 +2389,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2400
2389
  case Py_EQ: {
2401
2390
  bool r = operand1 == operand2;
2402
2391
  PyObject *result = BOOL_FROM(r);
2403
- Py_INCREF(result);
2392
+ Py_INCREF_IMMORTAL(result);
2404
2393
  return result;
2405
2394
  }
2406
2395
  case Py_NE: {
2407
2396
  bool r = operand1 != operand2;
2408
2397
  PyObject *result = BOOL_FROM(r);
2409
- Py_INCREF(result);
2398
+ Py_INCREF_IMMORTAL(result);
2410
2399
  return result;
2411
2400
  }
2412
2401
  default:
@@ -2456,7 +2445,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2456
2445
  return result;
2457
2446
  }
2458
2447
 
2459
- Py_DECREF(result);
2448
+ Py_DECREF_IMMORTAL(result);
2460
2449
  }
2461
2450
 
2462
2451
  // No rich comparison worked, but maybe compare works.
@@ -2497,7 +2486,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2497
2486
 
2498
2487
  bool r = c != 0;
2499
2488
  PyObject *result = BOOL_FROM(r);
2500
- Py_INCREF(result);
2489
+ Py_INCREF_IMMORTAL(result);
2501
2490
  return result;
2502
2491
  }
2503
2492
  }
@@ -2506,7 +2495,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2506
2495
  richcmpfunc f;
2507
2496
 
2508
2497
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2509
- f = RICHCOMPARE(type2);
2498
+ f = TP_RICHCOMPARE(type2);
2510
2499
 
2511
2500
  if (f != NULL) {
2512
2501
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -2517,7 +2506,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2517
2506
  return result;
2518
2507
  }
2519
2508
 
2520
- Py_DECREF(result);
2509
+ Py_DECREF_IMMORTAL(result);
2521
2510
  }
2522
2511
  }
2523
2512
 
@@ -2531,10 +2520,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2531
2520
  return result;
2532
2521
  }
2533
2522
 
2534
- Py_DECREF(result);
2523
+ Py_DECREF_IMMORTAL(result);
2535
2524
  }
2536
2525
 
2537
- f = RICHCOMPARE(type2);
2526
+ f = TP_RICHCOMPARE(type2);
2538
2527
  if (f != NULL) {
2539
2528
  PyObject *result = (*f)(operand2, operand1, Py_GT);
2540
2529
 
@@ -2544,7 +2533,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2544
2533
  return result;
2545
2534
  }
2546
2535
 
2547
- Py_DECREF(result);
2536
+ Py_DECREF_IMMORTAL(result);
2548
2537
  }
2549
2538
 
2550
2539
  int c;
@@ -2632,14 +2621,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2632
2621
 
2633
2622
  bool r = c != 0;
2634
2623
  PyObject *result = BOOL_FROM(r);
2635
- Py_INCREF(result);
2624
+ Py_INCREF_IMMORTAL(result);
2636
2625
  return result;
2637
2626
  #else
2638
2627
  bool checked_reverse_op = false;
2639
2628
  richcmpfunc f;
2640
2629
 
2641
2630
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2642
- f = RICHCOMPARE(type2);
2631
+ f = TP_RICHCOMPARE(type2);
2643
2632
 
2644
2633
  if (f != NULL) {
2645
2634
  checked_reverse_op = true;
@@ -2652,7 +2641,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2652
2641
  return result;
2653
2642
  }
2654
2643
 
2655
- Py_DECREF(result);
2644
+ Py_DECREF_IMMORTAL(result);
2656
2645
  }
2657
2646
  }
2658
2647
 
@@ -2667,11 +2656,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2667
2656
  return result;
2668
2657
  }
2669
2658
 
2670
- Py_DECREF(result);
2659
+ Py_DECREF_IMMORTAL(result);
2671
2660
  }
2672
2661
 
2673
2662
  if (checked_reverse_op == false) {
2674
- f = RICHCOMPARE(type2);
2663
+ f = TP_RICHCOMPARE(type2);
2675
2664
 
2676
2665
  if (f != NULL) {
2677
2666
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -2682,7 +2671,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2682
2671
  return result;
2683
2672
  }
2684
2673
 
2685
- Py_DECREF(result);
2674
+ Py_DECREF_IMMORTAL(result);
2686
2675
  }
2687
2676
  }
2688
2677
 
@@ -2694,13 +2683,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2694
2683
  case Py_EQ: {
2695
2684
  bool r = operand1 == operand2;
2696
2685
  PyObject *result = BOOL_FROM(r);
2697
- Py_INCREF(result);
2686
+ Py_INCREF_IMMORTAL(result);
2698
2687
  return result;
2699
2688
  }
2700
2689
  case Py_NE: {
2701
2690
  bool r = operand1 != operand2;
2702
2691
  PyObject *result = BOOL_FROM(r);
2703
- Py_INCREF(result);
2692
+ Py_INCREF_IMMORTAL(result);
2704
2693
  return result;
2705
2694
  }
2706
2695
  default:
@@ -2747,7 +2736,7 @@ static bool COMPARE_LT_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *opera
2747
2736
 
2748
2737
  // Convert to target type if necessary
2749
2738
  bool result = r == Py_True;
2750
- Py_DECREF(r);
2739
+ Py_DECREF_IMMORTAL(r);
2751
2740
 
2752
2741
  return result;
2753
2742
  }
@@ -2800,7 +2789,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2800
2789
  }
2801
2790
  }
2802
2791
 
2803
- Py_DECREF(result);
2792
+ Py_DECREF_IMMORTAL(result);
2804
2793
  }
2805
2794
 
2806
2795
  // No rich comparison worked, but maybe compare works.
@@ -2869,11 +2858,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2869
2858
  }
2870
2859
  }
2871
2860
 
2872
- Py_DECREF(result);
2861
+ Py_DECREF_IMMORTAL(result);
2873
2862
  }
2874
2863
  }
2875
2864
 
2876
- f = RICHCOMPARE(type1);
2865
+ f = TP_RICHCOMPARE(type1);
2877
2866
  if (f != NULL) {
2878
2867
  PyObject *result = (*f)(operand1, operand2, Py_LT);
2879
2868
 
@@ -2891,7 +2880,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2891
2880
  }
2892
2881
  }
2893
2882
 
2894
- Py_DECREF(result);
2883
+ Py_DECREF_IMMORTAL(result);
2895
2884
  }
2896
2885
 
2897
2886
  f = PyUnicode_Type.tp_richcompare;
@@ -2912,7 +2901,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2912
2901
  }
2913
2902
  }
2914
2903
 
2915
- Py_DECREF(result);
2904
+ Py_DECREF_IMMORTAL(result);
2916
2905
  }
2917
2906
 
2918
2907
  int c;
@@ -3028,11 +3017,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3028
3017
  }
3029
3018
  }
3030
3019
 
3031
- Py_DECREF(result);
3020
+ Py_DECREF_IMMORTAL(result);
3032
3021
  }
3033
3022
  }
3034
3023
 
3035
- f = RICHCOMPARE(type1);
3024
+ f = TP_RICHCOMPARE(type1);
3036
3025
 
3037
3026
  if (f != NULL) {
3038
3027
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -3051,7 +3040,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3051
3040
  }
3052
3041
  }
3053
3042
 
3054
- Py_DECREF(result);
3043
+ Py_DECREF_IMMORTAL(result);
3055
3044
  }
3056
3045
 
3057
3046
  if (checked_reverse_op == false) {
@@ -3074,7 +3063,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3074
3063
  }
3075
3064
  }
3076
3065
 
3077
- Py_DECREF(result);
3066
+ Py_DECREF_IMMORTAL(result);
3078
3067
  }
3079
3068
  }
3080
3069
 
@@ -3150,7 +3139,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3150
3139
  }
3151
3140
  }
3152
3141
 
3153
- Py_DECREF(result);
3142
+ Py_DECREF_IMMORTAL(result);
3154
3143
  }
3155
3144
 
3156
3145
  // No rich comparison worked, but maybe compare works.
@@ -3200,7 +3189,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3200
3189
  richcmpfunc f;
3201
3190
 
3202
3191
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3203
- f = RICHCOMPARE(type2);
3192
+ f = TP_RICHCOMPARE(type2);
3204
3193
 
3205
3194
  if (f != NULL) {
3206
3195
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -3219,7 +3208,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3219
3208
  }
3220
3209
  }
3221
3210
 
3222
- Py_DECREF(result);
3211
+ Py_DECREF_IMMORTAL(result);
3223
3212
  }
3224
3213
  }
3225
3214
 
@@ -3241,10 +3230,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3241
3230
  }
3242
3231
  }
3243
3232
 
3244
- Py_DECREF(result);
3233
+ Py_DECREF_IMMORTAL(result);
3245
3234
  }
3246
3235
 
3247
- f = RICHCOMPARE(type2);
3236
+ f = TP_RICHCOMPARE(type2);
3248
3237
  if (f != NULL) {
3249
3238
  PyObject *result = (*f)(operand2, operand1, Py_GT);
3250
3239
 
@@ -3262,7 +3251,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3262
3251
  }
3263
3252
  }
3264
3253
 
3265
- Py_DECREF(result);
3254
+ Py_DECREF_IMMORTAL(result);
3266
3255
  }
3267
3256
 
3268
3257
  int c;
@@ -3357,7 +3346,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3357
3346
  richcmpfunc f;
3358
3347
 
3359
3348
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3360
- f = RICHCOMPARE(type2);
3349
+ f = TP_RICHCOMPARE(type2);
3361
3350
 
3362
3351
  if (f != NULL) {
3363
3352
  checked_reverse_op = true;
@@ -3378,7 +3367,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3378
3367
  }
3379
3368
  }
3380
3369
 
3381
- Py_DECREF(result);
3370
+ Py_DECREF_IMMORTAL(result);
3382
3371
  }
3383
3372
  }
3384
3373
 
@@ -3401,11 +3390,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3401
3390
  }
3402
3391
  }
3403
3392
 
3404
- Py_DECREF(result);
3393
+ Py_DECREF_IMMORTAL(result);
3405
3394
  }
3406
3395
 
3407
3396
  if (checked_reverse_op == false) {
3408
- f = RICHCOMPARE(type2);
3397
+ f = TP_RICHCOMPARE(type2);
3409
3398
 
3410
3399
  if (f != NULL) {
3411
3400
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -3424,7 +3413,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3424
3413
  }
3425
3414
  }
3426
3415
 
3427
- Py_DECREF(result);
3416
+ Py_DECREF_IMMORTAL(result);
3428
3417
  }
3429
3418
  }
3430
3419
 
@@ -3474,7 +3463,7 @@ static PyObject *COMPARE_LT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3474
3463
 
3475
3464
  // Convert to target type.
3476
3465
  PyObject *result = BOOL_FROM(r);
3477
- Py_INCREF(result);
3466
+ Py_INCREF_IMMORTAL(result);
3478
3467
  return result;
3479
3468
  }
3480
3469
 
@@ -3502,9 +3491,11 @@ static PyObject *COMPARE_LT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3502
3491
 
3503
3492
  // Convert to target type.
3504
3493
  PyObject *result = BOOL_FROM(c != 0);
3505
- Py_INCREF(result);
3494
+ Py_INCREF_IMMORTAL(result);
3506
3495
  return result;
3507
3496
  }
3497
+ #endif
3498
+ #if PYTHON_VERSION >= 0x300
3508
3499
  /* Code referring to "OBJECT" corresponds to any Python object and "BYTES" to Python3 'bytes'. */
3509
3500
  PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {
3510
3501
 
@@ -3539,7 +3530,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3539
3530
  return result;
3540
3531
  }
3541
3532
 
3542
- Py_DECREF(result);
3533
+ Py_DECREF_IMMORTAL(result);
3543
3534
  }
3544
3535
 
3545
3536
  // No rich comparison worked, but maybe compare works.
@@ -3580,7 +3571,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3580
3571
 
3581
3572
  bool r = c != 0;
3582
3573
  PyObject *result = BOOL_FROM(r);
3583
- Py_INCREF(result);
3574
+ Py_INCREF_IMMORTAL(result);
3584
3575
  return result;
3585
3576
  }
3586
3577
  }
@@ -3600,11 +3591,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3600
3591
  return result;
3601
3592
  }
3602
3593
 
3603
- Py_DECREF(result);
3594
+ Py_DECREF_IMMORTAL(result);
3604
3595
  }
3605
3596
  }
3606
3597
 
3607
- f = RICHCOMPARE(type1);
3598
+ f = TP_RICHCOMPARE(type1);
3608
3599
  if (f != NULL) {
3609
3600
  PyObject *result = (*f)(operand1, operand2, Py_LT);
3610
3601
 
@@ -3614,7 +3605,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3614
3605
  return result;
3615
3606
  }
3616
3607
 
3617
- Py_DECREF(result);
3608
+ Py_DECREF_IMMORTAL(result);
3618
3609
  }
3619
3610
 
3620
3611
  f = PyBytes_Type.tp_richcompare;
@@ -3627,7 +3618,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3627
3618
  return result;
3628
3619
  }
3629
3620
 
3630
- Py_DECREF(result);
3621
+ Py_DECREF_IMMORTAL(result);
3631
3622
  }
3632
3623
 
3633
3624
  int c;
@@ -3715,7 +3706,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3715
3706
 
3716
3707
  bool r = c != 0;
3717
3708
  PyObject *result = BOOL_FROM(r);
3718
- Py_INCREF(result);
3709
+ Py_INCREF_IMMORTAL(result);
3719
3710
  return result;
3720
3711
  #else
3721
3712
  bool checked_reverse_op = false;
@@ -3735,11 +3726,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3735
3726
  return result;
3736
3727
  }
3737
3728
 
3738
- Py_DECREF(result);
3729
+ Py_DECREF_IMMORTAL(result);
3739
3730
  }
3740
3731
  }
3741
3732
 
3742
- f = RICHCOMPARE(type1);
3733
+ f = TP_RICHCOMPARE(type1);
3743
3734
 
3744
3735
  if (f != NULL) {
3745
3736
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -3750,7 +3741,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3750
3741
  return result;
3751
3742
  }
3752
3743
 
3753
- Py_DECREF(result);
3744
+ Py_DECREF_IMMORTAL(result);
3754
3745
  }
3755
3746
 
3756
3747
  if (checked_reverse_op == false) {
@@ -3765,7 +3756,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3765
3756
  return result;
3766
3757
  }
3767
3758
 
3768
- Py_DECREF(result);
3759
+ Py_DECREF_IMMORTAL(result);
3769
3760
  }
3770
3761
  }
3771
3762
 
@@ -3777,13 +3768,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3777
3768
  case Py_EQ: {
3778
3769
  bool r = operand1 == operand2;
3779
3770
  PyObject *result = BOOL_FROM(r);
3780
- Py_INCREF(result);
3771
+ Py_INCREF_IMMORTAL(result);
3781
3772
  return result;
3782
3773
  }
3783
3774
  case Py_NE: {
3784
3775
  bool r = operand1 != operand2;
3785
3776
  PyObject *result = BOOL_FROM(r);
3786
- Py_INCREF(result);
3777
+ Py_INCREF_IMMORTAL(result);
3787
3778
  return result;
3788
3779
  }
3789
3780
  default:
@@ -3833,7 +3824,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3833
3824
  return result;
3834
3825
  }
3835
3826
 
3836
- Py_DECREF(result);
3827
+ Py_DECREF_IMMORTAL(result);
3837
3828
  }
3838
3829
 
3839
3830
  // No rich comparison worked, but maybe compare works.
@@ -3874,7 +3865,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3874
3865
 
3875
3866
  bool r = c != 0;
3876
3867
  PyObject *result = BOOL_FROM(r);
3877
- Py_INCREF(result);
3868
+ Py_INCREF_IMMORTAL(result);
3878
3869
  return result;
3879
3870
  }
3880
3871
  }
@@ -3883,7 +3874,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3883
3874
  richcmpfunc f;
3884
3875
 
3885
3876
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
3886
- f = RICHCOMPARE(type2);
3877
+ f = TP_RICHCOMPARE(type2);
3887
3878
 
3888
3879
  if (f != NULL) {
3889
3880
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -3894,7 +3885,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3894
3885
  return result;
3895
3886
  }
3896
3887
 
3897
- Py_DECREF(result);
3888
+ Py_DECREF_IMMORTAL(result);
3898
3889
  }
3899
3890
  }
3900
3891
 
@@ -3908,10 +3899,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3908
3899
  return result;
3909
3900
  }
3910
3901
 
3911
- Py_DECREF(result);
3902
+ Py_DECREF_IMMORTAL(result);
3912
3903
  }
3913
3904
 
3914
- f = RICHCOMPARE(type2);
3905
+ f = TP_RICHCOMPARE(type2);
3915
3906
  if (f != NULL) {
3916
3907
  PyObject *result = (*f)(operand2, operand1, Py_GT);
3917
3908
 
@@ -3921,7 +3912,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3921
3912
  return result;
3922
3913
  }
3923
3914
 
3924
- Py_DECREF(result);
3915
+ Py_DECREF_IMMORTAL(result);
3925
3916
  }
3926
3917
 
3927
3918
  int c;
@@ -4009,14 +4000,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4009
4000
 
4010
4001
  bool r = c != 0;
4011
4002
  PyObject *result = BOOL_FROM(r);
4012
- Py_INCREF(result);
4003
+ Py_INCREF_IMMORTAL(result);
4013
4004
  return result;
4014
4005
  #else
4015
4006
  bool checked_reverse_op = false;
4016
4007
  richcmpfunc f;
4017
4008
 
4018
4009
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4019
- f = RICHCOMPARE(type2);
4010
+ f = TP_RICHCOMPARE(type2);
4020
4011
 
4021
4012
  if (f != NULL) {
4022
4013
  checked_reverse_op = true;
@@ -4029,7 +4020,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4029
4020
  return result;
4030
4021
  }
4031
4022
 
4032
- Py_DECREF(result);
4023
+ Py_DECREF_IMMORTAL(result);
4033
4024
  }
4034
4025
  }
4035
4026
 
@@ -4044,11 +4035,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4044
4035
  return result;
4045
4036
  }
4046
4037
 
4047
- Py_DECREF(result);
4038
+ Py_DECREF_IMMORTAL(result);
4048
4039
  }
4049
4040
 
4050
4041
  if (checked_reverse_op == false) {
4051
- f = RICHCOMPARE(type2);
4042
+ f = TP_RICHCOMPARE(type2);
4052
4043
 
4053
4044
  if (f != NULL) {
4054
4045
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -4059,7 +4050,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4059
4050
  return result;
4060
4051
  }
4061
4052
 
4062
- Py_DECREF(result);
4053
+ Py_DECREF_IMMORTAL(result);
4063
4054
  }
4064
4055
  }
4065
4056
 
@@ -4071,13 +4062,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4071
4062
  case Py_EQ: {
4072
4063
  bool r = operand1 == operand2;
4073
4064
  PyObject *result = BOOL_FROM(r);
4074
- Py_INCREF(result);
4065
+ Py_INCREF_IMMORTAL(result);
4075
4066
  return result;
4076
4067
  }
4077
4068
  case Py_NE: {
4078
4069
  bool r = operand1 != operand2;
4079
4070
  PyObject *result = BOOL_FROM(r);
4080
- Py_INCREF(result);
4071
+ Py_INCREF_IMMORTAL(result);
4081
4072
  return result;
4082
4073
  }
4083
4074
  default:
@@ -4147,6 +4138,8 @@ static bool COMPARE_LT_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2)
4147
4138
 
4148
4139
  return result;
4149
4140
  }
4141
+ #endif
4142
+ #if PYTHON_VERSION >= 0x300
4150
4143
  /* Code referring to "BYTES" corresponds to Python3 'bytes' and "BYTES" to Python3 'bytes'. */
4151
4144
  bool RICH_COMPARE_LT_CBOOL_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {
4152
4145
 
@@ -4197,7 +4190,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4197
4190
  }
4198
4191
  }
4199
4192
 
4200
- Py_DECREF(result);
4193
+ Py_DECREF_IMMORTAL(result);
4201
4194
  }
4202
4195
 
4203
4196
  // No rich comparison worked, but maybe compare works.
@@ -4266,11 +4259,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4266
4259
  }
4267
4260
  }
4268
4261
 
4269
- Py_DECREF(result);
4262
+ Py_DECREF_IMMORTAL(result);
4270
4263
  }
4271
4264
  }
4272
4265
 
4273
- f = RICHCOMPARE(type1);
4266
+ f = TP_RICHCOMPARE(type1);
4274
4267
  if (f != NULL) {
4275
4268
  PyObject *result = (*f)(operand1, operand2, Py_LT);
4276
4269
 
@@ -4288,7 +4281,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4288
4281
  }
4289
4282
  }
4290
4283
 
4291
- Py_DECREF(result);
4284
+ Py_DECREF_IMMORTAL(result);
4292
4285
  }
4293
4286
 
4294
4287
  f = PyBytes_Type.tp_richcompare;
@@ -4309,7 +4302,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4309
4302
  }
4310
4303
  }
4311
4304
 
4312
- Py_DECREF(result);
4305
+ Py_DECREF_IMMORTAL(result);
4313
4306
  }
4314
4307
 
4315
4308
  int c;
@@ -4425,11 +4418,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4425
4418
  }
4426
4419
  }
4427
4420
 
4428
- Py_DECREF(result);
4421
+ Py_DECREF_IMMORTAL(result);
4429
4422
  }
4430
4423
  }
4431
4424
 
4432
- f = RICHCOMPARE(type1);
4425
+ f = TP_RICHCOMPARE(type1);
4433
4426
 
4434
4427
  if (f != NULL) {
4435
4428
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -4448,7 +4441,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4448
4441
  }
4449
4442
  }
4450
4443
 
4451
- Py_DECREF(result);
4444
+ Py_DECREF_IMMORTAL(result);
4452
4445
  }
4453
4446
 
4454
4447
  if (checked_reverse_op == false) {
@@ -4471,7 +4464,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4471
4464
  }
4472
4465
  }
4473
4466
 
4474
- Py_DECREF(result);
4467
+ Py_DECREF_IMMORTAL(result);
4475
4468
  }
4476
4469
  }
4477
4470
 
@@ -4547,7 +4540,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4547
4540
  }
4548
4541
  }
4549
4542
 
4550
- Py_DECREF(result);
4543
+ Py_DECREF_IMMORTAL(result);
4551
4544
  }
4552
4545
 
4553
4546
  // No rich comparison worked, but maybe compare works.
@@ -4597,7 +4590,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4597
4590
  richcmpfunc f;
4598
4591
 
4599
4592
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4600
- f = RICHCOMPARE(type2);
4593
+ f = TP_RICHCOMPARE(type2);
4601
4594
 
4602
4595
  if (f != NULL) {
4603
4596
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -4616,7 +4609,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4616
4609
  }
4617
4610
  }
4618
4611
 
4619
- Py_DECREF(result);
4612
+ Py_DECREF_IMMORTAL(result);
4620
4613
  }
4621
4614
  }
4622
4615
 
@@ -4638,10 +4631,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4638
4631
  }
4639
4632
  }
4640
4633
 
4641
- Py_DECREF(result);
4634
+ Py_DECREF_IMMORTAL(result);
4642
4635
  }
4643
4636
 
4644
- f = RICHCOMPARE(type2);
4637
+ f = TP_RICHCOMPARE(type2);
4645
4638
  if (f != NULL) {
4646
4639
  PyObject *result = (*f)(operand2, operand1, Py_GT);
4647
4640
 
@@ -4659,7 +4652,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4659
4652
  }
4660
4653
  }
4661
4654
 
4662
- Py_DECREF(result);
4655
+ Py_DECREF_IMMORTAL(result);
4663
4656
  }
4664
4657
 
4665
4658
  int c;
@@ -4754,7 +4747,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4754
4747
  richcmpfunc f;
4755
4748
 
4756
4749
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4757
- f = RICHCOMPARE(type2);
4750
+ f = TP_RICHCOMPARE(type2);
4758
4751
 
4759
4752
  if (f != NULL) {
4760
4753
  checked_reverse_op = true;
@@ -4775,7 +4768,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4775
4768
  }
4776
4769
  }
4777
4770
 
4778
- Py_DECREF(result);
4771
+ Py_DECREF_IMMORTAL(result);
4779
4772
  }
4780
4773
  }
4781
4774
 
@@ -4798,11 +4791,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4798
4791
  }
4799
4792
  }
4800
4793
 
4801
- Py_DECREF(result);
4794
+ Py_DECREF_IMMORTAL(result);
4802
4795
  }
4803
4796
 
4804
4797
  if (checked_reverse_op == false) {
4805
- f = RICHCOMPARE(type2);
4798
+ f = TP_RICHCOMPARE(type2);
4806
4799
 
4807
4800
  if (f != NULL) {
4808
4801
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -4821,7 +4814,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4821
4814
  }
4822
4815
  }
4823
4816
 
4824
- Py_DECREF(result);
4817
+ Py_DECREF_IMMORTAL(result);
4825
4818
  }
4826
4819
  }
4827
4820
 
@@ -4889,7 +4882,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4889
4882
  return result;
4890
4883
  }
4891
4884
 
4892
- Py_DECREF(result);
4885
+ Py_DECREF_IMMORTAL(result);
4893
4886
  }
4894
4887
 
4895
4888
  // No rich comparison worked, but maybe compare works.
@@ -4930,7 +4923,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4930
4923
 
4931
4924
  bool r = c != 0;
4932
4925
  PyObject *result = BOOL_FROM(r);
4933
- Py_INCREF(result);
4926
+ Py_INCREF_IMMORTAL(result);
4934
4927
  return result;
4935
4928
  }
4936
4929
  }
@@ -4950,11 +4943,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4950
4943
  return result;
4951
4944
  }
4952
4945
 
4953
- Py_DECREF(result);
4946
+ Py_DECREF_IMMORTAL(result);
4954
4947
  }
4955
4948
  }
4956
4949
 
4957
- f = RICHCOMPARE(type1);
4950
+ f = TP_RICHCOMPARE(type1);
4958
4951
  if (f != NULL) {
4959
4952
  PyObject *result = (*f)(operand1, operand2, Py_LT);
4960
4953
 
@@ -4964,7 +4957,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4964
4957
  return result;
4965
4958
  }
4966
4959
 
4967
- Py_DECREF(result);
4960
+ Py_DECREF_IMMORTAL(result);
4968
4961
  }
4969
4962
 
4970
4963
  f = NULL;
@@ -4977,7 +4970,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4977
4970
  return result;
4978
4971
  }
4979
4972
 
4980
- Py_DECREF(result);
4973
+ Py_DECREF_IMMORTAL(result);
4981
4974
  }
4982
4975
 
4983
4976
  int c;
@@ -5065,7 +5058,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5065
5058
 
5066
5059
  bool r = c != 0;
5067
5060
  PyObject *result = BOOL_FROM(r);
5068
- Py_INCREF(result);
5061
+ Py_INCREF_IMMORTAL(result);
5069
5062
  return result;
5070
5063
  #else
5071
5064
  bool checked_reverse_op = false;
@@ -5085,11 +5078,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5085
5078
  return result;
5086
5079
  }
5087
5080
 
5088
- Py_DECREF(result);
5081
+ Py_DECREF_IMMORTAL(result);
5089
5082
  }
5090
5083
  }
5091
5084
 
5092
- f = RICHCOMPARE(type1);
5085
+ f = TP_RICHCOMPARE(type1);
5093
5086
 
5094
5087
  if (f != NULL) {
5095
5088
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -5100,7 +5093,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5100
5093
  return result;
5101
5094
  }
5102
5095
 
5103
- Py_DECREF(result);
5096
+ Py_DECREF_IMMORTAL(result);
5104
5097
  }
5105
5098
 
5106
5099
  if (checked_reverse_op == false) {
@@ -5115,7 +5108,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5115
5108
  return result;
5116
5109
  }
5117
5110
 
5118
- Py_DECREF(result);
5111
+ Py_DECREF_IMMORTAL(result);
5119
5112
  }
5120
5113
  }
5121
5114
 
@@ -5127,13 +5120,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5127
5120
  case Py_EQ: {
5128
5121
  bool r = operand1 == operand2;
5129
5122
  PyObject *result = BOOL_FROM(r);
5130
- Py_INCREF(result);
5123
+ Py_INCREF_IMMORTAL(result);
5131
5124
  return result;
5132
5125
  }
5133
5126
  case Py_NE: {
5134
5127
  bool r = operand1 != operand2;
5135
5128
  PyObject *result = BOOL_FROM(r);
5136
- Py_INCREF(result);
5129
+ Py_INCREF_IMMORTAL(result);
5137
5130
  return result;
5138
5131
  }
5139
5132
  default:
@@ -5183,7 +5176,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5183
5176
  return result;
5184
5177
  }
5185
5178
 
5186
- Py_DECREF(result);
5179
+ Py_DECREF_IMMORTAL(result);
5187
5180
  }
5188
5181
 
5189
5182
  // No rich comparison worked, but maybe compare works.
@@ -5224,7 +5217,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5224
5217
 
5225
5218
  bool r = c != 0;
5226
5219
  PyObject *result = BOOL_FROM(r);
5227
- Py_INCREF(result);
5220
+ Py_INCREF_IMMORTAL(result);
5228
5221
  return result;
5229
5222
  }
5230
5223
  }
@@ -5233,7 +5226,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5233
5226
  richcmpfunc f;
5234
5227
 
5235
5228
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5236
- f = RICHCOMPARE(type2);
5229
+ f = TP_RICHCOMPARE(type2);
5237
5230
 
5238
5231
  if (f != NULL) {
5239
5232
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -5244,7 +5237,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5244
5237
  return result;
5245
5238
  }
5246
5239
 
5247
- Py_DECREF(result);
5240
+ Py_DECREF_IMMORTAL(result);
5248
5241
  }
5249
5242
  }
5250
5243
 
@@ -5258,10 +5251,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5258
5251
  return result;
5259
5252
  }
5260
5253
 
5261
- Py_DECREF(result);
5254
+ Py_DECREF_IMMORTAL(result);
5262
5255
  }
5263
5256
 
5264
- f = RICHCOMPARE(type2);
5257
+ f = TP_RICHCOMPARE(type2);
5265
5258
  if (f != NULL) {
5266
5259
  PyObject *result = (*f)(operand2, operand1, Py_GT);
5267
5260
 
@@ -5271,7 +5264,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5271
5264
  return result;
5272
5265
  }
5273
5266
 
5274
- Py_DECREF(result);
5267
+ Py_DECREF_IMMORTAL(result);
5275
5268
  }
5276
5269
 
5277
5270
  int c;
@@ -5359,14 +5352,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5359
5352
 
5360
5353
  bool r = c != 0;
5361
5354
  PyObject *result = BOOL_FROM(r);
5362
- Py_INCREF(result);
5355
+ Py_INCREF_IMMORTAL(result);
5363
5356
  return result;
5364
5357
  #else
5365
5358
  bool checked_reverse_op = false;
5366
5359
  richcmpfunc f;
5367
5360
 
5368
5361
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5369
- f = RICHCOMPARE(type2);
5362
+ f = TP_RICHCOMPARE(type2);
5370
5363
 
5371
5364
  if (f != NULL) {
5372
5365
  checked_reverse_op = true;
@@ -5379,7 +5372,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5379
5372
  return result;
5380
5373
  }
5381
5374
 
5382
- Py_DECREF(result);
5375
+ Py_DECREF_IMMORTAL(result);
5383
5376
  }
5384
5377
  }
5385
5378
 
@@ -5394,11 +5387,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5394
5387
  return result;
5395
5388
  }
5396
5389
 
5397
- Py_DECREF(result);
5390
+ Py_DECREF_IMMORTAL(result);
5398
5391
  }
5399
5392
 
5400
5393
  if (checked_reverse_op == false) {
5401
- f = RICHCOMPARE(type2);
5394
+ f = TP_RICHCOMPARE(type2);
5402
5395
 
5403
5396
  if (f != NULL) {
5404
5397
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -5409,7 +5402,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5409
5402
  return result;
5410
5403
  }
5411
5404
 
5412
- Py_DECREF(result);
5405
+ Py_DECREF_IMMORTAL(result);
5413
5406
  }
5414
5407
  }
5415
5408
 
@@ -5421,13 +5414,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5421
5414
  case Py_EQ: {
5422
5415
  bool r = operand1 == operand2;
5423
5416
  PyObject *result = BOOL_FROM(r);
5424
- Py_INCREF(result);
5417
+ Py_INCREF_IMMORTAL(result);
5425
5418
  return result;
5426
5419
  }
5427
5420
  case Py_NE: {
5428
5421
  bool r = operand1 != operand2;
5429
5422
  PyObject *result = BOOL_FROM(r);
5430
- Py_INCREF(result);
5423
+ Py_INCREF_IMMORTAL(result);
5431
5424
  return result;
5432
5425
  }
5433
5426
  default:
@@ -5501,7 +5494,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5501
5494
  }
5502
5495
  }
5503
5496
 
5504
- Py_DECREF(result);
5497
+ Py_DECREF_IMMORTAL(result);
5505
5498
  }
5506
5499
 
5507
5500
  // No rich comparison worked, but maybe compare works.
@@ -5570,11 +5563,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5570
5563
  }
5571
5564
  }
5572
5565
 
5573
- Py_DECREF(result);
5566
+ Py_DECREF_IMMORTAL(result);
5574
5567
  }
5575
5568
  }
5576
5569
 
5577
- f = RICHCOMPARE(type1);
5570
+ f = TP_RICHCOMPARE(type1);
5578
5571
  if (f != NULL) {
5579
5572
  PyObject *result = (*f)(operand1, operand2, Py_LT);
5580
5573
 
@@ -5592,7 +5585,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5592
5585
  }
5593
5586
  }
5594
5587
 
5595
- Py_DECREF(result);
5588
+ Py_DECREF_IMMORTAL(result);
5596
5589
  }
5597
5590
 
5598
5591
  f = NULL;
@@ -5613,7 +5606,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5613
5606
  }
5614
5607
  }
5615
5608
 
5616
- Py_DECREF(result);
5609
+ Py_DECREF_IMMORTAL(result);
5617
5610
  }
5618
5611
 
5619
5612
  int c;
@@ -5729,11 +5722,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5729
5722
  }
5730
5723
  }
5731
5724
 
5732
- Py_DECREF(result);
5725
+ Py_DECREF_IMMORTAL(result);
5733
5726
  }
5734
5727
  }
5735
5728
 
5736
- f = RICHCOMPARE(type1);
5729
+ f = TP_RICHCOMPARE(type1);
5737
5730
 
5738
5731
  if (f != NULL) {
5739
5732
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -5752,7 +5745,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5752
5745
  }
5753
5746
  }
5754
5747
 
5755
- Py_DECREF(result);
5748
+ Py_DECREF_IMMORTAL(result);
5756
5749
  }
5757
5750
 
5758
5751
  if (checked_reverse_op == false) {
@@ -5775,7 +5768,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5775
5768
  }
5776
5769
  }
5777
5770
 
5778
- Py_DECREF(result);
5771
+ Py_DECREF_IMMORTAL(result);
5779
5772
  }
5780
5773
  }
5781
5774
 
@@ -5851,7 +5844,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5851
5844
  }
5852
5845
  }
5853
5846
 
5854
- Py_DECREF(result);
5847
+ Py_DECREF_IMMORTAL(result);
5855
5848
  }
5856
5849
 
5857
5850
  // No rich comparison worked, but maybe compare works.
@@ -5901,7 +5894,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5901
5894
  richcmpfunc f;
5902
5895
 
5903
5896
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5904
- f = RICHCOMPARE(type2);
5897
+ f = TP_RICHCOMPARE(type2);
5905
5898
 
5906
5899
  if (f != NULL) {
5907
5900
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -5920,7 +5913,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5920
5913
  }
5921
5914
  }
5922
5915
 
5923
- Py_DECREF(result);
5916
+ Py_DECREF_IMMORTAL(result);
5924
5917
  }
5925
5918
  }
5926
5919
 
@@ -5942,10 +5935,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5942
5935
  }
5943
5936
  }
5944
5937
 
5945
- Py_DECREF(result);
5938
+ Py_DECREF_IMMORTAL(result);
5946
5939
  }
5947
5940
 
5948
- f = RICHCOMPARE(type2);
5941
+ f = TP_RICHCOMPARE(type2);
5949
5942
  if (f != NULL) {
5950
5943
  PyObject *result = (*f)(operand2, operand1, Py_GT);
5951
5944
 
@@ -5963,7 +5956,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5963
5956
  }
5964
5957
  }
5965
5958
 
5966
- Py_DECREF(result);
5959
+ Py_DECREF_IMMORTAL(result);
5967
5960
  }
5968
5961
 
5969
5962
  int c;
@@ -6058,7 +6051,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6058
6051
  richcmpfunc f;
6059
6052
 
6060
6053
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
6061
- f = RICHCOMPARE(type2);
6054
+ f = TP_RICHCOMPARE(type2);
6062
6055
 
6063
6056
  if (f != NULL) {
6064
6057
  checked_reverse_op = true;
@@ -6079,7 +6072,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6079
6072
  }
6080
6073
  }
6081
6074
 
6082
- Py_DECREF(result);
6075
+ Py_DECREF_IMMORTAL(result);
6083
6076
  }
6084
6077
  }
6085
6078
 
@@ -6102,11 +6095,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6102
6095
  }
6103
6096
  }
6104
6097
 
6105
- Py_DECREF(result);
6098
+ Py_DECREF_IMMORTAL(result);
6106
6099
  }
6107
6100
 
6108
6101
  if (checked_reverse_op == false) {
6109
- f = RICHCOMPARE(type2);
6102
+ f = TP_RICHCOMPARE(type2);
6110
6103
 
6111
6104
  if (f != NULL) {
6112
6105
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -6125,7 +6118,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6125
6118
  }
6126
6119
  }
6127
6120
 
6128
- Py_DECREF(result);
6121
+ Py_DECREF_IMMORTAL(result);
6129
6122
  }
6130
6123
  }
6131
6124
 
@@ -6172,15 +6165,19 @@ static PyObject *COMPARE_LT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6172
6165
 
6173
6166
  if (operand1_long_object == operand2_long_object) {
6174
6167
  r = false;
6175
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6176
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;
6168
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6169
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6170
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) <
6171
+ 0;
6177
6172
  } else {
6178
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6173
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6179
6174
  r = false;
6180
6175
  while (--i >= 0) {
6181
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6182
- r = operand1_long_object->ob_digit[i] < operand2_long_object->ob_digit[i];
6183
- if (Py_SIZE(operand1_long_object) < 0) {
6176
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6177
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6178
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <
6179
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6180
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6184
6181
  r = !r;
6185
6182
  }
6186
6183
  break;
@@ -6190,7 +6187,7 @@ static PyObject *COMPARE_LT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6190
6187
 
6191
6188
  // Convert to target type.
6192
6189
  PyObject *result = BOOL_FROM(r);
6193
- Py_INCREF(result);
6190
+ Py_INCREF_IMMORTAL(result);
6194
6191
  return result;
6195
6192
  }
6196
6193
  /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
@@ -6227,7 +6224,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6227
6224
  return result;
6228
6225
  }
6229
6226
 
6230
- Py_DECREF(result);
6227
+ Py_DECREF_IMMORTAL(result);
6231
6228
  }
6232
6229
 
6233
6230
  // No rich comparison worked, but maybe compare works.
@@ -6268,7 +6265,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6268
6265
 
6269
6266
  bool r = c != 0;
6270
6267
  PyObject *result = BOOL_FROM(r);
6271
- Py_INCREF(result);
6268
+ Py_INCREF_IMMORTAL(result);
6272
6269
  return result;
6273
6270
  }
6274
6271
  }
@@ -6288,11 +6285,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6288
6285
  return result;
6289
6286
  }
6290
6287
 
6291
- Py_DECREF(result);
6288
+ Py_DECREF_IMMORTAL(result);
6292
6289
  }
6293
6290
  }
6294
6291
 
6295
- f = RICHCOMPARE(type1);
6292
+ f = TP_RICHCOMPARE(type1);
6296
6293
  if (f != NULL) {
6297
6294
  PyObject *result = (*f)(operand1, operand2, Py_LT);
6298
6295
 
@@ -6302,7 +6299,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6302
6299
  return result;
6303
6300
  }
6304
6301
 
6305
- Py_DECREF(result);
6302
+ Py_DECREF_IMMORTAL(result);
6306
6303
  }
6307
6304
 
6308
6305
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6315,7 +6312,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6315
6312
  return result;
6316
6313
  }
6317
6314
 
6318
- Py_DECREF(result);
6315
+ Py_DECREF_IMMORTAL(result);
6319
6316
  }
6320
6317
 
6321
6318
  int c;
@@ -6403,7 +6400,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6403
6400
 
6404
6401
  bool r = c != 0;
6405
6402
  PyObject *result = BOOL_FROM(r);
6406
- Py_INCREF(result);
6403
+ Py_INCREF_IMMORTAL(result);
6407
6404
  return result;
6408
6405
  #else
6409
6406
  bool checked_reverse_op = false;
@@ -6423,11 +6420,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6423
6420
  return result;
6424
6421
  }
6425
6422
 
6426
- Py_DECREF(result);
6423
+ Py_DECREF_IMMORTAL(result);
6427
6424
  }
6428
6425
  }
6429
6426
 
6430
- f = RICHCOMPARE(type1);
6427
+ f = TP_RICHCOMPARE(type1);
6431
6428
 
6432
6429
  if (f != NULL) {
6433
6430
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -6438,7 +6435,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6438
6435
  return result;
6439
6436
  }
6440
6437
 
6441
- Py_DECREF(result);
6438
+ Py_DECREF_IMMORTAL(result);
6442
6439
  }
6443
6440
 
6444
6441
  if (checked_reverse_op == false) {
@@ -6453,7 +6450,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6453
6450
  return result;
6454
6451
  }
6455
6452
 
6456
- Py_DECREF(result);
6453
+ Py_DECREF_IMMORTAL(result);
6457
6454
  }
6458
6455
  }
6459
6456
 
@@ -6465,13 +6462,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6465
6462
  case Py_EQ: {
6466
6463
  bool r = operand1 == operand2;
6467
6464
  PyObject *result = BOOL_FROM(r);
6468
- Py_INCREF(result);
6465
+ Py_INCREF_IMMORTAL(result);
6469
6466
  return result;
6470
6467
  }
6471
6468
  case Py_NE: {
6472
6469
  bool r = operand1 != operand2;
6473
6470
  PyObject *result = BOOL_FROM(r);
6474
- Py_INCREF(result);
6471
+ Py_INCREF_IMMORTAL(result);
6475
6472
  return result;
6476
6473
  }
6477
6474
  default:
@@ -6521,7 +6518,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6521
6518
  return result;
6522
6519
  }
6523
6520
 
6524
- Py_DECREF(result);
6521
+ Py_DECREF_IMMORTAL(result);
6525
6522
  }
6526
6523
 
6527
6524
  // No rich comparison worked, but maybe compare works.
@@ -6562,7 +6559,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6562
6559
 
6563
6560
  bool r = c != 0;
6564
6561
  PyObject *result = BOOL_FROM(r);
6565
- Py_INCREF(result);
6562
+ Py_INCREF_IMMORTAL(result);
6566
6563
  return result;
6567
6564
  }
6568
6565
  }
@@ -6571,7 +6568,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6571
6568
  richcmpfunc f;
6572
6569
 
6573
6570
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6574
- f = RICHCOMPARE(type2);
6571
+ f = TP_RICHCOMPARE(type2);
6575
6572
 
6576
6573
  if (f != NULL) {
6577
6574
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -6582,7 +6579,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6582
6579
  return result;
6583
6580
  }
6584
6581
 
6585
- Py_DECREF(result);
6582
+ Py_DECREF_IMMORTAL(result);
6586
6583
  }
6587
6584
  }
6588
6585
 
@@ -6596,10 +6593,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6596
6593
  return result;
6597
6594
  }
6598
6595
 
6599
- Py_DECREF(result);
6596
+ Py_DECREF_IMMORTAL(result);
6600
6597
  }
6601
6598
 
6602
- f = RICHCOMPARE(type2);
6599
+ f = TP_RICHCOMPARE(type2);
6603
6600
  if (f != NULL) {
6604
6601
  PyObject *result = (*f)(operand2, operand1, Py_GT);
6605
6602
 
@@ -6609,7 +6606,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6609
6606
  return result;
6610
6607
  }
6611
6608
 
6612
- Py_DECREF(result);
6609
+ Py_DECREF_IMMORTAL(result);
6613
6610
  }
6614
6611
 
6615
6612
  int c;
@@ -6697,14 +6694,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6697
6694
 
6698
6695
  bool r = c != 0;
6699
6696
  PyObject *result = BOOL_FROM(r);
6700
- Py_INCREF(result);
6697
+ Py_INCREF_IMMORTAL(result);
6701
6698
  return result;
6702
6699
  #else
6703
6700
  bool checked_reverse_op = false;
6704
6701
  richcmpfunc f;
6705
6702
 
6706
6703
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6707
- f = RICHCOMPARE(type2);
6704
+ f = TP_RICHCOMPARE(type2);
6708
6705
 
6709
6706
  if (f != NULL) {
6710
6707
  checked_reverse_op = true;
@@ -6717,7 +6714,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6717
6714
  return result;
6718
6715
  }
6719
6716
 
6720
- Py_DECREF(result);
6717
+ Py_DECREF_IMMORTAL(result);
6721
6718
  }
6722
6719
  }
6723
6720
 
@@ -6732,11 +6729,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6732
6729
  return result;
6733
6730
  }
6734
6731
 
6735
- Py_DECREF(result);
6732
+ Py_DECREF_IMMORTAL(result);
6736
6733
  }
6737
6734
 
6738
6735
  if (checked_reverse_op == false) {
6739
- f = RICHCOMPARE(type2);
6736
+ f = TP_RICHCOMPARE(type2);
6740
6737
 
6741
6738
  if (f != NULL) {
6742
6739
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -6747,7 +6744,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6747
6744
  return result;
6748
6745
  }
6749
6746
 
6750
- Py_DECREF(result);
6747
+ Py_DECREF_IMMORTAL(result);
6751
6748
  }
6752
6749
  }
6753
6750
 
@@ -6759,13 +6756,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6759
6756
  case Py_EQ: {
6760
6757
  bool r = operand1 == operand2;
6761
6758
  PyObject *result = BOOL_FROM(r);
6762
- Py_INCREF(result);
6759
+ Py_INCREF_IMMORTAL(result);
6763
6760
  return result;
6764
6761
  }
6765
6762
  case Py_NE: {
6766
6763
  bool r = operand1 != operand2;
6767
6764
  PyObject *result = BOOL_FROM(r);
6768
- Py_INCREF(result);
6765
+ Py_INCREF_IMMORTAL(result);
6769
6766
  return result;
6770
6767
  }
6771
6768
  default:
@@ -6801,15 +6798,19 @@ static bool COMPARE_LT_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
6801
6798
 
6802
6799
  if (operand1_long_object == operand2_long_object) {
6803
6800
  r = false;
6804
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6805
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;
6801
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6802
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6803
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) <
6804
+ 0;
6806
6805
  } else {
6807
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6806
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6808
6807
  r = false;
6809
6808
  while (--i >= 0) {
6810
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6811
- r = operand1_long_object->ob_digit[i] < operand2_long_object->ob_digit[i];
6812
- if (Py_SIZE(operand1_long_object) < 0) {
6809
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6810
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6811
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <
6812
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6813
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6813
6814
  r = !r;
6814
6815
  }
6815
6816
  break;
@@ -6870,7 +6871,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6870
6871
  }
6871
6872
  }
6872
6873
 
6873
- Py_DECREF(result);
6874
+ Py_DECREF_IMMORTAL(result);
6874
6875
  }
6875
6876
 
6876
6877
  // No rich comparison worked, but maybe compare works.
@@ -6939,11 +6940,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6939
6940
  }
6940
6941
  }
6941
6942
 
6942
- Py_DECREF(result);
6943
+ Py_DECREF_IMMORTAL(result);
6943
6944
  }
6944
6945
  }
6945
6946
 
6946
- f = RICHCOMPARE(type1);
6947
+ f = TP_RICHCOMPARE(type1);
6947
6948
  if (f != NULL) {
6948
6949
  PyObject *result = (*f)(operand1, operand2, Py_LT);
6949
6950
 
@@ -6961,7 +6962,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6961
6962
  }
6962
6963
  }
6963
6964
 
6964
- Py_DECREF(result);
6965
+ Py_DECREF_IMMORTAL(result);
6965
6966
  }
6966
6967
 
6967
6968
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6982,7 +6983,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6982
6983
  }
6983
6984
  }
6984
6985
 
6985
- Py_DECREF(result);
6986
+ Py_DECREF_IMMORTAL(result);
6986
6987
  }
6987
6988
 
6988
6989
  int c;
@@ -7098,11 +7099,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7098
7099
  }
7099
7100
  }
7100
7101
 
7101
- Py_DECREF(result);
7102
+ Py_DECREF_IMMORTAL(result);
7102
7103
  }
7103
7104
  }
7104
7105
 
7105
- f = RICHCOMPARE(type1);
7106
+ f = TP_RICHCOMPARE(type1);
7106
7107
 
7107
7108
  if (f != NULL) {
7108
7109
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -7121,7 +7122,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7121
7122
  }
7122
7123
  }
7123
7124
 
7124
- Py_DECREF(result);
7125
+ Py_DECREF_IMMORTAL(result);
7125
7126
  }
7126
7127
 
7127
7128
  if (checked_reverse_op == false) {
@@ -7144,7 +7145,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7144
7145
  }
7145
7146
  }
7146
7147
 
7147
- Py_DECREF(result);
7148
+ Py_DECREF_IMMORTAL(result);
7148
7149
  }
7149
7150
  }
7150
7151
 
@@ -7220,7 +7221,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7220
7221
  }
7221
7222
  }
7222
7223
 
7223
- Py_DECREF(result);
7224
+ Py_DECREF_IMMORTAL(result);
7224
7225
  }
7225
7226
 
7226
7227
  // No rich comparison worked, but maybe compare works.
@@ -7270,7 +7271,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7270
7271
  richcmpfunc f;
7271
7272
 
7272
7273
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7273
- f = RICHCOMPARE(type2);
7274
+ f = TP_RICHCOMPARE(type2);
7274
7275
 
7275
7276
  if (f != NULL) {
7276
7277
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -7289,7 +7290,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7289
7290
  }
7290
7291
  }
7291
7292
 
7292
- Py_DECREF(result);
7293
+ Py_DECREF_IMMORTAL(result);
7293
7294
  }
7294
7295
  }
7295
7296
 
@@ -7311,10 +7312,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7311
7312
  }
7312
7313
  }
7313
7314
 
7314
- Py_DECREF(result);
7315
+ Py_DECREF_IMMORTAL(result);
7315
7316
  }
7316
7317
 
7317
- f = RICHCOMPARE(type2);
7318
+ f = TP_RICHCOMPARE(type2);
7318
7319
  if (f != NULL) {
7319
7320
  PyObject *result = (*f)(operand2, operand1, Py_GT);
7320
7321
 
@@ -7332,7 +7333,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7332
7333
  }
7333
7334
  }
7334
7335
 
7335
- Py_DECREF(result);
7336
+ Py_DECREF_IMMORTAL(result);
7336
7337
  }
7337
7338
 
7338
7339
  int c;
@@ -7427,7 +7428,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7427
7428
  richcmpfunc f;
7428
7429
 
7429
7430
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7430
- f = RICHCOMPARE(type2);
7431
+ f = TP_RICHCOMPARE(type2);
7431
7432
 
7432
7433
  if (f != NULL) {
7433
7434
  checked_reverse_op = true;
@@ -7448,7 +7449,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7448
7449
  }
7449
7450
  }
7450
7451
 
7451
- Py_DECREF(result);
7452
+ Py_DECREF_IMMORTAL(result);
7452
7453
  }
7453
7454
  }
7454
7455
 
@@ -7471,11 +7472,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7471
7472
  }
7472
7473
  }
7473
7474
 
7474
- Py_DECREF(result);
7475
+ Py_DECREF_IMMORTAL(result);
7475
7476
  }
7476
7477
 
7477
7478
  if (checked_reverse_op == false) {
7478
- f = RICHCOMPARE(type2);
7479
+ f = TP_RICHCOMPARE(type2);
7479
7480
 
7480
7481
  if (f != NULL) {
7481
7482
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -7494,7 +7495,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7494
7495
  }
7495
7496
  }
7496
7497
 
7497
- Py_DECREF(result);
7498
+ Py_DECREF_IMMORTAL(result);
7498
7499
  }
7499
7500
  }
7500
7501
 
@@ -7541,7 +7542,7 @@ static PyObject *COMPARE_LT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *ope
7541
7542
 
7542
7543
  // Convert to target type.
7543
7544
  PyObject *result = BOOL_FROM(r);
7544
- Py_INCREF(result);
7545
+ Py_INCREF_IMMORTAL(result);
7545
7546
  return result;
7546
7547
  }
7547
7548
  /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
@@ -7578,7 +7579,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7578
7579
  return result;
7579
7580
  }
7580
7581
 
7581
- Py_DECREF(result);
7582
+ Py_DECREF_IMMORTAL(result);
7582
7583
  }
7583
7584
 
7584
7585
  // No rich comparison worked, but maybe compare works.
@@ -7619,7 +7620,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7619
7620
 
7620
7621
  bool r = c != 0;
7621
7622
  PyObject *result = BOOL_FROM(r);
7622
- Py_INCREF(result);
7623
+ Py_INCREF_IMMORTAL(result);
7623
7624
  return result;
7624
7625
  }
7625
7626
  }
@@ -7639,11 +7640,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7639
7640
  return result;
7640
7641
  }
7641
7642
 
7642
- Py_DECREF(result);
7643
+ Py_DECREF_IMMORTAL(result);
7643
7644
  }
7644
7645
  }
7645
7646
 
7646
- f = RICHCOMPARE(type1);
7647
+ f = TP_RICHCOMPARE(type1);
7647
7648
  if (f != NULL) {
7648
7649
  PyObject *result = (*f)(operand1, operand2, Py_LT);
7649
7650
 
@@ -7653,7 +7654,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7653
7654
  return result;
7654
7655
  }
7655
7656
 
7656
- Py_DECREF(result);
7657
+ Py_DECREF_IMMORTAL(result);
7657
7658
  }
7658
7659
 
7659
7660
  f = PyFloat_Type.tp_richcompare;
@@ -7666,7 +7667,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7666
7667
  return result;
7667
7668
  }
7668
7669
 
7669
- Py_DECREF(result);
7670
+ Py_DECREF_IMMORTAL(result);
7670
7671
  }
7671
7672
 
7672
7673
  int c;
@@ -7754,7 +7755,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7754
7755
 
7755
7756
  bool r = c != 0;
7756
7757
  PyObject *result = BOOL_FROM(r);
7757
- Py_INCREF(result);
7758
+ Py_INCREF_IMMORTAL(result);
7758
7759
  return result;
7759
7760
  #else
7760
7761
  bool checked_reverse_op = false;
@@ -7774,11 +7775,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7774
7775
  return result;
7775
7776
  }
7776
7777
 
7777
- Py_DECREF(result);
7778
+ Py_DECREF_IMMORTAL(result);
7778
7779
  }
7779
7780
  }
7780
7781
 
7781
- f = RICHCOMPARE(type1);
7782
+ f = TP_RICHCOMPARE(type1);
7782
7783
 
7783
7784
  if (f != NULL) {
7784
7785
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -7789,7 +7790,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7789
7790
  return result;
7790
7791
  }
7791
7792
 
7792
- Py_DECREF(result);
7793
+ Py_DECREF_IMMORTAL(result);
7793
7794
  }
7794
7795
 
7795
7796
  if (checked_reverse_op == false) {
@@ -7804,7 +7805,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7804
7805
  return result;
7805
7806
  }
7806
7807
 
7807
- Py_DECREF(result);
7808
+ Py_DECREF_IMMORTAL(result);
7808
7809
  }
7809
7810
  }
7810
7811
 
@@ -7816,13 +7817,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7816
7817
  case Py_EQ: {
7817
7818
  bool r = operand1 == operand2;
7818
7819
  PyObject *result = BOOL_FROM(r);
7819
- Py_INCREF(result);
7820
+ Py_INCREF_IMMORTAL(result);
7820
7821
  return result;
7821
7822
  }
7822
7823
  case Py_NE: {
7823
7824
  bool r = operand1 != operand2;
7824
7825
  PyObject *result = BOOL_FROM(r);
7825
- Py_INCREF(result);
7826
+ Py_INCREF_IMMORTAL(result);
7826
7827
  return result;
7827
7828
  }
7828
7829
  default:
@@ -7870,7 +7871,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7870
7871
  return result;
7871
7872
  }
7872
7873
 
7873
- Py_DECREF(result);
7874
+ Py_DECREF_IMMORTAL(result);
7874
7875
  }
7875
7876
 
7876
7877
  // No rich comparison worked, but maybe compare works.
@@ -7911,7 +7912,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7911
7912
 
7912
7913
  bool r = c != 0;
7913
7914
  PyObject *result = BOOL_FROM(r);
7914
- Py_INCREF(result);
7915
+ Py_INCREF_IMMORTAL(result);
7915
7916
  return result;
7916
7917
  }
7917
7918
  }
@@ -7920,7 +7921,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7920
7921
  richcmpfunc f;
7921
7922
 
7922
7923
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
7923
- f = RICHCOMPARE(type2);
7924
+ f = TP_RICHCOMPARE(type2);
7924
7925
 
7925
7926
  if (f != NULL) {
7926
7927
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -7931,7 +7932,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7931
7932
  return result;
7932
7933
  }
7933
7934
 
7934
- Py_DECREF(result);
7935
+ Py_DECREF_IMMORTAL(result);
7935
7936
  }
7936
7937
  }
7937
7938
 
@@ -7945,10 +7946,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7945
7946
  return result;
7946
7947
  }
7947
7948
 
7948
- Py_DECREF(result);
7949
+ Py_DECREF_IMMORTAL(result);
7949
7950
  }
7950
7951
 
7951
- f = RICHCOMPARE(type2);
7952
+ f = TP_RICHCOMPARE(type2);
7952
7953
  if (f != NULL) {
7953
7954
  PyObject *result = (*f)(operand2, operand1, Py_GT);
7954
7955
 
@@ -7958,7 +7959,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7958
7959
  return result;
7959
7960
  }
7960
7961
 
7961
- Py_DECREF(result);
7962
+ Py_DECREF_IMMORTAL(result);
7962
7963
  }
7963
7964
 
7964
7965
  int c;
@@ -8046,14 +8047,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8046
8047
 
8047
8048
  bool r = c != 0;
8048
8049
  PyObject *result = BOOL_FROM(r);
8049
- Py_INCREF(result);
8050
+ Py_INCREF_IMMORTAL(result);
8050
8051
  return result;
8051
8052
  #else
8052
8053
  bool checked_reverse_op = false;
8053
8054
  richcmpfunc f;
8054
8055
 
8055
8056
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8056
- f = RICHCOMPARE(type2);
8057
+ f = TP_RICHCOMPARE(type2);
8057
8058
 
8058
8059
  if (f != NULL) {
8059
8060
  checked_reverse_op = true;
@@ -8066,7 +8067,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8066
8067
  return result;
8067
8068
  }
8068
8069
 
8069
- Py_DECREF(result);
8070
+ Py_DECREF_IMMORTAL(result);
8070
8071
  }
8071
8072
  }
8072
8073
 
@@ -8081,11 +8082,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8081
8082
  return result;
8082
8083
  }
8083
8084
 
8084
- Py_DECREF(result);
8085
+ Py_DECREF_IMMORTAL(result);
8085
8086
  }
8086
8087
 
8087
8088
  if (checked_reverse_op == false) {
8088
- f = RICHCOMPARE(type2);
8089
+ f = TP_RICHCOMPARE(type2);
8089
8090
 
8090
8091
  if (f != NULL) {
8091
8092
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -8096,7 +8097,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8096
8097
  return result;
8097
8098
  }
8098
8099
 
8099
- Py_DECREF(result);
8100
+ Py_DECREF_IMMORTAL(result);
8100
8101
  }
8101
8102
  }
8102
8103
 
@@ -8108,13 +8109,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8108
8109
  case Py_EQ: {
8109
8110
  bool r = operand1 == operand2;
8110
8111
  PyObject *result = BOOL_FROM(r);
8111
- Py_INCREF(result);
8112
+ Py_INCREF_IMMORTAL(result);
8112
8113
  return result;
8113
8114
  }
8114
8115
  case Py_NE: {
8115
8116
  bool r = operand1 != operand2;
8116
8117
  PyObject *result = BOOL_FROM(r);
8117
- Py_INCREF(result);
8118
+ Py_INCREF_IMMORTAL(result);
8118
8119
  return result;
8119
8120
  }
8120
8121
  default:
@@ -8198,7 +8199,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8198
8199
  }
8199
8200
  }
8200
8201
 
8201
- Py_DECREF(result);
8202
+ Py_DECREF_IMMORTAL(result);
8202
8203
  }
8203
8204
 
8204
8205
  // No rich comparison worked, but maybe compare works.
@@ -8267,11 +8268,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8267
8268
  }
8268
8269
  }
8269
8270
 
8270
- Py_DECREF(result);
8271
+ Py_DECREF_IMMORTAL(result);
8271
8272
  }
8272
8273
  }
8273
8274
 
8274
- f = RICHCOMPARE(type1);
8275
+ f = TP_RICHCOMPARE(type1);
8275
8276
  if (f != NULL) {
8276
8277
  PyObject *result = (*f)(operand1, operand2, Py_LT);
8277
8278
 
@@ -8289,7 +8290,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8289
8290
  }
8290
8291
  }
8291
8292
 
8292
- Py_DECREF(result);
8293
+ Py_DECREF_IMMORTAL(result);
8293
8294
  }
8294
8295
 
8295
8296
  f = PyFloat_Type.tp_richcompare;
@@ -8310,7 +8311,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8310
8311
  }
8311
8312
  }
8312
8313
 
8313
- Py_DECREF(result);
8314
+ Py_DECREF_IMMORTAL(result);
8314
8315
  }
8315
8316
 
8316
8317
  int c;
@@ -8426,11 +8427,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8426
8427
  }
8427
8428
  }
8428
8429
 
8429
- Py_DECREF(result);
8430
+ Py_DECREF_IMMORTAL(result);
8430
8431
  }
8431
8432
  }
8432
8433
 
8433
- f = RICHCOMPARE(type1);
8434
+ f = TP_RICHCOMPARE(type1);
8434
8435
 
8435
8436
  if (f != NULL) {
8436
8437
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -8449,7 +8450,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8449
8450
  }
8450
8451
  }
8451
8452
 
8452
- Py_DECREF(result);
8453
+ Py_DECREF_IMMORTAL(result);
8453
8454
  }
8454
8455
 
8455
8456
  if (checked_reverse_op == false) {
@@ -8472,7 +8473,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8472
8473
  }
8473
8474
  }
8474
8475
 
8475
- Py_DECREF(result);
8476
+ Py_DECREF_IMMORTAL(result);
8476
8477
  }
8477
8478
  }
8478
8479
 
@@ -8546,7 +8547,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8546
8547
  }
8547
8548
  }
8548
8549
 
8549
- Py_DECREF(result);
8550
+ Py_DECREF_IMMORTAL(result);
8550
8551
  }
8551
8552
 
8552
8553
  // No rich comparison worked, but maybe compare works.
@@ -8596,7 +8597,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8596
8597
  richcmpfunc f;
8597
8598
 
8598
8599
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8599
- f = RICHCOMPARE(type2);
8600
+ f = TP_RICHCOMPARE(type2);
8600
8601
 
8601
8602
  if (f != NULL) {
8602
8603
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -8615,7 +8616,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8615
8616
  }
8616
8617
  }
8617
8618
 
8618
- Py_DECREF(result);
8619
+ Py_DECREF_IMMORTAL(result);
8619
8620
  }
8620
8621
  }
8621
8622
 
@@ -8637,10 +8638,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8637
8638
  }
8638
8639
  }
8639
8640
 
8640
- Py_DECREF(result);
8641
+ Py_DECREF_IMMORTAL(result);
8641
8642
  }
8642
8643
 
8643
- f = RICHCOMPARE(type2);
8644
+ f = TP_RICHCOMPARE(type2);
8644
8645
  if (f != NULL) {
8645
8646
  PyObject *result = (*f)(operand2, operand1, Py_GT);
8646
8647
 
@@ -8658,7 +8659,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8658
8659
  }
8659
8660
  }
8660
8661
 
8661
- Py_DECREF(result);
8662
+ Py_DECREF_IMMORTAL(result);
8662
8663
  }
8663
8664
 
8664
8665
  int c;
@@ -8753,7 +8754,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8753
8754
  richcmpfunc f;
8754
8755
 
8755
8756
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8756
- f = RICHCOMPARE(type2);
8757
+ f = TP_RICHCOMPARE(type2);
8757
8758
 
8758
8759
  if (f != NULL) {
8759
8760
  checked_reverse_op = true;
@@ -8774,7 +8775,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8774
8775
  }
8775
8776
  }
8776
8777
 
8777
- Py_DECREF(result);
8778
+ Py_DECREF_IMMORTAL(result);
8778
8779
  }
8779
8780
  }
8780
8781
 
@@ -8797,11 +8798,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8797
8798
  }
8798
8799
  }
8799
8800
 
8800
- Py_DECREF(result);
8801
+ Py_DECREF_IMMORTAL(result);
8801
8802
  }
8802
8803
 
8803
8804
  if (checked_reverse_op == false) {
8804
- f = RICHCOMPARE(type2);
8805
+ f = TP_RICHCOMPARE(type2);
8805
8806
 
8806
8807
  if (f != NULL) {
8807
8808
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -8820,7 +8821,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8820
8821
  }
8821
8822
  }
8822
8823
 
8823
- Py_DECREF(result);
8824
+ Py_DECREF_IMMORTAL(result);
8824
8825
  }
8825
8826
  }
8826
8827
 
@@ -8893,7 +8894,7 @@ static PyObject *COMPARE_LT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *ope
8893
8894
 
8894
8895
  // Convert to target type.
8895
8896
  PyObject *result = BOOL_FROM(r);
8896
- Py_INCREF(result);
8897
+ Py_INCREF_IMMORTAL(result);
8897
8898
  return result;
8898
8899
  }
8899
8900
 
@@ -8933,7 +8934,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8933
8934
  return result;
8934
8935
  }
8935
8936
 
8936
- Py_DECREF(result);
8937
+ Py_DECREF_IMMORTAL(result);
8937
8938
  }
8938
8939
 
8939
8940
  // No rich comparison worked, but maybe compare works.
@@ -8974,7 +8975,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8974
8975
 
8975
8976
  bool r = c != 0;
8976
8977
  PyObject *result = BOOL_FROM(r);
8977
- Py_INCREF(result);
8978
+ Py_INCREF_IMMORTAL(result);
8978
8979
  return result;
8979
8980
  }
8980
8981
  }
@@ -8994,11 +8995,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8994
8995
  return result;
8995
8996
  }
8996
8997
 
8997
- Py_DECREF(result);
8998
+ Py_DECREF_IMMORTAL(result);
8998
8999
  }
8999
9000
  }
9000
9001
 
9001
- f = RICHCOMPARE(type1);
9002
+ f = TP_RICHCOMPARE(type1);
9002
9003
  if (f != NULL) {
9003
9004
  PyObject *result = (*f)(operand1, operand2, Py_LT);
9004
9005
 
@@ -9008,7 +9009,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9008
9009
  return result;
9009
9010
  }
9010
9011
 
9011
- Py_DECREF(result);
9012
+ Py_DECREF_IMMORTAL(result);
9012
9013
  }
9013
9014
 
9014
9015
  f = PyTuple_Type.tp_richcompare;
@@ -9021,7 +9022,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9021
9022
  return result;
9022
9023
  }
9023
9024
 
9024
- Py_DECREF(result);
9025
+ Py_DECREF_IMMORTAL(result);
9025
9026
  }
9026
9027
 
9027
9028
  int c;
@@ -9109,7 +9110,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9109
9110
 
9110
9111
  bool r = c != 0;
9111
9112
  PyObject *result = BOOL_FROM(r);
9112
- Py_INCREF(result);
9113
+ Py_INCREF_IMMORTAL(result);
9113
9114
  return result;
9114
9115
  #else
9115
9116
  bool checked_reverse_op = false;
@@ -9129,11 +9130,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9129
9130
  return result;
9130
9131
  }
9131
9132
 
9132
- Py_DECREF(result);
9133
+ Py_DECREF_IMMORTAL(result);
9133
9134
  }
9134
9135
  }
9135
9136
 
9136
- f = RICHCOMPARE(type1);
9137
+ f = TP_RICHCOMPARE(type1);
9137
9138
 
9138
9139
  if (f != NULL) {
9139
9140
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -9144,7 +9145,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9144
9145
  return result;
9145
9146
  }
9146
9147
 
9147
- Py_DECREF(result);
9148
+ Py_DECREF_IMMORTAL(result);
9148
9149
  }
9149
9150
 
9150
9151
  if (checked_reverse_op == false) {
@@ -9159,7 +9160,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9159
9160
  return result;
9160
9161
  }
9161
9162
 
9162
- Py_DECREF(result);
9163
+ Py_DECREF_IMMORTAL(result);
9163
9164
  }
9164
9165
  }
9165
9166
 
@@ -9171,13 +9172,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9171
9172
  case Py_EQ: {
9172
9173
  bool r = operand1 == operand2;
9173
9174
  PyObject *result = BOOL_FROM(r);
9174
- Py_INCREF(result);
9175
+ Py_INCREF_IMMORTAL(result);
9175
9176
  return result;
9176
9177
  }
9177
9178
  case Py_NE: {
9178
9179
  bool r = operand1 != operand2;
9179
9180
  PyObject *result = BOOL_FROM(r);
9180
- Py_INCREF(result);
9181
+ Py_INCREF_IMMORTAL(result);
9181
9182
  return result;
9182
9183
  }
9183
9184
  default:
@@ -9225,7 +9226,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9225
9226
  return result;
9226
9227
  }
9227
9228
 
9228
- Py_DECREF(result);
9229
+ Py_DECREF_IMMORTAL(result);
9229
9230
  }
9230
9231
 
9231
9232
  // No rich comparison worked, but maybe compare works.
@@ -9266,7 +9267,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9266
9267
 
9267
9268
  bool r = c != 0;
9268
9269
  PyObject *result = BOOL_FROM(r);
9269
- Py_INCREF(result);
9270
+ Py_INCREF_IMMORTAL(result);
9270
9271
  return result;
9271
9272
  }
9272
9273
  }
@@ -9275,7 +9276,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9275
9276
  richcmpfunc f;
9276
9277
 
9277
9278
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9278
- f = RICHCOMPARE(type2);
9279
+ f = TP_RICHCOMPARE(type2);
9279
9280
 
9280
9281
  if (f != NULL) {
9281
9282
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -9286,7 +9287,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9286
9287
  return result;
9287
9288
  }
9288
9289
 
9289
- Py_DECREF(result);
9290
+ Py_DECREF_IMMORTAL(result);
9290
9291
  }
9291
9292
  }
9292
9293
 
@@ -9300,10 +9301,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9300
9301
  return result;
9301
9302
  }
9302
9303
 
9303
- Py_DECREF(result);
9304
+ Py_DECREF_IMMORTAL(result);
9304
9305
  }
9305
9306
 
9306
- f = RICHCOMPARE(type2);
9307
+ f = TP_RICHCOMPARE(type2);
9307
9308
  if (f != NULL) {
9308
9309
  PyObject *result = (*f)(operand2, operand1, Py_GT);
9309
9310
 
@@ -9313,7 +9314,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9313
9314
  return result;
9314
9315
  }
9315
9316
 
9316
- Py_DECREF(result);
9317
+ Py_DECREF_IMMORTAL(result);
9317
9318
  }
9318
9319
 
9319
9320
  int c;
@@ -9401,14 +9402,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9401
9402
 
9402
9403
  bool r = c != 0;
9403
9404
  PyObject *result = BOOL_FROM(r);
9404
- Py_INCREF(result);
9405
+ Py_INCREF_IMMORTAL(result);
9405
9406
  return result;
9406
9407
  #else
9407
9408
  bool checked_reverse_op = false;
9408
9409
  richcmpfunc f;
9409
9410
 
9410
9411
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9411
- f = RICHCOMPARE(type2);
9412
+ f = TP_RICHCOMPARE(type2);
9412
9413
 
9413
9414
  if (f != NULL) {
9414
9415
  checked_reverse_op = true;
@@ -9421,7 +9422,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9421
9422
  return result;
9422
9423
  }
9423
9424
 
9424
- Py_DECREF(result);
9425
+ Py_DECREF_IMMORTAL(result);
9425
9426
  }
9426
9427
  }
9427
9428
 
@@ -9436,11 +9437,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9436
9437
  return result;
9437
9438
  }
9438
9439
 
9439
- Py_DECREF(result);
9440
+ Py_DECREF_IMMORTAL(result);
9440
9441
  }
9441
9442
 
9442
9443
  if (checked_reverse_op == false) {
9443
- f = RICHCOMPARE(type2);
9444
+ f = TP_RICHCOMPARE(type2);
9444
9445
 
9445
9446
  if (f != NULL) {
9446
9447
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -9451,7 +9452,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9451
9452
  return result;
9452
9453
  }
9453
9454
 
9454
- Py_DECREF(result);
9455
+ Py_DECREF_IMMORTAL(result);
9455
9456
  }
9456
9457
  }
9457
9458
 
@@ -9463,13 +9464,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9463
9464
  case Py_EQ: {
9464
9465
  bool r = operand1 == operand2;
9465
9466
  PyObject *result = BOOL_FROM(r);
9466
- Py_INCREF(result);
9467
+ Py_INCREF_IMMORTAL(result);
9467
9468
  return result;
9468
9469
  }
9469
9470
  case Py_NE: {
9470
9471
  bool r = operand1 != operand2;
9471
9472
  PyObject *result = BOOL_FROM(r);
9472
- Py_INCREF(result);
9473
+ Py_INCREF_IMMORTAL(result);
9473
9474
  return result;
9474
9475
  }
9475
9476
  default:
@@ -9578,7 +9579,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9578
9579
  }
9579
9580
  }
9580
9581
 
9581
- Py_DECREF(result);
9582
+ Py_DECREF_IMMORTAL(result);
9582
9583
  }
9583
9584
 
9584
9585
  // No rich comparison worked, but maybe compare works.
@@ -9647,11 +9648,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9647
9648
  }
9648
9649
  }
9649
9650
 
9650
- Py_DECREF(result);
9651
+ Py_DECREF_IMMORTAL(result);
9651
9652
  }
9652
9653
  }
9653
9654
 
9654
- f = RICHCOMPARE(type1);
9655
+ f = TP_RICHCOMPARE(type1);
9655
9656
  if (f != NULL) {
9656
9657
  PyObject *result = (*f)(operand1, operand2, Py_LT);
9657
9658
 
@@ -9669,7 +9670,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9669
9670
  }
9670
9671
  }
9671
9672
 
9672
- Py_DECREF(result);
9673
+ Py_DECREF_IMMORTAL(result);
9673
9674
  }
9674
9675
 
9675
9676
  f = PyTuple_Type.tp_richcompare;
@@ -9690,7 +9691,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9690
9691
  }
9691
9692
  }
9692
9693
 
9693
- Py_DECREF(result);
9694
+ Py_DECREF_IMMORTAL(result);
9694
9695
  }
9695
9696
 
9696
9697
  int c;
@@ -9806,11 +9807,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9806
9807
  }
9807
9808
  }
9808
9809
 
9809
- Py_DECREF(result);
9810
+ Py_DECREF_IMMORTAL(result);
9810
9811
  }
9811
9812
  }
9812
9813
 
9813
- f = RICHCOMPARE(type1);
9814
+ f = TP_RICHCOMPARE(type1);
9814
9815
 
9815
9816
  if (f != NULL) {
9816
9817
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -9829,7 +9830,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9829
9830
  }
9830
9831
  }
9831
9832
 
9832
- Py_DECREF(result);
9833
+ Py_DECREF_IMMORTAL(result);
9833
9834
  }
9834
9835
 
9835
9836
  if (checked_reverse_op == false) {
@@ -9852,7 +9853,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9852
9853
  }
9853
9854
  }
9854
9855
 
9855
- Py_DECREF(result);
9856
+ Py_DECREF_IMMORTAL(result);
9856
9857
  }
9857
9858
  }
9858
9859
 
@@ -9926,7 +9927,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9926
9927
  }
9927
9928
  }
9928
9929
 
9929
- Py_DECREF(result);
9930
+ Py_DECREF_IMMORTAL(result);
9930
9931
  }
9931
9932
 
9932
9933
  // No rich comparison worked, but maybe compare works.
@@ -9976,7 +9977,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9976
9977
  richcmpfunc f;
9977
9978
 
9978
9979
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9979
- f = RICHCOMPARE(type2);
9980
+ f = TP_RICHCOMPARE(type2);
9980
9981
 
9981
9982
  if (f != NULL) {
9982
9983
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -9995,7 +9996,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9995
9996
  }
9996
9997
  }
9997
9998
 
9998
- Py_DECREF(result);
9999
+ Py_DECREF_IMMORTAL(result);
9999
10000
  }
10000
10001
  }
10001
10002
 
@@ -10017,10 +10018,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10017
10018
  }
10018
10019
  }
10019
10020
 
10020
- Py_DECREF(result);
10021
+ Py_DECREF_IMMORTAL(result);
10021
10022
  }
10022
10023
 
10023
- f = RICHCOMPARE(type2);
10024
+ f = TP_RICHCOMPARE(type2);
10024
10025
  if (f != NULL) {
10025
10026
  PyObject *result = (*f)(operand2, operand1, Py_GT);
10026
10027
 
@@ -10038,7 +10039,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10038
10039
  }
10039
10040
  }
10040
10041
 
10041
- Py_DECREF(result);
10042
+ Py_DECREF_IMMORTAL(result);
10042
10043
  }
10043
10044
 
10044
10045
  int c;
@@ -10133,7 +10134,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10133
10134
  richcmpfunc f;
10134
10135
 
10135
10136
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
10136
- f = RICHCOMPARE(type2);
10137
+ f = TP_RICHCOMPARE(type2);
10137
10138
 
10138
10139
  if (f != NULL) {
10139
10140
  checked_reverse_op = true;
@@ -10154,7 +10155,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10154
10155
  }
10155
10156
  }
10156
10157
 
10157
- Py_DECREF(result);
10158
+ Py_DECREF_IMMORTAL(result);
10158
10159
  }
10159
10160
  }
10160
10161
 
@@ -10177,11 +10178,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10177
10178
  }
10178
10179
  }
10179
10180
 
10180
- Py_DECREF(result);
10181
+ Py_DECREF_IMMORTAL(result);
10181
10182
  }
10182
10183
 
10183
10184
  if (checked_reverse_op == false) {
10184
- f = RICHCOMPARE(type2);
10185
+ f = TP_RICHCOMPARE(type2);
10185
10186
 
10186
10187
  if (f != NULL) {
10187
10188
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -10200,7 +10201,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10200
10201
  }
10201
10202
  }
10202
10203
 
10203
- Py_DECREF(result);
10204
+ Py_DECREF_IMMORTAL(result);
10204
10205
  }
10205
10206
  }
10206
10207
 
@@ -10247,14 +10248,11 @@ static PyObject *COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10247
10248
  PyListObject *a = (PyListObject *)operand1;
10248
10249
  PyListObject *b = (PyListObject *)operand2;
10249
10250
 
10250
- Py_ssize_t len_a = Py_SIZE(a);
10251
- Py_ssize_t len_b = Py_SIZE(b);
10252
-
10253
10251
  bool found = false;
10254
10252
  nuitka_bool res = NUITKA_BOOL_TRUE;
10255
10253
 
10256
10254
  Py_ssize_t i;
10257
- for (i = 0; i < len_a && i < len_b; i++) {
10255
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10258
10256
  PyObject *aa = a->ob_item[i];
10259
10257
  PyObject *bb = b->ob_item[i];
10260
10258
 
@@ -10262,7 +10260,11 @@ static PyObject *COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10262
10260
  continue;
10263
10261
  }
10264
10262
 
10263
+ Py_INCREF(aa);
10264
+ Py_INCREF(bb);
10265
10265
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10266
+ Py_DECREF(aa);
10267
+ Py_DECREF(bb);
10266
10268
 
10267
10269
  if (res == NUITKA_BOOL_EXCEPTION) {
10268
10270
  return NULL;
@@ -10275,11 +10277,11 @@ static PyObject *COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10275
10277
  }
10276
10278
 
10277
10279
  if (found == false) {
10278
- bool r = len_a < len_b;
10280
+ bool r = Py_SIZE(a) < Py_SIZE(b);
10279
10281
 
10280
10282
  // Convert to target type.
10281
10283
  PyObject *result = BOOL_FROM(r);
10282
- Py_INCREF(result);
10284
+ Py_INCREF_IMMORTAL(result);
10283
10285
  return result;
10284
10286
  }
10285
10287
 
@@ -10319,7 +10321,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10319
10321
  return result;
10320
10322
  }
10321
10323
 
10322
- Py_DECREF(result);
10324
+ Py_DECREF_IMMORTAL(result);
10323
10325
  }
10324
10326
 
10325
10327
  // No rich comparison worked, but maybe compare works.
@@ -10360,7 +10362,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10360
10362
 
10361
10363
  bool r = c != 0;
10362
10364
  PyObject *result = BOOL_FROM(r);
10363
- Py_INCREF(result);
10365
+ Py_INCREF_IMMORTAL(result);
10364
10366
  return result;
10365
10367
  }
10366
10368
  }
@@ -10380,11 +10382,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10380
10382
  return result;
10381
10383
  }
10382
10384
 
10383
- Py_DECREF(result);
10385
+ Py_DECREF_IMMORTAL(result);
10384
10386
  }
10385
10387
  }
10386
10388
 
10387
- f = RICHCOMPARE(type1);
10389
+ f = TP_RICHCOMPARE(type1);
10388
10390
  if (f != NULL) {
10389
10391
  PyObject *result = (*f)(operand1, operand2, Py_LT);
10390
10392
 
@@ -10394,7 +10396,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10394
10396
  return result;
10395
10397
  }
10396
10398
 
10397
- Py_DECREF(result);
10399
+ Py_DECREF_IMMORTAL(result);
10398
10400
  }
10399
10401
 
10400
10402
  f = PyList_Type.tp_richcompare;
@@ -10407,7 +10409,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10407
10409
  return result;
10408
10410
  }
10409
10411
 
10410
- Py_DECREF(result);
10412
+ Py_DECREF_IMMORTAL(result);
10411
10413
  }
10412
10414
 
10413
10415
  int c;
@@ -10495,7 +10497,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10495
10497
 
10496
10498
  bool r = c != 0;
10497
10499
  PyObject *result = BOOL_FROM(r);
10498
- Py_INCREF(result);
10500
+ Py_INCREF_IMMORTAL(result);
10499
10501
  return result;
10500
10502
  #else
10501
10503
  bool checked_reverse_op = false;
@@ -10515,11 +10517,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10515
10517
  return result;
10516
10518
  }
10517
10519
 
10518
- Py_DECREF(result);
10520
+ Py_DECREF_IMMORTAL(result);
10519
10521
  }
10520
10522
  }
10521
10523
 
10522
- f = RICHCOMPARE(type1);
10524
+ f = TP_RICHCOMPARE(type1);
10523
10525
 
10524
10526
  if (f != NULL) {
10525
10527
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -10530,7 +10532,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10530
10532
  return result;
10531
10533
  }
10532
10534
 
10533
- Py_DECREF(result);
10535
+ Py_DECREF_IMMORTAL(result);
10534
10536
  }
10535
10537
 
10536
10538
  if (checked_reverse_op == false) {
@@ -10545,7 +10547,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10545
10547
  return result;
10546
10548
  }
10547
10549
 
10548
- Py_DECREF(result);
10550
+ Py_DECREF_IMMORTAL(result);
10549
10551
  }
10550
10552
  }
10551
10553
 
@@ -10557,13 +10559,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10557
10559
  case Py_EQ: {
10558
10560
  bool r = operand1 == operand2;
10559
10561
  PyObject *result = BOOL_FROM(r);
10560
- Py_INCREF(result);
10562
+ Py_INCREF_IMMORTAL(result);
10561
10563
  return result;
10562
10564
  }
10563
10565
  case Py_NE: {
10564
10566
  bool r = operand1 != operand2;
10565
10567
  PyObject *result = BOOL_FROM(r);
10566
- Py_INCREF(result);
10568
+ Py_INCREF_IMMORTAL(result);
10567
10569
  return result;
10568
10570
  }
10569
10571
  default:
@@ -10611,7 +10613,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10611
10613
  return result;
10612
10614
  }
10613
10615
 
10614
- Py_DECREF(result);
10616
+ Py_DECREF_IMMORTAL(result);
10615
10617
  }
10616
10618
 
10617
10619
  // No rich comparison worked, but maybe compare works.
@@ -10652,7 +10654,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10652
10654
 
10653
10655
  bool r = c != 0;
10654
10656
  PyObject *result = BOOL_FROM(r);
10655
- Py_INCREF(result);
10657
+ Py_INCREF_IMMORTAL(result);
10656
10658
  return result;
10657
10659
  }
10658
10660
  }
@@ -10661,7 +10663,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10661
10663
  richcmpfunc f;
10662
10664
 
10663
10665
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10664
- f = RICHCOMPARE(type2);
10666
+ f = TP_RICHCOMPARE(type2);
10665
10667
 
10666
10668
  if (f != NULL) {
10667
10669
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -10672,7 +10674,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10672
10674
  return result;
10673
10675
  }
10674
10676
 
10675
- Py_DECREF(result);
10677
+ Py_DECREF_IMMORTAL(result);
10676
10678
  }
10677
10679
  }
10678
10680
 
@@ -10686,10 +10688,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10686
10688
  return result;
10687
10689
  }
10688
10690
 
10689
- Py_DECREF(result);
10691
+ Py_DECREF_IMMORTAL(result);
10690
10692
  }
10691
10693
 
10692
- f = RICHCOMPARE(type2);
10694
+ f = TP_RICHCOMPARE(type2);
10693
10695
  if (f != NULL) {
10694
10696
  PyObject *result = (*f)(operand2, operand1, Py_GT);
10695
10697
 
@@ -10699,7 +10701,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10699
10701
  return result;
10700
10702
  }
10701
10703
 
10702
- Py_DECREF(result);
10704
+ Py_DECREF_IMMORTAL(result);
10703
10705
  }
10704
10706
 
10705
10707
  int c;
@@ -10787,14 +10789,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10787
10789
 
10788
10790
  bool r = c != 0;
10789
10791
  PyObject *result = BOOL_FROM(r);
10790
- Py_INCREF(result);
10792
+ Py_INCREF_IMMORTAL(result);
10791
10793
  return result;
10792
10794
  #else
10793
10795
  bool checked_reverse_op = false;
10794
10796
  richcmpfunc f;
10795
10797
 
10796
10798
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10797
- f = RICHCOMPARE(type2);
10799
+ f = TP_RICHCOMPARE(type2);
10798
10800
 
10799
10801
  if (f != NULL) {
10800
10802
  checked_reverse_op = true;
@@ -10807,7 +10809,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10807
10809
  return result;
10808
10810
  }
10809
10811
 
10810
- Py_DECREF(result);
10812
+ Py_DECREF_IMMORTAL(result);
10811
10813
  }
10812
10814
  }
10813
10815
 
@@ -10822,11 +10824,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10822
10824
  return result;
10823
10825
  }
10824
10826
 
10825
- Py_DECREF(result);
10827
+ Py_DECREF_IMMORTAL(result);
10826
10828
  }
10827
10829
 
10828
10830
  if (checked_reverse_op == false) {
10829
- f = RICHCOMPARE(type2);
10831
+ f = TP_RICHCOMPARE(type2);
10830
10832
 
10831
10833
  if (f != NULL) {
10832
10834
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -10837,7 +10839,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10837
10839
  return result;
10838
10840
  }
10839
10841
 
10840
- Py_DECREF(result);
10842
+ Py_DECREF_IMMORTAL(result);
10841
10843
  }
10842
10844
  }
10843
10845
 
@@ -10849,13 +10851,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10849
10851
  case Py_EQ: {
10850
10852
  bool r = operand1 == operand2;
10851
10853
  PyObject *result = BOOL_FROM(r);
10852
- Py_INCREF(result);
10854
+ Py_INCREF_IMMORTAL(result);
10853
10855
  return result;
10854
10856
  }
10855
10857
  case Py_NE: {
10856
10858
  bool r = operand1 != operand2;
10857
10859
  PyObject *result = BOOL_FROM(r);
10858
- Py_INCREF(result);
10860
+ Py_INCREF_IMMORTAL(result);
10859
10861
  return result;
10860
10862
  }
10861
10863
  default:
@@ -10884,14 +10886,11 @@ static nuitka_bool COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10884
10886
  PyListObject *a = (PyListObject *)operand1;
10885
10887
  PyListObject *b = (PyListObject *)operand2;
10886
10888
 
10887
- Py_ssize_t len_a = Py_SIZE(a);
10888
- Py_ssize_t len_b = Py_SIZE(b);
10889
-
10890
10889
  bool found = false;
10891
10890
  nuitka_bool res = NUITKA_BOOL_TRUE;
10892
10891
 
10893
10892
  Py_ssize_t i;
10894
- for (i = 0; i < len_a && i < len_b; i++) {
10893
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10895
10894
  PyObject *aa = a->ob_item[i];
10896
10895
  PyObject *bb = b->ob_item[i];
10897
10896
 
@@ -10899,7 +10898,11 @@ static nuitka_bool COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10899
10898
  continue;
10900
10899
  }
10901
10900
 
10901
+ Py_INCREF(aa);
10902
+ Py_INCREF(bb);
10902
10903
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10904
+ Py_DECREF(aa);
10905
+ Py_DECREF(bb);
10903
10906
 
10904
10907
  if (res == NUITKA_BOOL_EXCEPTION) {
10905
10908
  return NUITKA_BOOL_EXCEPTION;
@@ -10912,7 +10915,7 @@ static nuitka_bool COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10912
10915
  }
10913
10916
 
10914
10917
  if (found == false) {
10915
- bool r = len_a < len_b;
10918
+ bool r = Py_SIZE(a) < Py_SIZE(b);
10916
10919
 
10917
10920
  // Convert to target type.
10918
10921
  nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
@@ -10964,7 +10967,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10964
10967
  }
10965
10968
  }
10966
10969
 
10967
- Py_DECREF(result);
10970
+ Py_DECREF_IMMORTAL(result);
10968
10971
  }
10969
10972
 
10970
10973
  // No rich comparison worked, but maybe compare works.
@@ -11033,11 +11036,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11033
11036
  }
11034
11037
  }
11035
11038
 
11036
- Py_DECREF(result);
11039
+ Py_DECREF_IMMORTAL(result);
11037
11040
  }
11038
11041
  }
11039
11042
 
11040
- f = RICHCOMPARE(type1);
11043
+ f = TP_RICHCOMPARE(type1);
11041
11044
  if (f != NULL) {
11042
11045
  PyObject *result = (*f)(operand1, operand2, Py_LT);
11043
11046
 
@@ -11055,7 +11058,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11055
11058
  }
11056
11059
  }
11057
11060
 
11058
- Py_DECREF(result);
11061
+ Py_DECREF_IMMORTAL(result);
11059
11062
  }
11060
11063
 
11061
11064
  f = PyList_Type.tp_richcompare;
@@ -11076,7 +11079,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11076
11079
  }
11077
11080
  }
11078
11081
 
11079
- Py_DECREF(result);
11082
+ Py_DECREF_IMMORTAL(result);
11080
11083
  }
11081
11084
 
11082
11085
  int c;
@@ -11192,11 +11195,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11192
11195
  }
11193
11196
  }
11194
11197
 
11195
- Py_DECREF(result);
11198
+ Py_DECREF_IMMORTAL(result);
11196
11199
  }
11197
11200
  }
11198
11201
 
11199
- f = RICHCOMPARE(type1);
11202
+ f = TP_RICHCOMPARE(type1);
11200
11203
 
11201
11204
  if (f != NULL) {
11202
11205
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -11215,7 +11218,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11215
11218
  }
11216
11219
  }
11217
11220
 
11218
- Py_DECREF(result);
11221
+ Py_DECREF_IMMORTAL(result);
11219
11222
  }
11220
11223
 
11221
11224
  if (checked_reverse_op == false) {
@@ -11238,7 +11241,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11238
11241
  }
11239
11242
  }
11240
11243
 
11241
- Py_DECREF(result);
11244
+ Py_DECREF_IMMORTAL(result);
11242
11245
  }
11243
11246
  }
11244
11247
 
@@ -11312,7 +11315,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11312
11315
  }
11313
11316
  }
11314
11317
 
11315
- Py_DECREF(result);
11318
+ Py_DECREF_IMMORTAL(result);
11316
11319
  }
11317
11320
 
11318
11321
  // No rich comparison worked, but maybe compare works.
@@ -11362,7 +11365,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11362
11365
  richcmpfunc f;
11363
11366
 
11364
11367
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11365
- f = RICHCOMPARE(type2);
11368
+ f = TP_RICHCOMPARE(type2);
11366
11369
 
11367
11370
  if (f != NULL) {
11368
11371
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -11381,7 +11384,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11381
11384
  }
11382
11385
  }
11383
11386
 
11384
- Py_DECREF(result);
11387
+ Py_DECREF_IMMORTAL(result);
11385
11388
  }
11386
11389
  }
11387
11390
 
@@ -11403,10 +11406,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11403
11406
  }
11404
11407
  }
11405
11408
 
11406
- Py_DECREF(result);
11409
+ Py_DECREF_IMMORTAL(result);
11407
11410
  }
11408
11411
 
11409
- f = RICHCOMPARE(type2);
11412
+ f = TP_RICHCOMPARE(type2);
11410
11413
  if (f != NULL) {
11411
11414
  PyObject *result = (*f)(operand2, operand1, Py_GT);
11412
11415
 
@@ -11424,7 +11427,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11424
11427
  }
11425
11428
  }
11426
11429
 
11427
- Py_DECREF(result);
11430
+ Py_DECREF_IMMORTAL(result);
11428
11431
  }
11429
11432
 
11430
11433
  int c;
@@ -11519,7 +11522,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11519
11522
  richcmpfunc f;
11520
11523
 
11521
11524
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11522
- f = RICHCOMPARE(type2);
11525
+ f = TP_RICHCOMPARE(type2);
11523
11526
 
11524
11527
  if (f != NULL) {
11525
11528
  checked_reverse_op = true;
@@ -11540,7 +11543,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11540
11543
  }
11541
11544
  }
11542
11545
 
11543
- Py_DECREF(result);
11546
+ Py_DECREF_IMMORTAL(result);
11544
11547
  }
11545
11548
  }
11546
11549
 
@@ -11563,11 +11566,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11563
11566
  }
11564
11567
  }
11565
11568
 
11566
- Py_DECREF(result);
11569
+ Py_DECREF_IMMORTAL(result);
11567
11570
  }
11568
11571
 
11569
11572
  if (checked_reverse_op == false) {
11570
- f = RICHCOMPARE(type2);
11573
+ f = TP_RICHCOMPARE(type2);
11571
11574
 
11572
11575
  if (f != NULL) {
11573
11576
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -11586,7 +11589,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11586
11589
  }
11587
11590
  }
11588
11591
 
11589
- Py_DECREF(result);
11592
+ Py_DECREF_IMMORTAL(result);
11590
11593
  }
11591
11594
  }
11592
11595
 
@@ -11624,7 +11627,6 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operan
11624
11627
  return COMPARE_LT_NBOOL_LIST_LIST(operand1, operand2);
11625
11628
  }
11626
11629
 
11627
- #if PYTHON_VERSION < 0x300
11628
11630
  static PyObject *COMPARE_LT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {
11629
11631
  CHECK_OBJECT(operand1);
11630
11632
  assert(PyLong_CheckExact(operand1));
@@ -11643,7 +11645,7 @@ static PyObject *COMPARE_LT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11643
11645
  }
11644
11646
 
11645
11647
  Py_ssize_t operand2_digit_count = 0;
11646
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11648
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11647
11649
  {
11648
11650
  unsigned long t = operand2_abs_ival;
11649
11651
 
@@ -11656,19 +11658,20 @@ static PyObject *COMPARE_LT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11656
11658
  }
11657
11659
  }
11658
11660
 
11659
- Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
11661
+ NUITKA_MAY_BE_UNUSED Py_ssize_t operand2_size =
11662
+ operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
11660
11663
 
11661
11664
  bool r;
11662
11665
 
11663
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11664
- r = Py_SIZE(operand1_long_object) - operand2_size < 0;
11666
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11667
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size < 0;
11665
11668
  } else {
11666
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11669
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11667
11670
  r = false;
11668
11671
  while (--i >= 0) {
11669
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11670
- r = operand1_long_object->ob_digit[i] < operand2_digits[i];
11671
- if (Py_SIZE(operand1_long_object) < 0) {
11672
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11673
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];
11674
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11672
11675
  r = !r;
11673
11676
  }
11674
11677
  break;
@@ -11678,9 +11681,10 @@ static PyObject *COMPARE_LT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11678
11681
 
11679
11682
  // Convert to target type.
11680
11683
  PyObject *result = BOOL_FROM(r);
11681
- Py_INCREF(result);
11684
+ Py_INCREF_IMMORTAL(result);
11682
11685
  return result;
11683
11686
  }
11687
+ #if PYTHON_VERSION < 0x300
11684
11688
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
11685
11689
  PyObject *RICH_COMPARE_LT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
11686
11690
 
@@ -11688,7 +11692,6 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2
11688
11692
  }
11689
11693
  #endif
11690
11694
 
11691
- #if PYTHON_VERSION < 0x300
11692
11695
  static bool COMPARE_LT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11693
11696
  CHECK_OBJECT(operand1);
11694
11697
  assert(PyLong_CheckExact(operand1));
@@ -11707,7 +11710,7 @@ static bool COMPARE_LT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11707
11710
  }
11708
11711
 
11709
11712
  Py_ssize_t operand2_digit_count = 0;
11710
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11713
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11711
11714
  {
11712
11715
  unsigned long t = operand2_abs_ival;
11713
11716
 
@@ -11720,19 +11723,20 @@ static bool COMPARE_LT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11720
11723
  }
11721
11724
  }
11722
11725
 
11723
- Py_ssize_t operand2_size = operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
11726
+ NUITKA_MAY_BE_UNUSED Py_ssize_t operand2_size =
11727
+ operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
11724
11728
 
11725
11729
  bool r;
11726
11730
 
11727
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11728
- r = Py_SIZE(operand1_long_object) - operand2_size < 0;
11731
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11732
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size < 0;
11729
11733
  } else {
11730
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11734
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11731
11735
  r = false;
11732
11736
  while (--i >= 0) {
11733
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11734
- r = operand1_long_object->ob_digit[i] < operand2_digits[i];
11735
- if (Py_SIZE(operand1_long_object) < 0) {
11737
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11738
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];
11739
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11736
11740
  r = !r;
11737
11741
  }
11738
11742
  break;
@@ -11745,6 +11749,7 @@ static bool COMPARE_LT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11745
11749
 
11746
11750
  return result;
11747
11751
  }
11752
+ #if PYTHON_VERSION < 0x300
11748
11753
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
11749
11754
  bool RICH_COMPARE_LT_CBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
11750
11755
 
@@ -11764,9 +11769,11 @@ static PyObject *COMPARE_LT_OBJECT_INT_CLONG(PyObject *operand1, long operand2)
11764
11769
 
11765
11770
  // Convert to target type.
11766
11771
  PyObject *result = BOOL_FROM(r);
11767
- Py_INCREF(result);
11772
+ Py_INCREF_IMMORTAL(result);
11768
11773
  return result;
11769
11774
  }
11775
+ #endif
11776
+ #if PYTHON_VERSION < 0x300
11770
11777
  /* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
11771
11778
  PyObject *RICH_COMPARE_LT_OBJECT_INT_CLONG(PyObject *operand1, long operand2) {
11772
11779
 
@@ -11789,6 +11796,8 @@ static bool COMPARE_LT_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {
11789
11796
 
11790
11797
  return result;
11791
11798
  }
11799
+ #endif
11800
+ #if PYTHON_VERSION < 0x300
11792
11801
  /* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
11793
11802
  bool RICH_COMPARE_LT_CBOOL_INT_CLONG(PyObject *operand1, long operand2) {
11794
11803
 
@@ -11805,15 +11814,18 @@ static PyObject *COMPARE_LT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11805
11814
 
11806
11815
  bool r;
11807
11816
 
11808
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11809
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;
11817
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11818
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11819
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11820
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) <
11821
+ 0;
11810
11822
  } else {
11811
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11823
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11812
11824
  r = false;
11813
11825
  while (--i >= 0) {
11814
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11815
- r = operand1_long_object->ob_digit[i] < (digit)Py_ABS(operand2);
11816
- if (Py_SIZE(operand1_long_object) < 0) {
11826
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11827
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);
11828
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11817
11829
  r = !r;
11818
11830
  }
11819
11831
  break;
@@ -11823,7 +11835,7 @@ static PyObject *COMPARE_LT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11823
11835
 
11824
11836
  // Convert to target type.
11825
11837
  PyObject *result = BOOL_FROM(r);
11826
- Py_INCREF(result);
11838
+ Py_INCREF_IMMORTAL(result);
11827
11839
  return result;
11828
11840
  }
11829
11841
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "DIGIT" to C platform digit value for long
@@ -11842,15 +11854,18 @@ static bool COMPARE_LT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {
11842
11854
 
11843
11855
  bool r;
11844
11856
 
11845
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11846
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;
11857
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11858
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11859
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11860
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) <
11861
+ 0;
11847
11862
  } else {
11848
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11863
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11849
11864
  r = false;
11850
11865
  while (--i >= 0) {
11851
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11852
- r = operand1_long_object->ob_digit[i] < (digit)Py_ABS(operand2);
11853
- if (Py_SIZE(operand1_long_object) < 0) {
11866
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11867
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);
11868
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11854
11869
  r = !r;
11855
11870
  }
11856
11871
  break;
@@ -11881,7 +11896,7 @@ static PyObject *COMPARE_LT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double opera
11881
11896
 
11882
11897
  // Convert to target type.
11883
11898
  PyObject *result = BOOL_FROM(r);
11884
- Py_INCREF(result);
11899
+ Py_INCREF_IMMORTAL(result);
11885
11900
  return result;
11886
11901
  }
11887
11902
  /* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
@@ -11909,3 +11924,18 @@ bool RICH_COMPARE_LT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
11909
11924
 
11910
11925
  return COMPARE_LT_CBOOL_FLOAT_CFLOAT(operand1, operand2);
11911
11926
  }
11927
+
11928
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
11929
+ // integrates with CPython, but also works on its own.
11930
+ //
11931
+ // Licensed under the Apache License, Version 2.0 (the "License");
11932
+ // you may not use this file except in compliance with the License.
11933
+ // You may obtain a copy of the License at
11934
+ //
11935
+ // http://www.apache.org/licenses/LICENSE-2.0
11936
+ //
11937
+ // Unless required by applicable law or agreed to in writing, software
11938
+ // distributed under the License is distributed on an "AS IS" BASIS,
11939
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11940
+ // See the License for the specific language governing permissions and
11941
+ // limitations under the License.