Nuitka-winsvc 1.8__cp311-cp311-win_amd64.whl → 2.4.8__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (704) hide show
  1. Nuitka_winsvc-1.8.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.8.data/scripts/nuitka-run.cmd +9 -9
  2. Nuitka_winsvc-1.8.data/scripts/nuitka.bat → Nuitka_winsvc-2.4.8.data/scripts/nuitka.cmd +15 -15
  3. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/METADATA +4 -3
  4. Nuitka_winsvc-2.4.8.dist-info/RECORD +954 -0
  5. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/WHEEL +1 -1
  6. nuitka/Builtins.py +18 -17
  7. nuitka/BytecodeCaching.py +24 -20
  8. nuitka/Bytecodes.py +23 -19
  9. nuitka/CacheCleanup.py +28 -23
  10. nuitka/Constants.py +19 -17
  11. nuitka/Errors.py +23 -17
  12. nuitka/HardImportRegistry.py +400 -0
  13. nuitka/MainControl.py +200 -112
  14. nuitka/ModuleRegistry.py +83 -20
  15. nuitka/OptionParsing.py +368 -175
  16. nuitka/Options.py +632 -213
  17. nuitka/OutputDirectories.py +40 -21
  18. nuitka/PostProcessing.py +73 -50
  19. nuitka/Progress.py +58 -24
  20. nuitka/PythonFlavors.py +141 -32
  21. nuitka/PythonOperators.py +18 -17
  22. nuitka/PythonVersions.py +106 -19
  23. nuitka/Serialization.py +68 -55
  24. nuitka/SourceCodeReferences.py +19 -17
  25. nuitka/Tracing.py +108 -70
  26. nuitka/TreeXML.py +31 -26
  27. nuitka/Variables.py +39 -41
  28. nuitka/Version.py +21 -7
  29. nuitka/__init__.py +5 -4
  30. nuitka/__main__.py +95 -29
  31. nuitka/__past__.py +44 -34
  32. nuitka/build/Backend.scons +202 -140
  33. nuitka/build/CCompilerVersion.scons +39 -31
  34. nuitka/build/DataComposerInterface.py +20 -17
  35. nuitka/build/Onefile.scons +50 -54
  36. nuitka/build/SconsCaching.py +93 -90
  37. nuitka/build/SconsCompilerSettings.py +157 -69
  38. nuitka/build/SconsHacks.py +25 -19
  39. nuitka/build/SconsInterface.py +154 -54
  40. nuitka/build/SconsProgress.py +19 -18
  41. nuitka/build/SconsSpawn.py +62 -33
  42. nuitka/build/SconsUtils.py +147 -55
  43. nuitka/build/__init__.py +5 -4
  44. nuitka/build/include/nuitka/allocator.h +105 -22
  45. nuitka/build/include/nuitka/builtins.h +17 -17
  46. nuitka/build/include/nuitka/calling.h +18 -18
  47. nuitka/build/include/nuitka/checkers.h +17 -18
  48. nuitka/build/include/nuitka/checksum_tools.h +14 -19
  49. nuitka/build/include/nuitka/compiled_asyncgen.h +18 -18
  50. nuitka/build/include/nuitka/compiled_cell.h +33 -18
  51. nuitka/build/include/nuitka/compiled_coroutine.h +18 -18
  52. nuitka/build/include/nuitka/compiled_frame.h +91 -53
  53. nuitka/build/include/nuitka/compiled_function.h +42 -20
  54. nuitka/build/include/nuitka/compiled_generator.h +24 -18
  55. nuitka/build/include/nuitka/compiled_method.h +17 -18
  56. nuitka/build/include/nuitka/constants.h +29 -18
  57. nuitka/build/include/nuitka/constants_blob.h +17 -17
  58. nuitka/build/include/nuitka/environment_variables.h +30 -0
  59. nuitka/build/include/nuitka/environment_variables_system.h +45 -0
  60. nuitka/build/include/nuitka/exception_groups.h +23 -26
  61. nuitka/build/include/nuitka/exceptions.h +593 -190
  62. nuitka/build/include/nuitka/filesystem_paths.h +26 -20
  63. nuitka/build/include/nuitka/freelists.h +38 -18
  64. nuitka/build/include/nuitka/helper/attributes.h +24 -18
  65. nuitka/build/include/nuitka/helper/boolean.h +17 -17
  66. nuitka/build/include/nuitka/helper/bytearrays.h +17 -17
  67. nuitka/build/include/nuitka/helper/bytes.h +14 -15
  68. nuitka/build/include/nuitka/helper/calling_generated.h +17 -17
  69. nuitka/build/include/nuitka/helper/comparisons_eq.h +17 -17
  70. nuitka/build/include/nuitka/helper/comparisons_ge.h +17 -17
  71. nuitka/build/include/nuitka/helper/comparisons_gt.h +17 -17
  72. nuitka/build/include/nuitka/helper/comparisons_le.h +17 -17
  73. nuitka/build/include/nuitka/helper/comparisons_lt.h +17 -17
  74. nuitka/build/include/nuitka/helper/comparisons_ne.h +17 -17
  75. nuitka/build/include/nuitka/helper/complex.h +17 -17
  76. nuitka/build/include/nuitka/helper/dictionaries.h +24 -22
  77. nuitka/build/include/nuitka/helper/floats.h +17 -18
  78. nuitka/build/include/nuitka/helper/import_hard.h +25 -17
  79. nuitka/build/include/nuitka/helper/indexes.h +17 -18
  80. nuitka/build/include/nuitka/helper/ints.h +32 -20
  81. nuitka/build/include/nuitka/helper/iterators.h +17 -17
  82. nuitka/build/include/nuitka/helper/lists.h +26 -24
  83. nuitka/build/include/nuitka/helper/lists_generated.h +22 -22
  84. nuitka/build/include/nuitka/helper/mappings.h +17 -18
  85. nuitka/build/include/nuitka/helper/operations.h +17 -17
  86. nuitka/build/include/nuitka/helper/operations_binary_add.h +17 -17
  87. nuitka/build/include/nuitka/helper/operations_binary_bitand.h +17 -17
  88. nuitka/build/include/nuitka/helper/operations_binary_bitor.h +17 -17
  89. nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +17 -17
  90. nuitka/build/include/nuitka/helper/operations_binary_divmod.h +17 -17
  91. nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +17 -17
  92. nuitka/build/include/nuitka/helper/operations_binary_lshift.h +17 -17
  93. nuitka/build/include/nuitka/helper/operations_binary_matmult.h +17 -17
  94. nuitka/build/include/nuitka/helper/operations_binary_mod.h +17 -17
  95. nuitka/build/include/nuitka/helper/operations_binary_mult.h +17 -17
  96. nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +17 -17
  97. nuitka/build/include/nuitka/helper/operations_binary_pow.h +17 -17
  98. nuitka/build/include/nuitka/helper/operations_binary_rshift.h +17 -17
  99. nuitka/build/include/nuitka/helper/operations_binary_sub.h +17 -17
  100. nuitka/build/include/nuitka/helper/operations_binary_truediv.h +17 -17
  101. nuitka/build/include/nuitka/helper/operations_builtin_types.h +17 -17
  102. nuitka/build/include/nuitka/helper/operations_inplace_add.h +17 -17
  103. nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +17 -17
  104. nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +17 -17
  105. nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +17 -17
  106. nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +17 -17
  107. nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +17 -17
  108. nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +17 -17
  109. nuitka/build/include/nuitka/helper/operations_inplace_mod.h +17 -17
  110. nuitka/build/include/nuitka/helper/operations_inplace_mult.h +17 -17
  111. nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +17 -17
  112. nuitka/build/include/nuitka/helper/operations_inplace_pow.h +17 -17
  113. nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +17 -17
  114. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +17 -17
  115. nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +17 -17
  116. nuitka/build/include/nuitka/helper/raising.h +29 -17
  117. nuitka/build/include/nuitka/helper/rangeobjects.h +17 -17
  118. nuitka/build/include/nuitka/helper/richcomparisons.h +14 -14
  119. nuitka/build/include/nuitka/helper/sequences.h +19 -13
  120. nuitka/build/include/nuitka/helper/sets.h +11 -12
  121. nuitka/build/include/nuitka/helper/slices.h +31 -25
  122. nuitka/build/include/nuitka/helper/strings.h +16 -17
  123. nuitka/build/include/nuitka/helper/subscripts.h +18 -201
  124. nuitka/build/include/nuitka/helper/tuples.h +64 -52
  125. nuitka/build/include/nuitka/helpers.h +38 -20
  126. nuitka/build/include/nuitka/importing.h +28 -21
  127. nuitka/build/include/nuitka/jit_sources.h +25 -0
  128. nuitka/build/include/nuitka/prelude.h +128 -46
  129. nuitka/build/include/nuitka/printing.h +22 -17
  130. nuitka/build/include/nuitka/python_pgo.h +19 -18
  131. nuitka/build/include/nuitka/safe_string_ops.h +20 -18
  132. nuitka/build/include/nuitka/threading.h +32 -33
  133. nuitka/build/include/nuitka/tracing.h +28 -18
  134. nuitka/build/include/nuitka/type_aliases.h +27 -0
  135. nuitka/build/include/nuitka/unfreezing.h +29 -23
  136. nuitka/build/inline_copy/bin/scons.py +14 -0
  137. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +6 -6
  138. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
  139. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  140. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  141. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  142. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  143. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  144. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  145. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  146. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  147. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  148. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  149. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  150. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  151. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  152. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  153. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  154. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  155. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  156. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  157. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  158. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  159. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  160. nuitka/build/inline_copy/tqdm/tqdm/__init__.py +2 -2
  161. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  162. nuitka/build/inline_copy/tqdm/tqdm/utils.py +14 -8
  163. nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -8
  164. nuitka/build/inline_copy/zlib/LICENSE +22 -0
  165. nuitka/build/inline_copy/zlib/crc32.c +1049 -0
  166. nuitka/build/inline_copy/zlib/crc32.h +9446 -0
  167. nuitka/build/inline_copy/zlib/zconf.h +551 -0
  168. nuitka/build/inline_copy/zlib/zlib.h +1938 -0
  169. nuitka/build/inline_copy/zlib/zutil.h +275 -0
  170. nuitka/build/static_src/CompiledAsyncgenType.c +176 -182
  171. nuitka/build/static_src/CompiledCellType.c +63 -40
  172. nuitka/build/static_src/CompiledCodeHelpers.c +181 -128
  173. nuitka/build/static_src/CompiledCoroutineType.c +196 -203
  174. nuitka/build/static_src/CompiledFrameType.c +287 -133
  175. nuitka/build/static_src/CompiledFunctionType.c +389 -95
  176. nuitka/build/static_src/CompiledGeneratorType.c +376 -252
  177. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +185 -198
  178. nuitka/build/static_src/CompiledMethodType.c +83 -71
  179. nuitka/build/static_src/HelpersAllocator.c +88 -19
  180. nuitka/build/static_src/HelpersAttributes.c +33 -54
  181. nuitka/build/static_src/HelpersBuiltin.c +43 -33
  182. nuitka/build/static_src/HelpersBuiltinTypeMethods.c +17 -17
  183. nuitka/build/static_src/HelpersBytes.c +19 -20
  184. nuitka/build/static_src/HelpersCalling.c +33 -30
  185. nuitka/build/static_src/HelpersCallingGenerated.c +1000 -181
  186. nuitka/build/static_src/HelpersChecksumTools.c +35 -21
  187. nuitka/build/static_src/HelpersClasses.c +17 -17
  188. nuitka/build/static_src/HelpersComparisonEq.c +518 -492
  189. nuitka/build/static_src/HelpersComparisonEqUtils.c +21 -19
  190. nuitka/build/static_src/HelpersComparisonGe.c +513 -497
  191. nuitka/build/static_src/HelpersComparisonGt.c +512 -496
  192. nuitka/build/static_src/HelpersComparisonLe.c +513 -497
  193. nuitka/build/static_src/HelpersComparisonLt.c +512 -496
  194. nuitka/build/static_src/HelpersComparisonNe.c +520 -492
  195. nuitka/build/static_src/HelpersConsole.c +96 -0
  196. nuitka/build/static_src/HelpersConstantsBlob.c +542 -519
  197. nuitka/build/static_src/HelpersDeepcopy.c +33 -33
  198. nuitka/build/static_src/HelpersDictionaries.c +51 -29
  199. nuitka/build/static_src/HelpersDictionariesGenerated.c +177 -68
  200. nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
  201. nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
  202. nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +93 -0
  203. nuitka/build/static_src/HelpersExceptions.c +161 -50
  204. nuitka/build/static_src/HelpersFiles.c +37 -17
  205. nuitka/build/static_src/HelpersFilesystemPaths.c +292 -181
  206. nuitka/build/static_src/HelpersFloats.c +37 -31
  207. nuitka/build/static_src/HelpersHeapStorage.c +21 -17
  208. nuitka/build/static_src/HelpersImport.c +48 -20
  209. nuitka/build/static_src/HelpersImportHard.c +53 -17
  210. nuitka/build/static_src/HelpersJitSources.c +46 -0
  211. nuitka/build/static_src/HelpersLists.c +140 -50
  212. nuitka/build/static_src/HelpersListsGenerated.c +41 -41
  213. nuitka/build/static_src/HelpersMappings.c +17 -17
  214. nuitka/build/static_src/HelpersMatching.c +137 -51
  215. nuitka/build/static_src/HelpersOperationBinaryAdd.c +173 -146
  216. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +99 -52
  217. nuitka/build/static_src/HelpersOperationBinaryBitand.c +50 -50
  218. nuitka/build/static_src/HelpersOperationBinaryBitor.c +50 -50
  219. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +50 -50
  220. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +41 -41
  221. nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +17 -17
  222. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +41 -41
  223. nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +20 -21
  224. nuitka/build/static_src/HelpersOperationBinaryLshift.c +47 -47
  225. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +24 -24
  226. nuitka/build/static_src/HelpersOperationBinaryMod.c +107 -107
  227. nuitka/build/static_src/HelpersOperationBinaryMult.c +81 -75
  228. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +33 -30
  229. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +41 -41
  230. nuitka/build/static_src/HelpersOperationBinaryPow.c +44 -44
  231. nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +12 -12
  232. nuitka/build/static_src/HelpersOperationBinaryRshift.c +47 -47
  233. nuitka/build/static_src/HelpersOperationBinarySub.c +80 -80
  234. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +41 -41
  235. nuitka/build/static_src/HelpersOperationInplaceAdd.c +171 -153
  236. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +24 -22
  237. nuitka/build/static_src/HelpersOperationInplaceBitand.c +53 -53
  238. nuitka/build/static_src/HelpersOperationInplaceBitor.c +53 -53
  239. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +53 -53
  240. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +62 -62
  241. nuitka/build/static_src/HelpersOperationInplaceLshift.c +44 -44
  242. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +37 -37
  243. nuitka/build/static_src/HelpersOperationInplaceMod.c +134 -134
  244. nuitka/build/static_src/HelpersOperationInplaceMult.c +78 -78
  245. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +62 -62
  246. nuitka/build/static_src/HelpersOperationInplacePow.c +62 -62
  247. nuitka/build/static_src/HelpersOperationInplaceRshift.c +44 -44
  248. nuitka/build/static_src/HelpersOperationInplaceSub.c +112 -112
  249. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +62 -62
  250. nuitka/build/static_src/HelpersProfiling.c +24 -23
  251. nuitka/build/static_src/HelpersPythonPgo.c +22 -22
  252. nuitka/build/static_src/HelpersRaising.c +88 -20
  253. nuitka/build/static_src/HelpersSafeStrings.c +34 -22
  254. nuitka/build/static_src/HelpersSequences.c +18 -19
  255. nuitka/build/static_src/HelpersSlices.c +29 -23
  256. nuitka/build/static_src/HelpersStrings.c +234 -37
  257. nuitka/build/static_src/HelpersTuples.c +46 -34
  258. nuitka/build/static_src/HelpersTypes.c +68 -23
  259. nuitka/build/static_src/InspectPatcher.c +108 -27
  260. nuitka/build/static_src/MainProgram.c +359 -263
  261. nuitka/build/static_src/MetaPathBasedLoader.c +367 -242
  262. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +39 -26
  263. nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +17 -18
  264. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +97 -22
  265. nuitka/build/static_src/OnefileBootstrap.c +276 -164
  266. nuitka/build/static_src/OnefileSplashScreen.cpp +51 -27
  267. nuitka/code_generation/AsyncgenCodes.py +19 -17
  268. nuitka/code_generation/AttributeCodes.py +31 -27
  269. nuitka/code_generation/BinaryOperationHelperDefinitions.py +24 -20
  270. nuitka/code_generation/BranchCodes.py +19 -17
  271. nuitka/code_generation/BuiltinCodes.py +20 -17
  272. nuitka/code_generation/CallCodes.py +19 -17
  273. nuitka/code_generation/ClassCodes.py +19 -17
  274. nuitka/code_generation/CodeGeneration.py +48 -27
  275. nuitka/code_generation/CodeHelperSelection.py +19 -17
  276. nuitka/code_generation/CodeHelpers.py +24 -20
  277. nuitka/code_generation/CodeObjectCodes.py +34 -24
  278. nuitka/code_generation/ComparisonCodes.py +38 -20
  279. nuitka/code_generation/ComparisonHelperDefinitions.py +19 -17
  280. nuitka/code_generation/ConditionalCodes.py +19 -17
  281. nuitka/code_generation/ConstantCodes.py +82 -28
  282. nuitka/code_generation/Contexts.py +152 -26
  283. nuitka/code_generation/CoroutineCodes.py +19 -17
  284. nuitka/code_generation/CtypesCodes.py +19 -17
  285. nuitka/code_generation/DictCodes.py +25 -23
  286. nuitka/code_generation/Emission.py +21 -18
  287. nuitka/code_generation/ErrorCodes.py +27 -33
  288. nuitka/code_generation/EvalCodes.py +24 -20
  289. nuitka/code_generation/ExceptionCodes.py +27 -18
  290. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +20 -17
  291. nuitka/code_generation/ExpressionCodes.py +19 -17
  292. nuitka/code_generation/FrameCodes.py +24 -20
  293. nuitka/code_generation/FunctionCodes.py +24 -21
  294. nuitka/code_generation/GeneratorCodes.py +23 -20
  295. nuitka/code_generation/GlobalConstants.py +43 -23
  296. nuitka/code_generation/GlobalsLocalsCodes.py +21 -19
  297. nuitka/code_generation/IdCodes.py +19 -17
  298. nuitka/code_generation/ImportCodes.py +90 -50
  299. nuitka/code_generation/Indentation.py +23 -22
  300. nuitka/code_generation/IndexCodes.py +19 -17
  301. nuitka/code_generation/InjectCCodes.py +14 -12
  302. nuitka/code_generation/IntegerCodes.py +19 -17
  303. nuitka/code_generation/IteratorCodes.py +19 -17
  304. nuitka/code_generation/JitCodes.py +44 -0
  305. nuitka/code_generation/LabelCodes.py +19 -17
  306. nuitka/code_generation/LineNumberCodes.py +19 -17
  307. nuitka/code_generation/ListCodes.py +32 -36
  308. nuitka/code_generation/LoaderCodes.py +22 -17
  309. nuitka/code_generation/LocalsDictCodes.py +56 -32
  310. nuitka/code_generation/LoopCodes.py +19 -17
  311. nuitka/code_generation/MatchCodes.py +42 -22
  312. nuitka/code_generation/ModuleCodes.py +43 -25
  313. nuitka/code_generation/Namify.py +27 -23
  314. nuitka/code_generation/NetworkxCodes.py +51 -0
  315. nuitka/code_generation/OperationCodes.py +29 -31
  316. nuitka/code_generation/PackageResourceCodes.py +59 -23
  317. nuitka/code_generation/PrintCodes.py +19 -17
  318. nuitka/code_generation/PythonAPICodes.py +19 -17
  319. nuitka/code_generation/RaisingCodes.py +19 -17
  320. nuitka/code_generation/Reports.py +19 -17
  321. nuitka/code_generation/ReturnCodes.py +19 -17
  322. nuitka/code_generation/SetCodes.py +19 -17
  323. nuitka/code_generation/SliceCodes.py +22 -20
  324. nuitka/code_generation/StringCodes.py +19 -17
  325. nuitka/code_generation/SubscriptCodes.py +24 -30
  326. nuitka/code_generation/TensorflowCodes.py +54 -0
  327. nuitka/code_generation/TryCodes.py +19 -17
  328. nuitka/code_generation/TupleCodes.py +20 -18
  329. nuitka/code_generation/TypeAliasCodes.py +71 -0
  330. nuitka/code_generation/VariableCodes.py +26 -22
  331. nuitka/code_generation/VariableDeclarations.py +20 -17
  332. nuitka/code_generation/YieldCodes.py +22 -20
  333. nuitka/code_generation/__init__.py +5 -4
  334. nuitka/code_generation/c_types/CTypeBases.py +19 -17
  335. nuitka/code_generation/c_types/CTypeBooleans.py +19 -17
  336. nuitka/code_generation/c_types/CTypeCFloats.py +19 -17
  337. nuitka/code_generation/c_types/CTypeCLongs.py +19 -18
  338. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +19 -17
  339. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +19 -17
  340. nuitka/code_generation/c_types/CTypeNuitkaInts.py +19 -18
  341. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +19 -17
  342. nuitka/code_generation/c_types/CTypePyObjectPointers.py +27 -25
  343. nuitka/code_generation/c_types/CTypeVoids.py +20 -17
  344. nuitka/code_generation/c_types/__init__.py +5 -4
  345. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +18 -17
  346. nuitka/code_generation/templates/CodeTemplatesConstants.py +132 -36
  347. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +18 -17
  348. nuitka/code_generation/templates/CodeTemplatesExceptions.py +19 -18
  349. nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -17
  350. nuitka/code_generation/templates/CodeTemplatesFunction.py +18 -17
  351. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +19 -17
  352. nuitka/code_generation/templates/CodeTemplatesIterators.py +18 -18
  353. nuitka/code_generation/templates/CodeTemplatesLoader.py +25 -19
  354. nuitka/code_generation/templates/CodeTemplatesModules.py +244 -165
  355. nuitka/code_generation/templates/CodeTemplatesVariables.py +42 -27
  356. nuitka/code_generation/templates/TemplateDebugWrapper.py +19 -18
  357. nuitka/code_generation/templates/__init__.py +5 -4
  358. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +19 -19
  359. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +18 -18
  360. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +76 -25
  361. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +22 -22
  362. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +19 -19
  363. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +19 -19
  364. nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +17 -17
  365. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +121 -48
  366. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +18 -18
  367. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +18 -18
  368. nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +6 -6
  369. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +23 -23
  370. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +35 -35
  371. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +28 -28
  372. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +17 -17
  373. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +18 -18
  374. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +44 -32
  375. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +20 -20
  376. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +28 -28
  377. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +24 -24
  378. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +33 -29
  379. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +20 -20
  380. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +27 -27
  381. nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +17 -17
  382. nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +17 -17
  383. nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +17 -17
  384. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +17 -17
  385. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +21 -18
  386. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +26 -24
  387. nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +17 -17
  388. nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +17 -17
  389. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +21 -18
  390. nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +17 -17
  391. nuitka/containers/Namedtuples.py +19 -18
  392. nuitka/containers/OrderedSetsFallback.py +19 -17
  393. nuitka/containers/__init__.py +5 -4
  394. nuitka/distutils/Build.py +19 -18
  395. nuitka/distutils/DistutilCommands.py +34 -23
  396. nuitka/distutils/__init__.py +5 -4
  397. nuitka/finalizations/Finalization.py +20 -17
  398. nuitka/finalizations/FinalizeMarkups.py +21 -41
  399. nuitka/finalizations/__init__.py +5 -4
  400. nuitka/freezer/DependsExe.py +48 -28
  401. nuitka/freezer/DllDependenciesCommon.py +47 -20
  402. nuitka/freezer/DllDependenciesMacOS.py +147 -57
  403. nuitka/freezer/DllDependenciesPosix.py +29 -19
  404. nuitka/freezer/DllDependenciesWin32.py +29 -21
  405. nuitka/freezer/ImportDetection.py +20 -17
  406. nuitka/freezer/IncludedDataFiles.py +118 -47
  407. nuitka/freezer/IncludedEntryPoints.py +102 -38
  408. nuitka/freezer/Onefile.py +32 -22
  409. nuitka/freezer/Standalone.py +105 -50
  410. nuitka/freezer/__init__.py +5 -4
  411. nuitka/importing/IgnoreListing.py +19 -17
  412. nuitka/importing/ImportCache.py +24 -21
  413. nuitka/importing/ImportResolving.py +103 -95
  414. nuitka/importing/Importing.py +286 -92
  415. nuitka/importing/PreloadedPackages.py +21 -18
  416. nuitka/importing/Recursion.py +131 -47
  417. nuitka/importing/StandardLibrary.py +46 -28
  418. nuitka/importing/__init__.py +5 -4
  419. nuitka/nodes/AsyncgenNodes.py +19 -17
  420. nuitka/nodes/AttributeLookupNodes.py +19 -17
  421. nuitka/nodes/AttributeNodes.py +19 -17
  422. nuitka/nodes/AttributeNodesGenerated.py +49 -24
  423. nuitka/nodes/BuiltinAllNodes.py +19 -17
  424. nuitka/nodes/BuiltinAnyNodes.py +19 -17
  425. nuitka/nodes/BuiltinComplexNodes.py +20 -17
  426. nuitka/nodes/BuiltinDecodingNodes.py +19 -17
  427. nuitka/nodes/BuiltinDecoratorNodes.py +19 -17
  428. nuitka/nodes/BuiltinDictNodes.py +19 -17
  429. nuitka/nodes/BuiltinFormatNodes.py +20 -17
  430. nuitka/nodes/BuiltinHashNodes.py +19 -17
  431. nuitka/nodes/BuiltinInputNodes.py +19 -17
  432. nuitka/nodes/BuiltinIntegerNodes.py +19 -17
  433. nuitka/nodes/BuiltinIteratorNodes.py +24 -20
  434. nuitka/nodes/BuiltinLenNodes.py +19 -17
  435. nuitka/nodes/BuiltinNextNodes.py +19 -17
  436. nuitka/nodes/BuiltinOpenNodes.py +52 -18
  437. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +40 -23
  438. nuitka/nodes/BuiltinRangeNodes.py +21 -19
  439. nuitka/nodes/BuiltinRefNodes.py +68 -19
  440. nuitka/nodes/BuiltinSumNodes.py +20 -18
  441. nuitka/nodes/BuiltinTypeNodes.py +19 -17
  442. nuitka/nodes/BuiltinVarsNodes.py +19 -18
  443. nuitka/nodes/BytesNodes.py +19 -17
  444. nuitka/nodes/CallNodes.py +19 -17
  445. nuitka/nodes/Checkers.py +19 -17
  446. nuitka/nodes/ChildrenHavingMixins.py +1250 -302
  447. nuitka/nodes/ClassNodes.py +49 -29
  448. nuitka/nodes/CodeObjectSpecs.py +29 -18
  449. nuitka/nodes/ComparisonNodes.py +19 -17
  450. nuitka/nodes/ConditionalNodes.py +21 -23
  451. nuitka/nodes/ConstantRefNodes.py +57 -17
  452. nuitka/nodes/ContainerMakingNodes.py +19 -17
  453. nuitka/nodes/ContainerOperationNodes.py +19 -17
  454. nuitka/nodes/CoroutineNodes.py +19 -17
  455. nuitka/nodes/CtypesNodes.py +19 -18
  456. nuitka/nodes/DictionaryNodes.py +19 -18
  457. nuitka/nodes/ExceptionNodes.py +29 -17
  458. nuitka/nodes/ExecEvalNodes.py +19 -17
  459. nuitka/nodes/ExpressionBases.py +34 -26
  460. nuitka/nodes/ExpressionBasesGenerated.py +54 -32
  461. nuitka/nodes/ExpressionShapeMixins.py +19 -17
  462. nuitka/nodes/FrameNodes.py +19 -17
  463. nuitka/nodes/FunctionAttributeNodes.py +19 -17
  464. nuitka/nodes/FunctionNodes.py +81 -35
  465. nuitka/nodes/FutureSpecs.py +35 -20
  466. nuitka/nodes/GeneratorNodes.py +21 -19
  467. nuitka/nodes/GlobalsLocalsNodes.py +22 -17
  468. nuitka/nodes/HardImportNodesGenerated.py +545 -129
  469. nuitka/nodes/ImportHardNodes.py +46 -38
  470. nuitka/nodes/ImportNodes.py +436 -446
  471. nuitka/nodes/IndicatorMixins.py +19 -17
  472. nuitka/nodes/InjectCNodes.py +19 -18
  473. nuitka/nodes/IterationHandles.py +55 -34
  474. nuitka/nodes/KeyValuePairNodes.py +19 -17
  475. nuitka/nodes/ListOperationNodes.py +33 -21
  476. nuitka/nodes/LocalsDictNodes.py +19 -17
  477. nuitka/nodes/LocalsScopes.py +41 -41
  478. nuitka/nodes/LoopNodes.py +28 -17
  479. nuitka/nodes/MatchNodes.py +37 -24
  480. nuitka/nodes/ModuleAttributeNodes.py +18 -35
  481. nuitka/nodes/ModuleNodes.py +90 -31
  482. nuitka/nodes/NetworkxNodes.py +45 -0
  483. nuitka/nodes/NodeBases.py +45 -43
  484. nuitka/nodes/NodeMakingHelpers.py +21 -19
  485. nuitka/nodes/NodeMetaClasses.py +45 -28
  486. nuitka/nodes/OperatorNodes.py +28 -26
  487. nuitka/nodes/OperatorNodesUnary.py +20 -17
  488. nuitka/nodes/OsSysNodes.py +66 -18
  489. nuitka/nodes/OutlineNodes.py +22 -20
  490. nuitka/nodes/PackageMetadataNodes.py +37 -27
  491. nuitka/nodes/PackageResourceNodes.py +29 -23
  492. nuitka/nodes/PrintNodes.py +19 -17
  493. nuitka/nodes/ReturnNodes.py +20 -18
  494. nuitka/nodes/SideEffectNodes.py +19 -17
  495. nuitka/nodes/SliceNodes.py +20 -18
  496. nuitka/nodes/StatementBasesGenerated.py +125 -77
  497. nuitka/nodes/StatementNodes.py +19 -17
  498. nuitka/nodes/StrNodes.py +19 -17
  499. nuitka/nodes/StringConcatenationNodes.py +20 -17
  500. nuitka/nodes/SubscriptNodes.py +26 -24
  501. nuitka/nodes/TensorflowNodes.py +38 -0
  502. nuitka/nodes/TryNodes.py +19 -17
  503. nuitka/nodes/TypeMatchNodes.py +19 -17
  504. nuitka/nodes/TypeNodes.py +40 -17
  505. nuitka/nodes/VariableAssignNodes.py +122 -64
  506. nuitka/nodes/VariableDelNodes.py +19 -17
  507. nuitka/nodes/VariableNameNodes.py +19 -17
  508. nuitka/nodes/VariableRefNodes.py +63 -26
  509. nuitka/nodes/VariableReleaseNodes.py +19 -17
  510. nuitka/nodes/YieldNodes.py +21 -19
  511. nuitka/nodes/__init__.py +5 -4
  512. nuitka/nodes/shapes/BuiltinTypeShapes.py +145 -39
  513. nuitka/nodes/shapes/ControlFlowDescriptions.py +19 -17
  514. nuitka/nodes/shapes/ShapeMixins.py +40 -17
  515. nuitka/nodes/shapes/StandardShapes.py +27 -20
  516. nuitka/nodes/shapes/__init__.py +5 -4
  517. nuitka/optimizations/BytecodeDemotion.py +19 -17
  518. nuitka/optimizations/FunctionInlining.py +22 -23
  519. nuitka/optimizations/Graphs.py +19 -17
  520. nuitka/optimizations/Optimization.py +39 -35
  521. nuitka/optimizations/OptimizeBuiltinCalls.py +31 -27
  522. nuitka/optimizations/Tags.py +19 -18
  523. nuitka/optimizations/TraceCollections.py +67 -24
  524. nuitka/optimizations/ValueTraces.py +92 -25
  525. nuitka/optimizations/__init__.py +5 -4
  526. nuitka/pgo/PGO.py +33 -23
  527. nuitka/pgo/__init__.py +5 -4
  528. nuitka/plugins/PluginBase.py +610 -109
  529. nuitka/plugins/Plugins.py +241 -58
  530. nuitka/plugins/YamlPluginBase.py +121 -0
  531. nuitka/plugins/__init__.py +5 -4
  532. nuitka/plugins/standard/AntiBloatPlugin.py +357 -129
  533. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +20 -19
  534. nuitka/plugins/standard/DataFilesPlugin.py +65 -29
  535. nuitka/plugins/standard/DelvewheelPlugin.py +32 -24
  536. nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
  537. nuitka/plugins/standard/DillPlugin/dill-postLoad.py +256 -0
  538. nuitka/plugins/standard/DillPlugin.py +42 -134
  539. nuitka/plugins/standard/DllFilesPlugin.py +125 -42
  540. nuitka/plugins/standard/EnumPlugin.py +19 -17
  541. nuitka/plugins/standard/EventletPlugin.py +19 -17
  542. nuitka/plugins/standard/GeventPlugin.py +19 -17
  543. nuitka/plugins/standard/GiPlugin.py +44 -28
  544. nuitka/plugins/standard/GlfwPlugin.py +20 -17
  545. nuitka/plugins/standard/ImplicitImports.py +407 -46
  546. nuitka/plugins/standard/KivyPlugin.py +30 -17
  547. nuitka/plugins/standard/MatplotlibPlugin.py +88 -42
  548. nuitka/plugins/standard/MultiprocessingPlugin.py +25 -20
  549. nuitka/plugins/standard/NumpyPlugin.py +19 -17
  550. nuitka/plugins/standard/OptionsNannyPlugin.py +48 -76
  551. nuitka/plugins/standard/PbrPlugin.py +21 -19
  552. nuitka/plugins/standard/PkgResourcesPlugin.py +34 -23
  553. nuitka/plugins/standard/PmwPlugin.py +30 -27
  554. nuitka/plugins/standard/PySidePyQtPlugin.py +74 -80
  555. nuitka/plugins/standard/PywebViewPlugin.py +19 -17
  556. nuitka/plugins/standard/SpacyPlugin.py +136 -0
  557. nuitka/plugins/standard/TensorflowPlugin.py +20 -17
  558. nuitka/plugins/standard/TkinterPlugin.py +103 -53
  559. nuitka/plugins/standard/TorchPlugin.py +20 -17
  560. nuitka/plugins/standard/TransformersPlugin.py +94 -30
  561. nuitka/plugins/standard/TrioPlugin.py +18 -15
  562. nuitka/plugins/standard/UpxPlugin.py +21 -19
  563. nuitka/plugins/standard/__init__.py +5 -4
  564. nuitka/plugins/standard/standard.nuitka-package.config.yml +3449 -1299
  565. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +14 -14
  566. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +121 -66
  567. nuitka/reports/CompilationReportReader.py +67 -0
  568. nuitka/reports/LicenseReport.rst.j2 +21 -21
  569. nuitka/reports/Reports.py +352 -76
  570. nuitka/reports/__init__.py +5 -4
  571. nuitka/specs/BuiltinBytesOperationSpecs.py +18 -17
  572. nuitka/specs/BuiltinDictOperationSpecs.py +18 -17
  573. nuitka/specs/BuiltinListOperationSpecs.py +18 -17
  574. nuitka/specs/BuiltinParameterSpecs.py +30 -20
  575. nuitka/specs/BuiltinStrOperationSpecs.py +19 -18
  576. nuitka/specs/BuiltinTypeOperationSpecs.py +18 -18
  577. nuitka/specs/BuiltinUnicodeOperationSpecs.py +18 -17
  578. nuitka/specs/HardImportSpecs.py +67 -22
  579. nuitka/specs/ParameterSpecs.py +56 -41
  580. nuitka/specs/__init__.py +5 -4
  581. nuitka/tools/Basics.py +20 -18
  582. nuitka/tools/__init__.py +5 -4
  583. nuitka/tools/commercial/__init__.py +7 -6
  584. nuitka/tools/data_composer/DataComposer.py +78 -62
  585. nuitka/tools/data_composer/__init__.py +5 -4
  586. nuitka/tools/data_composer/__main__.py +18 -17
  587. nuitka/tools/environments/CreateEnvironment.py +20 -17
  588. nuitka/tools/environments/Virtualenv.py +60 -32
  589. nuitka/tools/environments/__init__.py +5 -4
  590. nuitka/tools/general/__init__.py +5 -4
  591. nuitka/tools/general/dll_report/__init__.py +5 -4
  592. nuitka/tools/general/dll_report/__main__.py +19 -21
  593. nuitka/tools/general/find_module/FindModuleCode.py +35 -22
  594. nuitka/tools/general/find_module/__init__.py +5 -4
  595. nuitka/tools/onefile_compressor/OnefileCompressor.py +213 -131
  596. nuitka/tools/onefile_compressor/__init__.py +5 -4
  597. nuitka/tools/onefile_compressor/__main__.py +18 -17
  598. nuitka/tools/podman/Podman.py +19 -17
  599. nuitka/tools/podman/__init__.py +5 -4
  600. nuitka/tools/podman/__main__.py +35 -19
  601. nuitka/tools/profiler/__init__.py +5 -4
  602. nuitka/tools/profiler/__main__.py +18 -17
  603. nuitka/tools/scanning/DisplayPackageDLLs.py +47 -22
  604. nuitka/tools/scanning/DisplayPackageData.py +31 -19
  605. nuitka/tools/scanning/__init__.py +5 -4
  606. nuitka/tools/specialize/CTypeDescriptions.py +93 -71
  607. nuitka/tools/specialize/Common.py +18 -17
  608. nuitka/tools/specialize/SpecializeC.py +31 -27
  609. nuitka/tools/specialize/SpecializePython.py +108 -45
  610. nuitka/tools/specialize/__init__.py +5 -4
  611. nuitka/tools/testing/Common.py +106 -52
  612. nuitka/tools/testing/Constructs.py +19 -17
  613. nuitka/tools/testing/OutputComparison.py +54 -18
  614. nuitka/tools/testing/Pythons.py +19 -18
  615. nuitka/tools/testing/RuntimeTracing.py +20 -19
  616. nuitka/tools/testing/SearchModes.py +26 -20
  617. nuitka/tools/testing/Valgrind.py +19 -17
  618. nuitka/tools/testing/__init__.py +5 -4
  619. nuitka/tools/testing/check_reference_counts/__init__.py +5 -4
  620. nuitka/tools/testing/check_reference_counts/__main__.py +18 -18
  621. nuitka/tools/testing/compare_with_cpython/__init__.py +5 -4
  622. nuitka/tools/testing/compare_with_cpython/__main__.py +36 -29
  623. nuitka/tools/testing/find_sxs_modules/__init__.py +5 -4
  624. nuitka/tools/testing/find_sxs_modules/__main__.py +17 -17
  625. nuitka/tools/testing/measure_construct_performance/__init__.py +5 -4
  626. nuitka/tools/testing/measure_construct_performance/__main__.py +22 -25
  627. nuitka/tools/testing/run_nuitka_tests/__init__.py +5 -4
  628. nuitka/tools/testing/run_nuitka_tests/__main__.py +57 -40
  629. nuitka/tools/watch/AutoStage.py +144 -0
  630. nuitka/tools/watch/GitHub.py +113 -0
  631. nuitka/tools/watch/__init__.py +5 -4
  632. nuitka/tools/watch/__main__.py +322 -91
  633. nuitka/tree/Building.py +176 -147
  634. nuitka/tree/ComplexCallHelperFunctions.py +80 -58
  635. nuitka/tree/Extractions.py +19 -17
  636. nuitka/tree/InternalModule.py +29 -20
  637. nuitka/tree/Operations.py +19 -17
  638. nuitka/tree/ReformulationAssertStatements.py +20 -17
  639. nuitka/tree/ReformulationAssignmentStatements.py +92 -91
  640. nuitka/tree/ReformulationBooleanExpressions.py +19 -17
  641. nuitka/tree/ReformulationCallExpressions.py +20 -18
  642. nuitka/tree/ReformulationClasses.py +45 -39
  643. nuitka/tree/ReformulationClasses3.py +146 -98
  644. nuitka/tree/ReformulationComparisonExpressions.py +29 -35
  645. nuitka/tree/ReformulationContractionExpressions.py +58 -55
  646. nuitka/tree/ReformulationDictionaryCreation.py +40 -35
  647. nuitka/tree/ReformulationExecStatements.py +42 -39
  648. nuitka/tree/ReformulationForLoopStatements.py +30 -34
  649. nuitka/tree/ReformulationFunctionStatements.py +58 -54
  650. nuitka/tree/ReformulationImportStatements.py +34 -29
  651. nuitka/tree/ReformulationLambdaExpressions.py +23 -24
  652. nuitka/tree/ReformulationMatchStatements.py +244 -92
  653. nuitka/tree/ReformulationMultidist.py +22 -18
  654. nuitka/tree/ReformulationNamespacePackages.py +55 -46
  655. nuitka/tree/ReformulationPrintStatements.py +23 -24
  656. nuitka/tree/ReformulationSequenceCreation.py +50 -49
  657. nuitka/tree/ReformulationSubscriptExpressions.py +19 -17
  658. nuitka/tree/ReformulationTryExceptStatements.py +19 -17
  659. nuitka/tree/ReformulationTryFinallyStatements.py +34 -17
  660. nuitka/tree/ReformulationWhileLoopStatements.py +19 -17
  661. nuitka/tree/ReformulationWithStatements.py +39 -41
  662. nuitka/tree/ReformulationYieldExpressions.py +21 -19
  663. nuitka/tree/SourceHandling.py +76 -31
  664. nuitka/tree/SyntaxErrors.py +19 -17
  665. nuitka/tree/TreeHelpers.py +33 -20
  666. nuitka/tree/VariableClosure.py +35 -39
  667. nuitka/tree/__init__.py +5 -4
  668. nuitka/utils/AppDirs.py +41 -20
  669. nuitka/utils/CStrings.py +66 -21
  670. nuitka/utils/CommandLineOptions.py +84 -19
  671. nuitka/utils/Distributions.py +445 -54
  672. nuitka/utils/Download.py +89 -57
  673. nuitka/utils/Execution.py +73 -34
  674. nuitka/utils/FileOperations.py +318 -74
  675. nuitka/utils/Hashing.py +55 -33
  676. nuitka/utils/Images.py +26 -19
  677. nuitka/utils/Importing.py +118 -24
  678. nuitka/utils/InstalledPythons.py +80 -75
  679. nuitka/utils/InstanceCounters.py +20 -17
  680. nuitka/utils/Jinja2.py +30 -22
  681. nuitka/utils/Json.py +19 -17
  682. nuitka/utils/MacOSApp.py +26 -18
  683. nuitka/utils/MemoryUsage.py +20 -18
  684. nuitka/utils/ModuleNames.py +42 -26
  685. nuitka/utils/ReExecute.py +50 -28
  686. nuitka/utils/Rest.py +20 -17
  687. nuitka/utils/SharedLibraries.py +161 -75
  688. nuitka/utils/Shebang.py +20 -17
  689. nuitka/utils/Signing.py +63 -18
  690. nuitka/utils/SlotMetaClasses.py +57 -0
  691. nuitka/utils/StaticLibraries.py +83 -56
  692. nuitka/utils/ThreadedExecutor.py +18 -17
  693. nuitka/utils/Timing.py +22 -20
  694. nuitka/utils/Utils.py +115 -25
  695. nuitka/utils/WindowsFileUsage.py +22 -20
  696. nuitka/utils/WindowsResources.py +25 -18
  697. nuitka/utils/Yaml.py +62 -24
  698. nuitka/utils/__init__.py +5 -4
  699. Nuitka_winsvc-1.8.dist-info/RECORD +0 -905
  700. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_gui.py +0 -9
  701. nuitka/build/inline_copy/tqdm/tqdm/gui.py +0 -191
  702. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/LICENSE.txt +0 -0
  703. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/entry_points.txt +0 -0
  704. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.4.8.dist-info}/top_level.txt +0 -0
@@ -1,20 +1,5 @@
1
- // Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com
2
- //
3
- // Part of "Nuitka", an optimizing Python compiler that is compatible and
4
- // integrates with CPython, but also works on its own.
5
- //
6
- // Licensed under the Apache License, Version 2.0 (the "License");
7
- // you may not use this file except in compliance with the License.
8
- // You may obtain a copy of the License at
9
- //
10
- // http://www.apache.org/licenses/LICENSE-2.0
11
- //
12
- // Unless required by applicable law or agreed to in writing, software
13
- // distributed under the License is distributed on an "AS IS" BASIS,
14
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- // See the License for the specific language governing permissions and
16
- // limitations under the License.
17
- //
1
+ // Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
18
3
  /* WARNING, this code is GENERATED. Modify the template HelperOperationComparison.c.j2 instead! */
19
4
 
20
5
  /* This file is included from another C file, help IDEs to still parse it on its own. */
@@ -38,7 +23,7 @@ static PyObject *COMPARE_LE_OBJECT_INT_INT(PyObject *operand1, PyObject *operand
38
23
 
39
24
  // Convert to target type.
40
25
  PyObject *result = BOOL_FROM(r);
41
- Py_INCREF(result);
26
+ Py_INCREF_IMMORTAL(result);
42
27
  return result;
43
28
  }
44
29
  #endif
@@ -73,7 +58,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
73
58
  if (operand1 == operand2 && IS_SANE_TYPE(Py_TYPE(operand1))) {
74
59
  bool r = true;
75
60
  PyObject *result = BOOL_FROM(r);
76
- Py_INCREF(result);
61
+ Py_INCREF_IMMORTAL(result);
77
62
  return result;
78
63
  }
79
64
 
@@ -94,7 +79,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
94
79
  // If the types are equal, we may get away immediately except for instances.
95
80
  if (type1 == type2 && !PyInstance_Check(operand1)) {
96
81
 
97
- richcmpfunc frich = RICHCOMPARE(type1);
82
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
98
83
 
99
84
  if (frich != NULL) {
100
85
  PyObject *result = (*frich)(operand1, operand2, Py_LE);
@@ -105,7 +90,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
105
90
  return result;
106
91
  }
107
92
 
108
- Py_DECREF(result);
93
+ Py_DECREF_IMMORTAL(result);
109
94
  }
110
95
 
111
96
  // No rich comparison worked, but maybe compare works.
@@ -146,7 +131,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
146
131
 
147
132
  bool r = c != 0;
148
133
  PyObject *result = BOOL_FROM(r);
149
- Py_INCREF(result);
134
+ Py_INCREF_IMMORTAL(result);
150
135
  return result;
151
136
  }
152
137
  }
@@ -155,7 +140,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
155
140
  richcmpfunc f;
156
141
 
157
142
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
158
- f = RICHCOMPARE(type2);
143
+ f = TP_RICHCOMPARE(type2);
159
144
 
160
145
  if (f != NULL) {
161
146
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -166,11 +151,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
166
151
  return result;
167
152
  }
168
153
 
169
- Py_DECREF(result);
154
+ Py_DECREF_IMMORTAL(result);
170
155
  }
171
156
  }
172
157
 
173
- f = RICHCOMPARE(type1);
158
+ f = TP_RICHCOMPARE(type1);
174
159
  if (f != NULL) {
175
160
  PyObject *result = (*f)(operand1, operand2, Py_LE);
176
161
 
@@ -180,10 +165,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
180
165
  return result;
181
166
  }
182
167
 
183
- Py_DECREF(result);
168
+ Py_DECREF_IMMORTAL(result);
184
169
  }
185
170
 
186
- f = RICHCOMPARE(type2);
171
+ f = TP_RICHCOMPARE(type2);
187
172
  if (f != NULL) {
188
173
  PyObject *result = (*f)(operand2, operand1, Py_GE);
189
174
 
@@ -193,7 +178,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
193
178
  return result;
194
179
  }
195
180
 
196
- Py_DECREF(result);
181
+ Py_DECREF_IMMORTAL(result);
197
182
  }
198
183
 
199
184
  int c;
@@ -281,14 +266,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
281
266
 
282
267
  bool r = c != 0;
283
268
  PyObject *result = BOOL_FROM(r);
284
- Py_INCREF(result);
269
+ Py_INCREF_IMMORTAL(result);
285
270
  return result;
286
271
  #else
287
272
  bool checked_reverse_op = false;
288
273
  richcmpfunc f;
289
274
 
290
275
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
291
- f = RICHCOMPARE(type2);
276
+ f = TP_RICHCOMPARE(type2);
292
277
 
293
278
  if (f != NULL) {
294
279
  checked_reverse_op = true;
@@ -301,11 +286,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
301
286
  return result;
302
287
  }
303
288
 
304
- Py_DECREF(result);
289
+ Py_DECREF_IMMORTAL(result);
305
290
  }
306
291
  }
307
292
 
308
- f = RICHCOMPARE(type1);
293
+ f = TP_RICHCOMPARE(type1);
309
294
 
310
295
  if (f != NULL) {
311
296
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -316,11 +301,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
316
301
  return result;
317
302
  }
318
303
 
319
- Py_DECREF(result);
304
+ Py_DECREF_IMMORTAL(result);
320
305
  }
321
306
 
322
307
  if (checked_reverse_op == false) {
323
- f = RICHCOMPARE(type2);
308
+ f = TP_RICHCOMPARE(type2);
324
309
 
325
310
  if (f != NULL) {
326
311
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -331,7 +316,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
331
316
  return result;
332
317
  }
333
318
 
334
- Py_DECREF(result);
319
+ Py_DECREF_IMMORTAL(result);
335
320
  }
336
321
  }
337
322
 
@@ -343,13 +328,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
343
328
  case Py_EQ: {
344
329
  bool r = operand1 == operand2;
345
330
  PyObject *result = BOOL_FROM(r);
346
- Py_INCREF(result);
331
+ Py_INCREF_IMMORTAL(result);
347
332
  return result;
348
333
  }
349
334
  case Py_NE: {
350
335
  bool r = operand1 != operand2;
351
336
  PyObject *result = BOOL_FROM(r);
352
- Py_INCREF(result);
337
+ Py_INCREF_IMMORTAL(result);
353
338
  return result;
354
339
  }
355
340
  default:
@@ -398,7 +383,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
398
383
  // If the types are equal, we may get away immediately except for instances.
399
384
  if (type1 == type2 && !PyInstance_Check(operand1)) {
400
385
 
401
- richcmpfunc frich = RICHCOMPARE(type1);
386
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
402
387
 
403
388
  if (frich != NULL) {
404
389
  PyObject *result = (*frich)(operand1, operand2, Py_LE);
@@ -417,7 +402,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
417
402
  }
418
403
  }
419
404
 
420
- Py_DECREF(result);
405
+ Py_DECREF_IMMORTAL(result);
421
406
  }
422
407
 
423
408
  // No rich comparison worked, but maybe compare works.
@@ -467,7 +452,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
467
452
  richcmpfunc f;
468
453
 
469
454
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
470
- f = RICHCOMPARE(type2);
455
+ f = TP_RICHCOMPARE(type2);
471
456
 
472
457
  if (f != NULL) {
473
458
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -486,11 +471,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
486
471
  }
487
472
  }
488
473
 
489
- Py_DECREF(result);
474
+ Py_DECREF_IMMORTAL(result);
490
475
  }
491
476
  }
492
477
 
493
- f = RICHCOMPARE(type1);
478
+ f = TP_RICHCOMPARE(type1);
494
479
  if (f != NULL) {
495
480
  PyObject *result = (*f)(operand1, operand2, Py_LE);
496
481
 
@@ -508,10 +493,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
508
493
  }
509
494
  }
510
495
 
511
- Py_DECREF(result);
496
+ Py_DECREF_IMMORTAL(result);
512
497
  }
513
498
 
514
- f = RICHCOMPARE(type2);
499
+ f = TP_RICHCOMPARE(type2);
515
500
  if (f != NULL) {
516
501
  PyObject *result = (*f)(operand2, operand1, Py_GE);
517
502
 
@@ -529,7 +514,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
529
514
  }
530
515
  }
531
516
 
532
- Py_DECREF(result);
517
+ Py_DECREF_IMMORTAL(result);
533
518
  }
534
519
 
535
520
  int c;
@@ -624,7 +609,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
624
609
  richcmpfunc f;
625
610
 
626
611
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
627
- f = RICHCOMPARE(type2);
612
+ f = TP_RICHCOMPARE(type2);
628
613
 
629
614
  if (f != NULL) {
630
615
  checked_reverse_op = true;
@@ -645,11 +630,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
645
630
  }
646
631
  }
647
632
 
648
- Py_DECREF(result);
633
+ Py_DECREF_IMMORTAL(result);
649
634
  }
650
635
  }
651
636
 
652
- f = RICHCOMPARE(type1);
637
+ f = TP_RICHCOMPARE(type1);
653
638
 
654
639
  if (f != NULL) {
655
640
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -668,11 +653,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
668
653
  }
669
654
  }
670
655
 
671
- Py_DECREF(result);
656
+ Py_DECREF_IMMORTAL(result);
672
657
  }
673
658
 
674
659
  if (checked_reverse_op == false) {
675
- f = RICHCOMPARE(type2);
660
+ f = TP_RICHCOMPARE(type2);
676
661
 
677
662
  if (f != NULL) {
678
663
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -691,7 +676,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
691
676
  }
692
677
  }
693
678
 
694
- Py_DECREF(result);
679
+ Py_DECREF_IMMORTAL(result);
695
680
  }
696
681
  }
697
682
 
@@ -740,7 +725,7 @@ static PyObject *COMPARE_LE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
740
725
 
741
726
  // Convert to target type.
742
727
  PyObject *result = BOOL_FROM(r);
743
- Py_INCREF(result);
728
+ Py_INCREF_IMMORTAL(result);
744
729
  return result;
745
730
  }
746
731
 
@@ -768,7 +753,7 @@ static PyObject *COMPARE_LE_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
768
753
 
769
754
  // Convert to target type.
770
755
  PyObject *result = BOOL_FROM(c != 0);
771
- Py_INCREF(result);
756
+ Py_INCREF_IMMORTAL(result);
772
757
  return result;
773
758
  }
774
759
  /* Code referring to "OBJECT" corresponds to any Python object and "STR" to Python2 'str'. */
@@ -805,7 +790,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
805
790
  return result;
806
791
  }
807
792
 
808
- Py_DECREF(result);
793
+ Py_DECREF_IMMORTAL(result);
809
794
  }
810
795
 
811
796
  // No rich comparison worked, but maybe compare works.
@@ -846,7 +831,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
846
831
 
847
832
  bool r = c != 0;
848
833
  PyObject *result = BOOL_FROM(r);
849
- Py_INCREF(result);
834
+ Py_INCREF_IMMORTAL(result);
850
835
  return result;
851
836
  }
852
837
  }
@@ -866,11 +851,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
866
851
  return result;
867
852
  }
868
853
 
869
- Py_DECREF(result);
854
+ Py_DECREF_IMMORTAL(result);
870
855
  }
871
856
  }
872
857
 
873
- f = RICHCOMPARE(type1);
858
+ f = TP_RICHCOMPARE(type1);
874
859
  if (f != NULL) {
875
860
  PyObject *result = (*f)(operand1, operand2, Py_LE);
876
861
 
@@ -880,7 +865,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
880
865
  return result;
881
866
  }
882
867
 
883
- Py_DECREF(result);
868
+ Py_DECREF_IMMORTAL(result);
884
869
  }
885
870
 
886
871
  f = PyString_Type.tp_richcompare;
@@ -893,7 +878,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
893
878
  return result;
894
879
  }
895
880
 
896
- Py_DECREF(result);
881
+ Py_DECREF_IMMORTAL(result);
897
882
  }
898
883
 
899
884
  int c;
@@ -981,7 +966,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
981
966
 
982
967
  bool r = c != 0;
983
968
  PyObject *result = BOOL_FROM(r);
984
- Py_INCREF(result);
969
+ Py_INCREF_IMMORTAL(result);
985
970
  return result;
986
971
  #else
987
972
  bool checked_reverse_op = false;
@@ -1001,11 +986,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1001
986
  return result;
1002
987
  }
1003
988
 
1004
- Py_DECREF(result);
989
+ Py_DECREF_IMMORTAL(result);
1005
990
  }
1006
991
  }
1007
992
 
1008
- f = RICHCOMPARE(type1);
993
+ f = TP_RICHCOMPARE(type1);
1009
994
 
1010
995
  if (f != NULL) {
1011
996
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -1016,7 +1001,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1016
1001
  return result;
1017
1002
  }
1018
1003
 
1019
- Py_DECREF(result);
1004
+ Py_DECREF_IMMORTAL(result);
1020
1005
  }
1021
1006
 
1022
1007
  if (checked_reverse_op == false) {
@@ -1031,7 +1016,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1031
1016
  return result;
1032
1017
  }
1033
1018
 
1034
- Py_DECREF(result);
1019
+ Py_DECREF_IMMORTAL(result);
1035
1020
  }
1036
1021
  }
1037
1022
 
@@ -1043,13 +1028,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1043
1028
  case Py_EQ: {
1044
1029
  bool r = operand1 == operand2;
1045
1030
  PyObject *result = BOOL_FROM(r);
1046
- Py_INCREF(result);
1031
+ Py_INCREF_IMMORTAL(result);
1047
1032
  return result;
1048
1033
  }
1049
1034
  case Py_NE: {
1050
1035
  bool r = operand1 != operand2;
1051
1036
  PyObject *result = BOOL_FROM(r);
1052
- Py_INCREF(result);
1037
+ Py_INCREF_IMMORTAL(result);
1053
1038
  return result;
1054
1039
  }
1055
1040
  default:
@@ -1099,7 +1084,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1099
1084
  return result;
1100
1085
  }
1101
1086
 
1102
- Py_DECREF(result);
1087
+ Py_DECREF_IMMORTAL(result);
1103
1088
  }
1104
1089
 
1105
1090
  // No rich comparison worked, but maybe compare works.
@@ -1140,7 +1125,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1140
1125
 
1141
1126
  bool r = c != 0;
1142
1127
  PyObject *result = BOOL_FROM(r);
1143
- Py_INCREF(result);
1128
+ Py_INCREF_IMMORTAL(result);
1144
1129
  return result;
1145
1130
  }
1146
1131
  }
@@ -1149,7 +1134,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1149
1134
  richcmpfunc f;
1150
1135
 
1151
1136
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1152
- f = RICHCOMPARE(type2);
1137
+ f = TP_RICHCOMPARE(type2);
1153
1138
 
1154
1139
  if (f != NULL) {
1155
1140
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -1160,7 +1145,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1160
1145
  return result;
1161
1146
  }
1162
1147
 
1163
- Py_DECREF(result);
1148
+ Py_DECREF_IMMORTAL(result);
1164
1149
  }
1165
1150
  }
1166
1151
 
@@ -1174,10 +1159,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1174
1159
  return result;
1175
1160
  }
1176
1161
 
1177
- Py_DECREF(result);
1162
+ Py_DECREF_IMMORTAL(result);
1178
1163
  }
1179
1164
 
1180
- f = RICHCOMPARE(type2);
1165
+ f = TP_RICHCOMPARE(type2);
1181
1166
  if (f != NULL) {
1182
1167
  PyObject *result = (*f)(operand2, operand1, Py_GE);
1183
1168
 
@@ -1187,7 +1172,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1187
1172
  return result;
1188
1173
  }
1189
1174
 
1190
- Py_DECREF(result);
1175
+ Py_DECREF_IMMORTAL(result);
1191
1176
  }
1192
1177
 
1193
1178
  int c;
@@ -1275,14 +1260,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1275
1260
 
1276
1261
  bool r = c != 0;
1277
1262
  PyObject *result = BOOL_FROM(r);
1278
- Py_INCREF(result);
1263
+ Py_INCREF_IMMORTAL(result);
1279
1264
  return result;
1280
1265
  #else
1281
1266
  bool checked_reverse_op = false;
1282
1267
  richcmpfunc f;
1283
1268
 
1284
1269
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1285
- f = RICHCOMPARE(type2);
1270
+ f = TP_RICHCOMPARE(type2);
1286
1271
 
1287
1272
  if (f != NULL) {
1288
1273
  checked_reverse_op = true;
@@ -1295,7 +1280,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1295
1280
  return result;
1296
1281
  }
1297
1282
 
1298
- Py_DECREF(result);
1283
+ Py_DECREF_IMMORTAL(result);
1299
1284
  }
1300
1285
  }
1301
1286
 
@@ -1310,11 +1295,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1310
1295
  return result;
1311
1296
  }
1312
1297
 
1313
- Py_DECREF(result);
1298
+ Py_DECREF_IMMORTAL(result);
1314
1299
  }
1315
1300
 
1316
1301
  if (checked_reverse_op == false) {
1317
- f = RICHCOMPARE(type2);
1302
+ f = TP_RICHCOMPARE(type2);
1318
1303
 
1319
1304
  if (f != NULL) {
1320
1305
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -1325,7 +1310,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1325
1310
  return result;
1326
1311
  }
1327
1312
 
1328
- Py_DECREF(result);
1313
+ Py_DECREF_IMMORTAL(result);
1329
1314
  }
1330
1315
  }
1331
1316
 
@@ -1337,13 +1322,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1337
1322
  case Py_EQ: {
1338
1323
  bool r = operand1 == operand2;
1339
1324
  PyObject *result = BOOL_FROM(r);
1340
- Py_INCREF(result);
1325
+ Py_INCREF_IMMORTAL(result);
1341
1326
  return result;
1342
1327
  }
1343
1328
  case Py_NE: {
1344
1329
  bool r = operand1 != operand2;
1345
1330
  PyObject *result = BOOL_FROM(r);
1346
- Py_INCREF(result);
1331
+ Py_INCREF_IMMORTAL(result);
1347
1332
  return result;
1348
1333
  }
1349
1334
  default:
@@ -1463,7 +1448,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1463
1448
  }
1464
1449
  }
1465
1450
 
1466
- Py_DECREF(result);
1451
+ Py_DECREF_IMMORTAL(result);
1467
1452
  }
1468
1453
 
1469
1454
  // No rich comparison worked, but maybe compare works.
@@ -1532,11 +1517,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1532
1517
  }
1533
1518
  }
1534
1519
 
1535
- Py_DECREF(result);
1520
+ Py_DECREF_IMMORTAL(result);
1536
1521
  }
1537
1522
  }
1538
1523
 
1539
- f = RICHCOMPARE(type1);
1524
+ f = TP_RICHCOMPARE(type1);
1540
1525
  if (f != NULL) {
1541
1526
  PyObject *result = (*f)(operand1, operand2, Py_LE);
1542
1527
 
@@ -1554,7 +1539,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1554
1539
  }
1555
1540
  }
1556
1541
 
1557
- Py_DECREF(result);
1542
+ Py_DECREF_IMMORTAL(result);
1558
1543
  }
1559
1544
 
1560
1545
  f = PyString_Type.tp_richcompare;
@@ -1575,7 +1560,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1575
1560
  }
1576
1561
  }
1577
1562
 
1578
- Py_DECREF(result);
1563
+ Py_DECREF_IMMORTAL(result);
1579
1564
  }
1580
1565
 
1581
1566
  int c;
@@ -1691,11 +1676,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1691
1676
  }
1692
1677
  }
1693
1678
 
1694
- Py_DECREF(result);
1679
+ Py_DECREF_IMMORTAL(result);
1695
1680
  }
1696
1681
  }
1697
1682
 
1698
- f = RICHCOMPARE(type1);
1683
+ f = TP_RICHCOMPARE(type1);
1699
1684
 
1700
1685
  if (f != NULL) {
1701
1686
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -1714,7 +1699,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1714
1699
  }
1715
1700
  }
1716
1701
 
1717
- Py_DECREF(result);
1702
+ Py_DECREF_IMMORTAL(result);
1718
1703
  }
1719
1704
 
1720
1705
  if (checked_reverse_op == false) {
@@ -1737,7 +1722,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1737
1722
  }
1738
1723
  }
1739
1724
 
1740
- Py_DECREF(result);
1725
+ Py_DECREF_IMMORTAL(result);
1741
1726
  }
1742
1727
  }
1743
1728
 
@@ -1813,7 +1798,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1813
1798
  }
1814
1799
  }
1815
1800
 
1816
- Py_DECREF(result);
1801
+ Py_DECREF_IMMORTAL(result);
1817
1802
  }
1818
1803
 
1819
1804
  // No rich comparison worked, but maybe compare works.
@@ -1863,7 +1848,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1863
1848
  richcmpfunc f;
1864
1849
 
1865
1850
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1866
- f = RICHCOMPARE(type2);
1851
+ f = TP_RICHCOMPARE(type2);
1867
1852
 
1868
1853
  if (f != NULL) {
1869
1854
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -1882,7 +1867,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1882
1867
  }
1883
1868
  }
1884
1869
 
1885
- Py_DECREF(result);
1870
+ Py_DECREF_IMMORTAL(result);
1886
1871
  }
1887
1872
  }
1888
1873
 
@@ -1904,10 +1889,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1904
1889
  }
1905
1890
  }
1906
1891
 
1907
- Py_DECREF(result);
1892
+ Py_DECREF_IMMORTAL(result);
1908
1893
  }
1909
1894
 
1910
- f = RICHCOMPARE(type2);
1895
+ f = TP_RICHCOMPARE(type2);
1911
1896
  if (f != NULL) {
1912
1897
  PyObject *result = (*f)(operand2, operand1, Py_GE);
1913
1898
 
@@ -1925,7 +1910,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1925
1910
  }
1926
1911
  }
1927
1912
 
1928
- Py_DECREF(result);
1913
+ Py_DECREF_IMMORTAL(result);
1929
1914
  }
1930
1915
 
1931
1916
  int c;
@@ -2020,7 +2005,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2020
2005
  richcmpfunc f;
2021
2006
 
2022
2007
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
2023
- f = RICHCOMPARE(type2);
2008
+ f = TP_RICHCOMPARE(type2);
2024
2009
 
2025
2010
  if (f != NULL) {
2026
2011
  checked_reverse_op = true;
@@ -2041,7 +2026,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2041
2026
  }
2042
2027
  }
2043
2028
 
2044
- Py_DECREF(result);
2029
+ Py_DECREF_IMMORTAL(result);
2045
2030
  }
2046
2031
  }
2047
2032
 
@@ -2064,11 +2049,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2064
2049
  }
2065
2050
  }
2066
2051
 
2067
- Py_DECREF(result);
2052
+ Py_DECREF_IMMORTAL(result);
2068
2053
  }
2069
2054
 
2070
2055
  if (checked_reverse_op == false) {
2071
- f = RICHCOMPARE(type2);
2056
+ f = TP_RICHCOMPARE(type2);
2072
2057
 
2073
2058
  if (f != NULL) {
2074
2059
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -2087,7 +2072,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2087
2072
  }
2088
2073
  }
2089
2074
 
2090
- Py_DECREF(result);
2075
+ Py_DECREF_IMMORTAL(result);
2091
2076
  }
2092
2077
  }
2093
2078
 
@@ -2135,7 +2120,7 @@ static PyObject *COMPARE_LE_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject
2135
2120
 
2136
2121
  // Convert to target type.
2137
2122
  PyObject *result = BOOL_FROM(r);
2138
- Py_INCREF(result);
2123
+ Py_INCREF_IMMORTAL(result);
2139
2124
  return result;
2140
2125
  }
2141
2126
 
@@ -2178,7 +2163,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2178
2163
  return result;
2179
2164
  }
2180
2165
 
2181
- Py_DECREF(result);
2166
+ Py_DECREF_IMMORTAL(result);
2182
2167
  }
2183
2168
 
2184
2169
  // No rich comparison worked, but maybe compare works.
@@ -2219,7 +2204,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2219
2204
 
2220
2205
  bool r = c != 0;
2221
2206
  PyObject *result = BOOL_FROM(r);
2222
- Py_INCREF(result);
2207
+ Py_INCREF_IMMORTAL(result);
2223
2208
  return result;
2224
2209
  }
2225
2210
  }
@@ -2239,11 +2224,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2239
2224
  return result;
2240
2225
  }
2241
2226
 
2242
- Py_DECREF(result);
2227
+ Py_DECREF_IMMORTAL(result);
2243
2228
  }
2244
2229
  }
2245
2230
 
2246
- f = RICHCOMPARE(type1);
2231
+ f = TP_RICHCOMPARE(type1);
2247
2232
  if (f != NULL) {
2248
2233
  PyObject *result = (*f)(operand1, operand2, Py_LE);
2249
2234
 
@@ -2253,7 +2238,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2253
2238
  return result;
2254
2239
  }
2255
2240
 
2256
- Py_DECREF(result);
2241
+ Py_DECREF_IMMORTAL(result);
2257
2242
  }
2258
2243
 
2259
2244
  f = PyUnicode_Type.tp_richcompare;
@@ -2266,7 +2251,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2266
2251
  return result;
2267
2252
  }
2268
2253
 
2269
- Py_DECREF(result);
2254
+ Py_DECREF_IMMORTAL(result);
2270
2255
  }
2271
2256
 
2272
2257
  int c;
@@ -2354,7 +2339,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2354
2339
 
2355
2340
  bool r = c != 0;
2356
2341
  PyObject *result = BOOL_FROM(r);
2357
- Py_INCREF(result);
2342
+ Py_INCREF_IMMORTAL(result);
2358
2343
  return result;
2359
2344
  #else
2360
2345
  bool checked_reverse_op = false;
@@ -2374,11 +2359,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2374
2359
  return result;
2375
2360
  }
2376
2361
 
2377
- Py_DECREF(result);
2362
+ Py_DECREF_IMMORTAL(result);
2378
2363
  }
2379
2364
  }
2380
2365
 
2381
- f = RICHCOMPARE(type1);
2366
+ f = TP_RICHCOMPARE(type1);
2382
2367
 
2383
2368
  if (f != NULL) {
2384
2369
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -2389,7 +2374,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2389
2374
  return result;
2390
2375
  }
2391
2376
 
2392
- Py_DECREF(result);
2377
+ Py_DECREF_IMMORTAL(result);
2393
2378
  }
2394
2379
 
2395
2380
  if (checked_reverse_op == false) {
@@ -2404,7 +2389,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2404
2389
  return result;
2405
2390
  }
2406
2391
 
2407
- Py_DECREF(result);
2392
+ Py_DECREF_IMMORTAL(result);
2408
2393
  }
2409
2394
  }
2410
2395
 
@@ -2416,13 +2401,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2416
2401
  case Py_EQ: {
2417
2402
  bool r = operand1 == operand2;
2418
2403
  PyObject *result = BOOL_FROM(r);
2419
- Py_INCREF(result);
2404
+ Py_INCREF_IMMORTAL(result);
2420
2405
  return result;
2421
2406
  }
2422
2407
  case Py_NE: {
2423
2408
  bool r = operand1 != operand2;
2424
2409
  PyObject *result = BOOL_FROM(r);
2425
- Py_INCREF(result);
2410
+ Py_INCREF_IMMORTAL(result);
2426
2411
  return result;
2427
2412
  }
2428
2413
  default:
@@ -2472,7 +2457,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2472
2457
  return result;
2473
2458
  }
2474
2459
 
2475
- Py_DECREF(result);
2460
+ Py_DECREF_IMMORTAL(result);
2476
2461
  }
2477
2462
 
2478
2463
  // No rich comparison worked, but maybe compare works.
@@ -2513,7 +2498,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2513
2498
 
2514
2499
  bool r = c != 0;
2515
2500
  PyObject *result = BOOL_FROM(r);
2516
- Py_INCREF(result);
2501
+ Py_INCREF_IMMORTAL(result);
2517
2502
  return result;
2518
2503
  }
2519
2504
  }
@@ -2522,7 +2507,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2522
2507
  richcmpfunc f;
2523
2508
 
2524
2509
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2525
- f = RICHCOMPARE(type2);
2510
+ f = TP_RICHCOMPARE(type2);
2526
2511
 
2527
2512
  if (f != NULL) {
2528
2513
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -2533,7 +2518,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2533
2518
  return result;
2534
2519
  }
2535
2520
 
2536
- Py_DECREF(result);
2521
+ Py_DECREF_IMMORTAL(result);
2537
2522
  }
2538
2523
  }
2539
2524
 
@@ -2547,10 +2532,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2547
2532
  return result;
2548
2533
  }
2549
2534
 
2550
- Py_DECREF(result);
2535
+ Py_DECREF_IMMORTAL(result);
2551
2536
  }
2552
2537
 
2553
- f = RICHCOMPARE(type2);
2538
+ f = TP_RICHCOMPARE(type2);
2554
2539
  if (f != NULL) {
2555
2540
  PyObject *result = (*f)(operand2, operand1, Py_GE);
2556
2541
 
@@ -2560,7 +2545,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2560
2545
  return result;
2561
2546
  }
2562
2547
 
2563
- Py_DECREF(result);
2548
+ Py_DECREF_IMMORTAL(result);
2564
2549
  }
2565
2550
 
2566
2551
  int c;
@@ -2648,14 +2633,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2648
2633
 
2649
2634
  bool r = c != 0;
2650
2635
  PyObject *result = BOOL_FROM(r);
2651
- Py_INCREF(result);
2636
+ Py_INCREF_IMMORTAL(result);
2652
2637
  return result;
2653
2638
  #else
2654
2639
  bool checked_reverse_op = false;
2655
2640
  richcmpfunc f;
2656
2641
 
2657
2642
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2658
- f = RICHCOMPARE(type2);
2643
+ f = TP_RICHCOMPARE(type2);
2659
2644
 
2660
2645
  if (f != NULL) {
2661
2646
  checked_reverse_op = true;
@@ -2668,7 +2653,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2668
2653
  return result;
2669
2654
  }
2670
2655
 
2671
- Py_DECREF(result);
2656
+ Py_DECREF_IMMORTAL(result);
2672
2657
  }
2673
2658
  }
2674
2659
 
@@ -2683,11 +2668,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2683
2668
  return result;
2684
2669
  }
2685
2670
 
2686
- Py_DECREF(result);
2671
+ Py_DECREF_IMMORTAL(result);
2687
2672
  }
2688
2673
 
2689
2674
  if (checked_reverse_op == false) {
2690
- f = RICHCOMPARE(type2);
2675
+ f = TP_RICHCOMPARE(type2);
2691
2676
 
2692
2677
  if (f != NULL) {
2693
2678
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -2698,7 +2683,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2698
2683
  return result;
2699
2684
  }
2700
2685
 
2701
- Py_DECREF(result);
2686
+ Py_DECREF_IMMORTAL(result);
2702
2687
  }
2703
2688
  }
2704
2689
 
@@ -2710,13 +2695,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2710
2695
  case Py_EQ: {
2711
2696
  bool r = operand1 == operand2;
2712
2697
  PyObject *result = BOOL_FROM(r);
2713
- Py_INCREF(result);
2698
+ Py_INCREF_IMMORTAL(result);
2714
2699
  return result;
2715
2700
  }
2716
2701
  case Py_NE: {
2717
2702
  bool r = operand1 != operand2;
2718
2703
  PyObject *result = BOOL_FROM(r);
2719
- Py_INCREF(result);
2704
+ Py_INCREF_IMMORTAL(result);
2720
2705
  return result;
2721
2706
  }
2722
2707
  default:
@@ -2763,7 +2748,7 @@ static bool COMPARE_LE_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *opera
2763
2748
 
2764
2749
  // Convert to target type if necessary
2765
2750
  bool result = r == Py_True;
2766
- Py_DECREF(r);
2751
+ Py_DECREF_IMMORTAL(r);
2767
2752
 
2768
2753
  return result;
2769
2754
  }
@@ -2816,7 +2801,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2816
2801
  }
2817
2802
  }
2818
2803
 
2819
- Py_DECREF(result);
2804
+ Py_DECREF_IMMORTAL(result);
2820
2805
  }
2821
2806
 
2822
2807
  // No rich comparison worked, but maybe compare works.
@@ -2885,11 +2870,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2885
2870
  }
2886
2871
  }
2887
2872
 
2888
- Py_DECREF(result);
2873
+ Py_DECREF_IMMORTAL(result);
2889
2874
  }
2890
2875
  }
2891
2876
 
2892
- f = RICHCOMPARE(type1);
2877
+ f = TP_RICHCOMPARE(type1);
2893
2878
  if (f != NULL) {
2894
2879
  PyObject *result = (*f)(operand1, operand2, Py_LE);
2895
2880
 
@@ -2907,7 +2892,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2907
2892
  }
2908
2893
  }
2909
2894
 
2910
- Py_DECREF(result);
2895
+ Py_DECREF_IMMORTAL(result);
2911
2896
  }
2912
2897
 
2913
2898
  f = PyUnicode_Type.tp_richcompare;
@@ -2928,7 +2913,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2928
2913
  }
2929
2914
  }
2930
2915
 
2931
- Py_DECREF(result);
2916
+ Py_DECREF_IMMORTAL(result);
2932
2917
  }
2933
2918
 
2934
2919
  int c;
@@ -3044,11 +3029,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3044
3029
  }
3045
3030
  }
3046
3031
 
3047
- Py_DECREF(result);
3032
+ Py_DECREF_IMMORTAL(result);
3048
3033
  }
3049
3034
  }
3050
3035
 
3051
- f = RICHCOMPARE(type1);
3036
+ f = TP_RICHCOMPARE(type1);
3052
3037
 
3053
3038
  if (f != NULL) {
3054
3039
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -3067,7 +3052,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3067
3052
  }
3068
3053
  }
3069
3054
 
3070
- Py_DECREF(result);
3055
+ Py_DECREF_IMMORTAL(result);
3071
3056
  }
3072
3057
 
3073
3058
  if (checked_reverse_op == false) {
@@ -3090,7 +3075,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3090
3075
  }
3091
3076
  }
3092
3077
 
3093
- Py_DECREF(result);
3078
+ Py_DECREF_IMMORTAL(result);
3094
3079
  }
3095
3080
  }
3096
3081
 
@@ -3166,7 +3151,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3166
3151
  }
3167
3152
  }
3168
3153
 
3169
- Py_DECREF(result);
3154
+ Py_DECREF_IMMORTAL(result);
3170
3155
  }
3171
3156
 
3172
3157
  // No rich comparison worked, but maybe compare works.
@@ -3216,7 +3201,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3216
3201
  richcmpfunc f;
3217
3202
 
3218
3203
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3219
- f = RICHCOMPARE(type2);
3204
+ f = TP_RICHCOMPARE(type2);
3220
3205
 
3221
3206
  if (f != NULL) {
3222
3207
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -3235,7 +3220,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3235
3220
  }
3236
3221
  }
3237
3222
 
3238
- Py_DECREF(result);
3223
+ Py_DECREF_IMMORTAL(result);
3239
3224
  }
3240
3225
  }
3241
3226
 
@@ -3257,10 +3242,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3257
3242
  }
3258
3243
  }
3259
3244
 
3260
- Py_DECREF(result);
3245
+ Py_DECREF_IMMORTAL(result);
3261
3246
  }
3262
3247
 
3263
- f = RICHCOMPARE(type2);
3248
+ f = TP_RICHCOMPARE(type2);
3264
3249
  if (f != NULL) {
3265
3250
  PyObject *result = (*f)(operand2, operand1, Py_GE);
3266
3251
 
@@ -3278,7 +3263,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3278
3263
  }
3279
3264
  }
3280
3265
 
3281
- Py_DECREF(result);
3266
+ Py_DECREF_IMMORTAL(result);
3282
3267
  }
3283
3268
 
3284
3269
  int c;
@@ -3373,7 +3358,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3373
3358
  richcmpfunc f;
3374
3359
 
3375
3360
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3376
- f = RICHCOMPARE(type2);
3361
+ f = TP_RICHCOMPARE(type2);
3377
3362
 
3378
3363
  if (f != NULL) {
3379
3364
  checked_reverse_op = true;
@@ -3394,7 +3379,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3394
3379
  }
3395
3380
  }
3396
3381
 
3397
- Py_DECREF(result);
3382
+ Py_DECREF_IMMORTAL(result);
3398
3383
  }
3399
3384
  }
3400
3385
 
@@ -3417,11 +3402,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3417
3402
  }
3418
3403
  }
3419
3404
 
3420
- Py_DECREF(result);
3405
+ Py_DECREF_IMMORTAL(result);
3421
3406
  }
3422
3407
 
3423
3408
  if (checked_reverse_op == false) {
3424
- f = RICHCOMPARE(type2);
3409
+ f = TP_RICHCOMPARE(type2);
3425
3410
 
3426
3411
  if (f != NULL) {
3427
3412
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -3440,7 +3425,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3440
3425
  }
3441
3426
  }
3442
3427
 
3443
- Py_DECREF(result);
3428
+ Py_DECREF_IMMORTAL(result);
3444
3429
  }
3445
3430
  }
3446
3431
 
@@ -3490,7 +3475,7 @@ static PyObject *COMPARE_LE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3490
3475
 
3491
3476
  // Convert to target type.
3492
3477
  PyObject *result = BOOL_FROM(r);
3493
- Py_INCREF(result);
3478
+ Py_INCREF_IMMORTAL(result);
3494
3479
  return result;
3495
3480
  }
3496
3481
 
@@ -3518,7 +3503,7 @@ static PyObject *COMPARE_LE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3518
3503
 
3519
3504
  // Convert to target type.
3520
3505
  PyObject *result = BOOL_FROM(c != 0);
3521
- Py_INCREF(result);
3506
+ Py_INCREF_IMMORTAL(result);
3522
3507
  return result;
3523
3508
  }
3524
3509
  /* Code referring to "OBJECT" corresponds to any Python object and "BYTES" to Python3 'bytes'. */
@@ -3555,7 +3540,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3555
3540
  return result;
3556
3541
  }
3557
3542
 
3558
- Py_DECREF(result);
3543
+ Py_DECREF_IMMORTAL(result);
3559
3544
  }
3560
3545
 
3561
3546
  // No rich comparison worked, but maybe compare works.
@@ -3596,7 +3581,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3596
3581
 
3597
3582
  bool r = c != 0;
3598
3583
  PyObject *result = BOOL_FROM(r);
3599
- Py_INCREF(result);
3584
+ Py_INCREF_IMMORTAL(result);
3600
3585
  return result;
3601
3586
  }
3602
3587
  }
@@ -3616,11 +3601,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3616
3601
  return result;
3617
3602
  }
3618
3603
 
3619
- Py_DECREF(result);
3604
+ Py_DECREF_IMMORTAL(result);
3620
3605
  }
3621
3606
  }
3622
3607
 
3623
- f = RICHCOMPARE(type1);
3608
+ f = TP_RICHCOMPARE(type1);
3624
3609
  if (f != NULL) {
3625
3610
  PyObject *result = (*f)(operand1, operand2, Py_LE);
3626
3611
 
@@ -3630,7 +3615,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3630
3615
  return result;
3631
3616
  }
3632
3617
 
3633
- Py_DECREF(result);
3618
+ Py_DECREF_IMMORTAL(result);
3634
3619
  }
3635
3620
 
3636
3621
  f = PyBytes_Type.tp_richcompare;
@@ -3643,7 +3628,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3643
3628
  return result;
3644
3629
  }
3645
3630
 
3646
- Py_DECREF(result);
3631
+ Py_DECREF_IMMORTAL(result);
3647
3632
  }
3648
3633
 
3649
3634
  int c;
@@ -3731,7 +3716,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3731
3716
 
3732
3717
  bool r = c != 0;
3733
3718
  PyObject *result = BOOL_FROM(r);
3734
- Py_INCREF(result);
3719
+ Py_INCREF_IMMORTAL(result);
3735
3720
  return result;
3736
3721
  #else
3737
3722
  bool checked_reverse_op = false;
@@ -3751,11 +3736,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3751
3736
  return result;
3752
3737
  }
3753
3738
 
3754
- Py_DECREF(result);
3739
+ Py_DECREF_IMMORTAL(result);
3755
3740
  }
3756
3741
  }
3757
3742
 
3758
- f = RICHCOMPARE(type1);
3743
+ f = TP_RICHCOMPARE(type1);
3759
3744
 
3760
3745
  if (f != NULL) {
3761
3746
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -3766,7 +3751,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3766
3751
  return result;
3767
3752
  }
3768
3753
 
3769
- Py_DECREF(result);
3754
+ Py_DECREF_IMMORTAL(result);
3770
3755
  }
3771
3756
 
3772
3757
  if (checked_reverse_op == false) {
@@ -3781,7 +3766,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3781
3766
  return result;
3782
3767
  }
3783
3768
 
3784
- Py_DECREF(result);
3769
+ Py_DECREF_IMMORTAL(result);
3785
3770
  }
3786
3771
  }
3787
3772
 
@@ -3793,13 +3778,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3793
3778
  case Py_EQ: {
3794
3779
  bool r = operand1 == operand2;
3795
3780
  PyObject *result = BOOL_FROM(r);
3796
- Py_INCREF(result);
3781
+ Py_INCREF_IMMORTAL(result);
3797
3782
  return result;
3798
3783
  }
3799
3784
  case Py_NE: {
3800
3785
  bool r = operand1 != operand2;
3801
3786
  PyObject *result = BOOL_FROM(r);
3802
- Py_INCREF(result);
3787
+ Py_INCREF_IMMORTAL(result);
3803
3788
  return result;
3804
3789
  }
3805
3790
  default:
@@ -3849,7 +3834,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3849
3834
  return result;
3850
3835
  }
3851
3836
 
3852
- Py_DECREF(result);
3837
+ Py_DECREF_IMMORTAL(result);
3853
3838
  }
3854
3839
 
3855
3840
  // No rich comparison worked, but maybe compare works.
@@ -3890,7 +3875,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3890
3875
 
3891
3876
  bool r = c != 0;
3892
3877
  PyObject *result = BOOL_FROM(r);
3893
- Py_INCREF(result);
3878
+ Py_INCREF_IMMORTAL(result);
3894
3879
  return result;
3895
3880
  }
3896
3881
  }
@@ -3899,7 +3884,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3899
3884
  richcmpfunc f;
3900
3885
 
3901
3886
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
3902
- f = RICHCOMPARE(type2);
3887
+ f = TP_RICHCOMPARE(type2);
3903
3888
 
3904
3889
  if (f != NULL) {
3905
3890
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -3910,7 +3895,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3910
3895
  return result;
3911
3896
  }
3912
3897
 
3913
- Py_DECREF(result);
3898
+ Py_DECREF_IMMORTAL(result);
3914
3899
  }
3915
3900
  }
3916
3901
 
@@ -3924,10 +3909,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3924
3909
  return result;
3925
3910
  }
3926
3911
 
3927
- Py_DECREF(result);
3912
+ Py_DECREF_IMMORTAL(result);
3928
3913
  }
3929
3914
 
3930
- f = RICHCOMPARE(type2);
3915
+ f = TP_RICHCOMPARE(type2);
3931
3916
  if (f != NULL) {
3932
3917
  PyObject *result = (*f)(operand2, operand1, Py_GE);
3933
3918
 
@@ -3937,7 +3922,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3937
3922
  return result;
3938
3923
  }
3939
3924
 
3940
- Py_DECREF(result);
3925
+ Py_DECREF_IMMORTAL(result);
3941
3926
  }
3942
3927
 
3943
3928
  int c;
@@ -4025,14 +4010,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4025
4010
 
4026
4011
  bool r = c != 0;
4027
4012
  PyObject *result = BOOL_FROM(r);
4028
- Py_INCREF(result);
4013
+ Py_INCREF_IMMORTAL(result);
4029
4014
  return result;
4030
4015
  #else
4031
4016
  bool checked_reverse_op = false;
4032
4017
  richcmpfunc f;
4033
4018
 
4034
4019
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4035
- f = RICHCOMPARE(type2);
4020
+ f = TP_RICHCOMPARE(type2);
4036
4021
 
4037
4022
  if (f != NULL) {
4038
4023
  checked_reverse_op = true;
@@ -4045,7 +4030,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4045
4030
  return result;
4046
4031
  }
4047
4032
 
4048
- Py_DECREF(result);
4033
+ Py_DECREF_IMMORTAL(result);
4049
4034
  }
4050
4035
  }
4051
4036
 
@@ -4060,11 +4045,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4060
4045
  return result;
4061
4046
  }
4062
4047
 
4063
- Py_DECREF(result);
4048
+ Py_DECREF_IMMORTAL(result);
4064
4049
  }
4065
4050
 
4066
4051
  if (checked_reverse_op == false) {
4067
- f = RICHCOMPARE(type2);
4052
+ f = TP_RICHCOMPARE(type2);
4068
4053
 
4069
4054
  if (f != NULL) {
4070
4055
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -4075,7 +4060,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4075
4060
  return result;
4076
4061
  }
4077
4062
 
4078
- Py_DECREF(result);
4063
+ Py_DECREF_IMMORTAL(result);
4079
4064
  }
4080
4065
  }
4081
4066
 
@@ -4087,13 +4072,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4087
4072
  case Py_EQ: {
4088
4073
  bool r = operand1 == operand2;
4089
4074
  PyObject *result = BOOL_FROM(r);
4090
- Py_INCREF(result);
4075
+ Py_INCREF_IMMORTAL(result);
4091
4076
  return result;
4092
4077
  }
4093
4078
  case Py_NE: {
4094
4079
  bool r = operand1 != operand2;
4095
4080
  PyObject *result = BOOL_FROM(r);
4096
- Py_INCREF(result);
4081
+ Py_INCREF_IMMORTAL(result);
4097
4082
  return result;
4098
4083
  }
4099
4084
  default:
@@ -4213,7 +4198,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4213
4198
  }
4214
4199
  }
4215
4200
 
4216
- Py_DECREF(result);
4201
+ Py_DECREF_IMMORTAL(result);
4217
4202
  }
4218
4203
 
4219
4204
  // No rich comparison worked, but maybe compare works.
@@ -4282,11 +4267,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4282
4267
  }
4283
4268
  }
4284
4269
 
4285
- Py_DECREF(result);
4270
+ Py_DECREF_IMMORTAL(result);
4286
4271
  }
4287
4272
  }
4288
4273
 
4289
- f = RICHCOMPARE(type1);
4274
+ f = TP_RICHCOMPARE(type1);
4290
4275
  if (f != NULL) {
4291
4276
  PyObject *result = (*f)(operand1, operand2, Py_LE);
4292
4277
 
@@ -4304,7 +4289,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4304
4289
  }
4305
4290
  }
4306
4291
 
4307
- Py_DECREF(result);
4292
+ Py_DECREF_IMMORTAL(result);
4308
4293
  }
4309
4294
 
4310
4295
  f = PyBytes_Type.tp_richcompare;
@@ -4325,7 +4310,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4325
4310
  }
4326
4311
  }
4327
4312
 
4328
- Py_DECREF(result);
4313
+ Py_DECREF_IMMORTAL(result);
4329
4314
  }
4330
4315
 
4331
4316
  int c;
@@ -4441,11 +4426,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4441
4426
  }
4442
4427
  }
4443
4428
 
4444
- Py_DECREF(result);
4429
+ Py_DECREF_IMMORTAL(result);
4445
4430
  }
4446
4431
  }
4447
4432
 
4448
- f = RICHCOMPARE(type1);
4433
+ f = TP_RICHCOMPARE(type1);
4449
4434
 
4450
4435
  if (f != NULL) {
4451
4436
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -4464,7 +4449,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4464
4449
  }
4465
4450
  }
4466
4451
 
4467
- Py_DECREF(result);
4452
+ Py_DECREF_IMMORTAL(result);
4468
4453
  }
4469
4454
 
4470
4455
  if (checked_reverse_op == false) {
@@ -4487,7 +4472,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4487
4472
  }
4488
4473
  }
4489
4474
 
4490
- Py_DECREF(result);
4475
+ Py_DECREF_IMMORTAL(result);
4491
4476
  }
4492
4477
  }
4493
4478
 
@@ -4563,7 +4548,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4563
4548
  }
4564
4549
  }
4565
4550
 
4566
- Py_DECREF(result);
4551
+ Py_DECREF_IMMORTAL(result);
4567
4552
  }
4568
4553
 
4569
4554
  // No rich comparison worked, but maybe compare works.
@@ -4613,7 +4598,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4613
4598
  richcmpfunc f;
4614
4599
 
4615
4600
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4616
- f = RICHCOMPARE(type2);
4601
+ f = TP_RICHCOMPARE(type2);
4617
4602
 
4618
4603
  if (f != NULL) {
4619
4604
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -4632,7 +4617,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4632
4617
  }
4633
4618
  }
4634
4619
 
4635
- Py_DECREF(result);
4620
+ Py_DECREF_IMMORTAL(result);
4636
4621
  }
4637
4622
  }
4638
4623
 
@@ -4654,10 +4639,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4654
4639
  }
4655
4640
  }
4656
4641
 
4657
- Py_DECREF(result);
4642
+ Py_DECREF_IMMORTAL(result);
4658
4643
  }
4659
4644
 
4660
- f = RICHCOMPARE(type2);
4645
+ f = TP_RICHCOMPARE(type2);
4661
4646
  if (f != NULL) {
4662
4647
  PyObject *result = (*f)(operand2, operand1, Py_GE);
4663
4648
 
@@ -4675,7 +4660,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4675
4660
  }
4676
4661
  }
4677
4662
 
4678
- Py_DECREF(result);
4663
+ Py_DECREF_IMMORTAL(result);
4679
4664
  }
4680
4665
 
4681
4666
  int c;
@@ -4770,7 +4755,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4770
4755
  richcmpfunc f;
4771
4756
 
4772
4757
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4773
- f = RICHCOMPARE(type2);
4758
+ f = TP_RICHCOMPARE(type2);
4774
4759
 
4775
4760
  if (f != NULL) {
4776
4761
  checked_reverse_op = true;
@@ -4791,7 +4776,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4791
4776
  }
4792
4777
  }
4793
4778
 
4794
- Py_DECREF(result);
4779
+ Py_DECREF_IMMORTAL(result);
4795
4780
  }
4796
4781
  }
4797
4782
 
@@ -4814,11 +4799,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4814
4799
  }
4815
4800
  }
4816
4801
 
4817
- Py_DECREF(result);
4802
+ Py_DECREF_IMMORTAL(result);
4818
4803
  }
4819
4804
 
4820
4805
  if (checked_reverse_op == false) {
4821
- f = RICHCOMPARE(type2);
4806
+ f = TP_RICHCOMPARE(type2);
4822
4807
 
4823
4808
  if (f != NULL) {
4824
4809
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -4837,7 +4822,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4837
4822
  }
4838
4823
  }
4839
4824
 
4840
- Py_DECREF(result);
4825
+ Py_DECREF_IMMORTAL(result);
4841
4826
  }
4842
4827
  }
4843
4828
 
@@ -4905,7 +4890,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4905
4890
  return result;
4906
4891
  }
4907
4892
 
4908
- Py_DECREF(result);
4893
+ Py_DECREF_IMMORTAL(result);
4909
4894
  }
4910
4895
 
4911
4896
  // No rich comparison worked, but maybe compare works.
@@ -4946,7 +4931,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4946
4931
 
4947
4932
  bool r = c != 0;
4948
4933
  PyObject *result = BOOL_FROM(r);
4949
- Py_INCREF(result);
4934
+ Py_INCREF_IMMORTAL(result);
4950
4935
  return result;
4951
4936
  }
4952
4937
  }
@@ -4966,11 +4951,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4966
4951
  return result;
4967
4952
  }
4968
4953
 
4969
- Py_DECREF(result);
4954
+ Py_DECREF_IMMORTAL(result);
4970
4955
  }
4971
4956
  }
4972
4957
 
4973
- f = RICHCOMPARE(type1);
4958
+ f = TP_RICHCOMPARE(type1);
4974
4959
  if (f != NULL) {
4975
4960
  PyObject *result = (*f)(operand1, operand2, Py_LE);
4976
4961
 
@@ -4980,7 +4965,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4980
4965
  return result;
4981
4966
  }
4982
4967
 
4983
- Py_DECREF(result);
4968
+ Py_DECREF_IMMORTAL(result);
4984
4969
  }
4985
4970
 
4986
4971
  f = NULL;
@@ -4993,7 +4978,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4993
4978
  return result;
4994
4979
  }
4995
4980
 
4996
- Py_DECREF(result);
4981
+ Py_DECREF_IMMORTAL(result);
4997
4982
  }
4998
4983
 
4999
4984
  int c;
@@ -5081,7 +5066,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5081
5066
 
5082
5067
  bool r = c != 0;
5083
5068
  PyObject *result = BOOL_FROM(r);
5084
- Py_INCREF(result);
5069
+ Py_INCREF_IMMORTAL(result);
5085
5070
  return result;
5086
5071
  #else
5087
5072
  bool checked_reverse_op = false;
@@ -5101,11 +5086,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5101
5086
  return result;
5102
5087
  }
5103
5088
 
5104
- Py_DECREF(result);
5089
+ Py_DECREF_IMMORTAL(result);
5105
5090
  }
5106
5091
  }
5107
5092
 
5108
- f = RICHCOMPARE(type1);
5093
+ f = TP_RICHCOMPARE(type1);
5109
5094
 
5110
5095
  if (f != NULL) {
5111
5096
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -5116,7 +5101,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5116
5101
  return result;
5117
5102
  }
5118
5103
 
5119
- Py_DECREF(result);
5104
+ Py_DECREF_IMMORTAL(result);
5120
5105
  }
5121
5106
 
5122
5107
  if (checked_reverse_op == false) {
@@ -5131,7 +5116,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5131
5116
  return result;
5132
5117
  }
5133
5118
 
5134
- Py_DECREF(result);
5119
+ Py_DECREF_IMMORTAL(result);
5135
5120
  }
5136
5121
  }
5137
5122
 
@@ -5143,13 +5128,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5143
5128
  case Py_EQ: {
5144
5129
  bool r = operand1 == operand2;
5145
5130
  PyObject *result = BOOL_FROM(r);
5146
- Py_INCREF(result);
5131
+ Py_INCREF_IMMORTAL(result);
5147
5132
  return result;
5148
5133
  }
5149
5134
  case Py_NE: {
5150
5135
  bool r = operand1 != operand2;
5151
5136
  PyObject *result = BOOL_FROM(r);
5152
- Py_INCREF(result);
5137
+ Py_INCREF_IMMORTAL(result);
5153
5138
  return result;
5154
5139
  }
5155
5140
  default:
@@ -5199,7 +5184,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5199
5184
  return result;
5200
5185
  }
5201
5186
 
5202
- Py_DECREF(result);
5187
+ Py_DECREF_IMMORTAL(result);
5203
5188
  }
5204
5189
 
5205
5190
  // No rich comparison worked, but maybe compare works.
@@ -5240,7 +5225,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5240
5225
 
5241
5226
  bool r = c != 0;
5242
5227
  PyObject *result = BOOL_FROM(r);
5243
- Py_INCREF(result);
5228
+ Py_INCREF_IMMORTAL(result);
5244
5229
  return result;
5245
5230
  }
5246
5231
  }
@@ -5249,7 +5234,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5249
5234
  richcmpfunc f;
5250
5235
 
5251
5236
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5252
- f = RICHCOMPARE(type2);
5237
+ f = TP_RICHCOMPARE(type2);
5253
5238
 
5254
5239
  if (f != NULL) {
5255
5240
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -5260,7 +5245,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5260
5245
  return result;
5261
5246
  }
5262
5247
 
5263
- Py_DECREF(result);
5248
+ Py_DECREF_IMMORTAL(result);
5264
5249
  }
5265
5250
  }
5266
5251
 
@@ -5274,10 +5259,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5274
5259
  return result;
5275
5260
  }
5276
5261
 
5277
- Py_DECREF(result);
5262
+ Py_DECREF_IMMORTAL(result);
5278
5263
  }
5279
5264
 
5280
- f = RICHCOMPARE(type2);
5265
+ f = TP_RICHCOMPARE(type2);
5281
5266
  if (f != NULL) {
5282
5267
  PyObject *result = (*f)(operand2, operand1, Py_GE);
5283
5268
 
@@ -5287,7 +5272,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5287
5272
  return result;
5288
5273
  }
5289
5274
 
5290
- Py_DECREF(result);
5275
+ Py_DECREF_IMMORTAL(result);
5291
5276
  }
5292
5277
 
5293
5278
  int c;
@@ -5375,14 +5360,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5375
5360
 
5376
5361
  bool r = c != 0;
5377
5362
  PyObject *result = BOOL_FROM(r);
5378
- Py_INCREF(result);
5363
+ Py_INCREF_IMMORTAL(result);
5379
5364
  return result;
5380
5365
  #else
5381
5366
  bool checked_reverse_op = false;
5382
5367
  richcmpfunc f;
5383
5368
 
5384
5369
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5385
- f = RICHCOMPARE(type2);
5370
+ f = TP_RICHCOMPARE(type2);
5386
5371
 
5387
5372
  if (f != NULL) {
5388
5373
  checked_reverse_op = true;
@@ -5395,7 +5380,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5395
5380
  return result;
5396
5381
  }
5397
5382
 
5398
- Py_DECREF(result);
5383
+ Py_DECREF_IMMORTAL(result);
5399
5384
  }
5400
5385
  }
5401
5386
 
@@ -5410,11 +5395,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5410
5395
  return result;
5411
5396
  }
5412
5397
 
5413
- Py_DECREF(result);
5398
+ Py_DECREF_IMMORTAL(result);
5414
5399
  }
5415
5400
 
5416
5401
  if (checked_reverse_op == false) {
5417
- f = RICHCOMPARE(type2);
5402
+ f = TP_RICHCOMPARE(type2);
5418
5403
 
5419
5404
  if (f != NULL) {
5420
5405
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -5425,7 +5410,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5425
5410
  return result;
5426
5411
  }
5427
5412
 
5428
- Py_DECREF(result);
5413
+ Py_DECREF_IMMORTAL(result);
5429
5414
  }
5430
5415
  }
5431
5416
 
@@ -5437,13 +5422,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5437
5422
  case Py_EQ: {
5438
5423
  bool r = operand1 == operand2;
5439
5424
  PyObject *result = BOOL_FROM(r);
5440
- Py_INCREF(result);
5425
+ Py_INCREF_IMMORTAL(result);
5441
5426
  return result;
5442
5427
  }
5443
5428
  case Py_NE: {
5444
5429
  bool r = operand1 != operand2;
5445
5430
  PyObject *result = BOOL_FROM(r);
5446
- Py_INCREF(result);
5431
+ Py_INCREF_IMMORTAL(result);
5447
5432
  return result;
5448
5433
  }
5449
5434
  default:
@@ -5517,7 +5502,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5517
5502
  }
5518
5503
  }
5519
5504
 
5520
- Py_DECREF(result);
5505
+ Py_DECREF_IMMORTAL(result);
5521
5506
  }
5522
5507
 
5523
5508
  // No rich comparison worked, but maybe compare works.
@@ -5586,11 +5571,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5586
5571
  }
5587
5572
  }
5588
5573
 
5589
- Py_DECREF(result);
5574
+ Py_DECREF_IMMORTAL(result);
5590
5575
  }
5591
5576
  }
5592
5577
 
5593
- f = RICHCOMPARE(type1);
5578
+ f = TP_RICHCOMPARE(type1);
5594
5579
  if (f != NULL) {
5595
5580
  PyObject *result = (*f)(operand1, operand2, Py_LE);
5596
5581
 
@@ -5608,7 +5593,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5608
5593
  }
5609
5594
  }
5610
5595
 
5611
- Py_DECREF(result);
5596
+ Py_DECREF_IMMORTAL(result);
5612
5597
  }
5613
5598
 
5614
5599
  f = NULL;
@@ -5629,7 +5614,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5629
5614
  }
5630
5615
  }
5631
5616
 
5632
- Py_DECREF(result);
5617
+ Py_DECREF_IMMORTAL(result);
5633
5618
  }
5634
5619
 
5635
5620
  int c;
@@ -5745,11 +5730,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5745
5730
  }
5746
5731
  }
5747
5732
 
5748
- Py_DECREF(result);
5733
+ Py_DECREF_IMMORTAL(result);
5749
5734
  }
5750
5735
  }
5751
5736
 
5752
- f = RICHCOMPARE(type1);
5737
+ f = TP_RICHCOMPARE(type1);
5753
5738
 
5754
5739
  if (f != NULL) {
5755
5740
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -5768,7 +5753,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5768
5753
  }
5769
5754
  }
5770
5755
 
5771
- Py_DECREF(result);
5756
+ Py_DECREF_IMMORTAL(result);
5772
5757
  }
5773
5758
 
5774
5759
  if (checked_reverse_op == false) {
@@ -5791,7 +5776,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5791
5776
  }
5792
5777
  }
5793
5778
 
5794
- Py_DECREF(result);
5779
+ Py_DECREF_IMMORTAL(result);
5795
5780
  }
5796
5781
  }
5797
5782
 
@@ -5867,7 +5852,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5867
5852
  }
5868
5853
  }
5869
5854
 
5870
- Py_DECREF(result);
5855
+ Py_DECREF_IMMORTAL(result);
5871
5856
  }
5872
5857
 
5873
5858
  // No rich comparison worked, but maybe compare works.
@@ -5917,7 +5902,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5917
5902
  richcmpfunc f;
5918
5903
 
5919
5904
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5920
- f = RICHCOMPARE(type2);
5905
+ f = TP_RICHCOMPARE(type2);
5921
5906
 
5922
5907
  if (f != NULL) {
5923
5908
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -5936,7 +5921,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5936
5921
  }
5937
5922
  }
5938
5923
 
5939
- Py_DECREF(result);
5924
+ Py_DECREF_IMMORTAL(result);
5940
5925
  }
5941
5926
  }
5942
5927
 
@@ -5958,10 +5943,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5958
5943
  }
5959
5944
  }
5960
5945
 
5961
- Py_DECREF(result);
5946
+ Py_DECREF_IMMORTAL(result);
5962
5947
  }
5963
5948
 
5964
- f = RICHCOMPARE(type2);
5949
+ f = TP_RICHCOMPARE(type2);
5965
5950
  if (f != NULL) {
5966
5951
  PyObject *result = (*f)(operand2, operand1, Py_GE);
5967
5952
 
@@ -5979,7 +5964,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5979
5964
  }
5980
5965
  }
5981
5966
 
5982
- Py_DECREF(result);
5967
+ Py_DECREF_IMMORTAL(result);
5983
5968
  }
5984
5969
 
5985
5970
  int c;
@@ -6074,7 +6059,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6074
6059
  richcmpfunc f;
6075
6060
 
6076
6061
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
6077
- f = RICHCOMPARE(type2);
6062
+ f = TP_RICHCOMPARE(type2);
6078
6063
 
6079
6064
  if (f != NULL) {
6080
6065
  checked_reverse_op = true;
@@ -6095,7 +6080,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6095
6080
  }
6096
6081
  }
6097
6082
 
6098
- Py_DECREF(result);
6083
+ Py_DECREF_IMMORTAL(result);
6099
6084
  }
6100
6085
  }
6101
6086
 
@@ -6118,11 +6103,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6118
6103
  }
6119
6104
  }
6120
6105
 
6121
- Py_DECREF(result);
6106
+ Py_DECREF_IMMORTAL(result);
6122
6107
  }
6123
6108
 
6124
6109
  if (checked_reverse_op == false) {
6125
- f = RICHCOMPARE(type2);
6110
+ f = TP_RICHCOMPARE(type2);
6126
6111
 
6127
6112
  if (f != NULL) {
6128
6113
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -6141,7 +6126,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6141
6126
  }
6142
6127
  }
6143
6128
 
6144
- Py_DECREF(result);
6129
+ Py_DECREF_IMMORTAL(result);
6145
6130
  }
6146
6131
  }
6147
6132
 
@@ -6188,15 +6173,19 @@ static PyObject *COMPARE_LE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6188
6173
 
6189
6174
  if (operand1_long_object == operand2_long_object) {
6190
6175
  r = true;
6191
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6192
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;
6176
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6177
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6178
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) <
6179
+ 0;
6193
6180
  } else {
6194
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6181
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6195
6182
  r = true;
6196
6183
  while (--i >= 0) {
6197
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6198
- r = operand1_long_object->ob_digit[i] < operand2_long_object->ob_digit[i];
6199
- if (Py_SIZE(operand1_long_object) < 0) {
6184
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6185
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6186
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <
6187
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6188
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6200
6189
  r = !r;
6201
6190
  }
6202
6191
  break;
@@ -6206,7 +6195,7 @@ static PyObject *COMPARE_LE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6206
6195
 
6207
6196
  // Convert to target type.
6208
6197
  PyObject *result = BOOL_FROM(r);
6209
- Py_INCREF(result);
6198
+ Py_INCREF_IMMORTAL(result);
6210
6199
  return result;
6211
6200
  }
6212
6201
  /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
@@ -6243,7 +6232,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6243
6232
  return result;
6244
6233
  }
6245
6234
 
6246
- Py_DECREF(result);
6235
+ Py_DECREF_IMMORTAL(result);
6247
6236
  }
6248
6237
 
6249
6238
  // No rich comparison worked, but maybe compare works.
@@ -6284,7 +6273,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6284
6273
 
6285
6274
  bool r = c != 0;
6286
6275
  PyObject *result = BOOL_FROM(r);
6287
- Py_INCREF(result);
6276
+ Py_INCREF_IMMORTAL(result);
6288
6277
  return result;
6289
6278
  }
6290
6279
  }
@@ -6304,11 +6293,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6304
6293
  return result;
6305
6294
  }
6306
6295
 
6307
- Py_DECREF(result);
6296
+ Py_DECREF_IMMORTAL(result);
6308
6297
  }
6309
6298
  }
6310
6299
 
6311
- f = RICHCOMPARE(type1);
6300
+ f = TP_RICHCOMPARE(type1);
6312
6301
  if (f != NULL) {
6313
6302
  PyObject *result = (*f)(operand1, operand2, Py_LE);
6314
6303
 
@@ -6318,7 +6307,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6318
6307
  return result;
6319
6308
  }
6320
6309
 
6321
- Py_DECREF(result);
6310
+ Py_DECREF_IMMORTAL(result);
6322
6311
  }
6323
6312
 
6324
6313
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6331,7 +6320,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6331
6320
  return result;
6332
6321
  }
6333
6322
 
6334
- Py_DECREF(result);
6323
+ Py_DECREF_IMMORTAL(result);
6335
6324
  }
6336
6325
 
6337
6326
  int c;
@@ -6419,7 +6408,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6419
6408
 
6420
6409
  bool r = c != 0;
6421
6410
  PyObject *result = BOOL_FROM(r);
6422
- Py_INCREF(result);
6411
+ Py_INCREF_IMMORTAL(result);
6423
6412
  return result;
6424
6413
  #else
6425
6414
  bool checked_reverse_op = false;
@@ -6439,11 +6428,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6439
6428
  return result;
6440
6429
  }
6441
6430
 
6442
- Py_DECREF(result);
6431
+ Py_DECREF_IMMORTAL(result);
6443
6432
  }
6444
6433
  }
6445
6434
 
6446
- f = RICHCOMPARE(type1);
6435
+ f = TP_RICHCOMPARE(type1);
6447
6436
 
6448
6437
  if (f != NULL) {
6449
6438
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -6454,7 +6443,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6454
6443
  return result;
6455
6444
  }
6456
6445
 
6457
- Py_DECREF(result);
6446
+ Py_DECREF_IMMORTAL(result);
6458
6447
  }
6459
6448
 
6460
6449
  if (checked_reverse_op == false) {
@@ -6469,7 +6458,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6469
6458
  return result;
6470
6459
  }
6471
6460
 
6472
- Py_DECREF(result);
6461
+ Py_DECREF_IMMORTAL(result);
6473
6462
  }
6474
6463
  }
6475
6464
 
@@ -6481,13 +6470,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6481
6470
  case Py_EQ: {
6482
6471
  bool r = operand1 == operand2;
6483
6472
  PyObject *result = BOOL_FROM(r);
6484
- Py_INCREF(result);
6473
+ Py_INCREF_IMMORTAL(result);
6485
6474
  return result;
6486
6475
  }
6487
6476
  case Py_NE: {
6488
6477
  bool r = operand1 != operand2;
6489
6478
  PyObject *result = BOOL_FROM(r);
6490
- Py_INCREF(result);
6479
+ Py_INCREF_IMMORTAL(result);
6491
6480
  return result;
6492
6481
  }
6493
6482
  default:
@@ -6537,7 +6526,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6537
6526
  return result;
6538
6527
  }
6539
6528
 
6540
- Py_DECREF(result);
6529
+ Py_DECREF_IMMORTAL(result);
6541
6530
  }
6542
6531
 
6543
6532
  // No rich comparison worked, but maybe compare works.
@@ -6578,7 +6567,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6578
6567
 
6579
6568
  bool r = c != 0;
6580
6569
  PyObject *result = BOOL_FROM(r);
6581
- Py_INCREF(result);
6570
+ Py_INCREF_IMMORTAL(result);
6582
6571
  return result;
6583
6572
  }
6584
6573
  }
@@ -6587,7 +6576,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6587
6576
  richcmpfunc f;
6588
6577
 
6589
6578
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6590
- f = RICHCOMPARE(type2);
6579
+ f = TP_RICHCOMPARE(type2);
6591
6580
 
6592
6581
  if (f != NULL) {
6593
6582
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -6598,7 +6587,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6598
6587
  return result;
6599
6588
  }
6600
6589
 
6601
- Py_DECREF(result);
6590
+ Py_DECREF_IMMORTAL(result);
6602
6591
  }
6603
6592
  }
6604
6593
 
@@ -6612,10 +6601,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6612
6601
  return result;
6613
6602
  }
6614
6603
 
6615
- Py_DECREF(result);
6604
+ Py_DECREF_IMMORTAL(result);
6616
6605
  }
6617
6606
 
6618
- f = RICHCOMPARE(type2);
6607
+ f = TP_RICHCOMPARE(type2);
6619
6608
  if (f != NULL) {
6620
6609
  PyObject *result = (*f)(operand2, operand1, Py_GE);
6621
6610
 
@@ -6625,7 +6614,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6625
6614
  return result;
6626
6615
  }
6627
6616
 
6628
- Py_DECREF(result);
6617
+ Py_DECREF_IMMORTAL(result);
6629
6618
  }
6630
6619
 
6631
6620
  int c;
@@ -6713,14 +6702,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6713
6702
 
6714
6703
  bool r = c != 0;
6715
6704
  PyObject *result = BOOL_FROM(r);
6716
- Py_INCREF(result);
6705
+ Py_INCREF_IMMORTAL(result);
6717
6706
  return result;
6718
6707
  #else
6719
6708
  bool checked_reverse_op = false;
6720
6709
  richcmpfunc f;
6721
6710
 
6722
6711
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6723
- f = RICHCOMPARE(type2);
6712
+ f = TP_RICHCOMPARE(type2);
6724
6713
 
6725
6714
  if (f != NULL) {
6726
6715
  checked_reverse_op = true;
@@ -6733,7 +6722,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6733
6722
  return result;
6734
6723
  }
6735
6724
 
6736
- Py_DECREF(result);
6725
+ Py_DECREF_IMMORTAL(result);
6737
6726
  }
6738
6727
  }
6739
6728
 
@@ -6748,11 +6737,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6748
6737
  return result;
6749
6738
  }
6750
6739
 
6751
- Py_DECREF(result);
6740
+ Py_DECREF_IMMORTAL(result);
6752
6741
  }
6753
6742
 
6754
6743
  if (checked_reverse_op == false) {
6755
- f = RICHCOMPARE(type2);
6744
+ f = TP_RICHCOMPARE(type2);
6756
6745
 
6757
6746
  if (f != NULL) {
6758
6747
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -6763,7 +6752,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6763
6752
  return result;
6764
6753
  }
6765
6754
 
6766
- Py_DECREF(result);
6755
+ Py_DECREF_IMMORTAL(result);
6767
6756
  }
6768
6757
  }
6769
6758
 
@@ -6775,13 +6764,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6775
6764
  case Py_EQ: {
6776
6765
  bool r = operand1 == operand2;
6777
6766
  PyObject *result = BOOL_FROM(r);
6778
- Py_INCREF(result);
6767
+ Py_INCREF_IMMORTAL(result);
6779
6768
  return result;
6780
6769
  }
6781
6770
  case Py_NE: {
6782
6771
  bool r = operand1 != operand2;
6783
6772
  PyObject *result = BOOL_FROM(r);
6784
- Py_INCREF(result);
6773
+ Py_INCREF_IMMORTAL(result);
6785
6774
  return result;
6786
6775
  }
6787
6776
  default:
@@ -6817,15 +6806,19 @@ static bool COMPARE_LE_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
6817
6806
 
6818
6807
  if (operand1_long_object == operand2_long_object) {
6819
6808
  r = true;
6820
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6821
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;
6809
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6810
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6811
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) <
6812
+ 0;
6822
6813
  } else {
6823
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6814
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6824
6815
  r = true;
6825
6816
  while (--i >= 0) {
6826
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6827
- r = operand1_long_object->ob_digit[i] < operand2_long_object->ob_digit[i];
6828
- if (Py_SIZE(operand1_long_object) < 0) {
6817
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6818
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6819
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <
6820
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6821
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6829
6822
  r = !r;
6830
6823
  }
6831
6824
  break;
@@ -6886,7 +6879,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6886
6879
  }
6887
6880
  }
6888
6881
 
6889
- Py_DECREF(result);
6882
+ Py_DECREF_IMMORTAL(result);
6890
6883
  }
6891
6884
 
6892
6885
  // No rich comparison worked, but maybe compare works.
@@ -6955,11 +6948,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6955
6948
  }
6956
6949
  }
6957
6950
 
6958
- Py_DECREF(result);
6951
+ Py_DECREF_IMMORTAL(result);
6959
6952
  }
6960
6953
  }
6961
6954
 
6962
- f = RICHCOMPARE(type1);
6955
+ f = TP_RICHCOMPARE(type1);
6963
6956
  if (f != NULL) {
6964
6957
  PyObject *result = (*f)(operand1, operand2, Py_LE);
6965
6958
 
@@ -6977,7 +6970,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6977
6970
  }
6978
6971
  }
6979
6972
 
6980
- Py_DECREF(result);
6973
+ Py_DECREF_IMMORTAL(result);
6981
6974
  }
6982
6975
 
6983
6976
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6998,7 +6991,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6998
6991
  }
6999
6992
  }
7000
6993
 
7001
- Py_DECREF(result);
6994
+ Py_DECREF_IMMORTAL(result);
7002
6995
  }
7003
6996
 
7004
6997
  int c;
@@ -7114,11 +7107,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7114
7107
  }
7115
7108
  }
7116
7109
 
7117
- Py_DECREF(result);
7110
+ Py_DECREF_IMMORTAL(result);
7118
7111
  }
7119
7112
  }
7120
7113
 
7121
- f = RICHCOMPARE(type1);
7114
+ f = TP_RICHCOMPARE(type1);
7122
7115
 
7123
7116
  if (f != NULL) {
7124
7117
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -7137,7 +7130,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7137
7130
  }
7138
7131
  }
7139
7132
 
7140
- Py_DECREF(result);
7133
+ Py_DECREF_IMMORTAL(result);
7141
7134
  }
7142
7135
 
7143
7136
  if (checked_reverse_op == false) {
@@ -7160,7 +7153,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7160
7153
  }
7161
7154
  }
7162
7155
 
7163
- Py_DECREF(result);
7156
+ Py_DECREF_IMMORTAL(result);
7164
7157
  }
7165
7158
  }
7166
7159
 
@@ -7236,7 +7229,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7236
7229
  }
7237
7230
  }
7238
7231
 
7239
- Py_DECREF(result);
7232
+ Py_DECREF_IMMORTAL(result);
7240
7233
  }
7241
7234
 
7242
7235
  // No rich comparison worked, but maybe compare works.
@@ -7286,7 +7279,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7286
7279
  richcmpfunc f;
7287
7280
 
7288
7281
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7289
- f = RICHCOMPARE(type2);
7282
+ f = TP_RICHCOMPARE(type2);
7290
7283
 
7291
7284
  if (f != NULL) {
7292
7285
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -7305,7 +7298,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7305
7298
  }
7306
7299
  }
7307
7300
 
7308
- Py_DECREF(result);
7301
+ Py_DECREF_IMMORTAL(result);
7309
7302
  }
7310
7303
  }
7311
7304
 
@@ -7327,10 +7320,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7327
7320
  }
7328
7321
  }
7329
7322
 
7330
- Py_DECREF(result);
7323
+ Py_DECREF_IMMORTAL(result);
7331
7324
  }
7332
7325
 
7333
- f = RICHCOMPARE(type2);
7326
+ f = TP_RICHCOMPARE(type2);
7334
7327
  if (f != NULL) {
7335
7328
  PyObject *result = (*f)(operand2, operand1, Py_GE);
7336
7329
 
@@ -7348,7 +7341,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7348
7341
  }
7349
7342
  }
7350
7343
 
7351
- Py_DECREF(result);
7344
+ Py_DECREF_IMMORTAL(result);
7352
7345
  }
7353
7346
 
7354
7347
  int c;
@@ -7443,7 +7436,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7443
7436
  richcmpfunc f;
7444
7437
 
7445
7438
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7446
- f = RICHCOMPARE(type2);
7439
+ f = TP_RICHCOMPARE(type2);
7447
7440
 
7448
7441
  if (f != NULL) {
7449
7442
  checked_reverse_op = true;
@@ -7464,7 +7457,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7464
7457
  }
7465
7458
  }
7466
7459
 
7467
- Py_DECREF(result);
7460
+ Py_DECREF_IMMORTAL(result);
7468
7461
  }
7469
7462
  }
7470
7463
 
@@ -7487,11 +7480,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7487
7480
  }
7488
7481
  }
7489
7482
 
7490
- Py_DECREF(result);
7483
+ Py_DECREF_IMMORTAL(result);
7491
7484
  }
7492
7485
 
7493
7486
  if (checked_reverse_op == false) {
7494
- f = RICHCOMPARE(type2);
7487
+ f = TP_RICHCOMPARE(type2);
7495
7488
 
7496
7489
  if (f != NULL) {
7497
7490
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -7510,7 +7503,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7510
7503
  }
7511
7504
  }
7512
7505
 
7513
- Py_DECREF(result);
7506
+ Py_DECREF_IMMORTAL(result);
7514
7507
  }
7515
7508
  }
7516
7509
 
@@ -7557,7 +7550,7 @@ static PyObject *COMPARE_LE_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *ope
7557
7550
 
7558
7551
  // Convert to target type.
7559
7552
  PyObject *result = BOOL_FROM(r);
7560
- Py_INCREF(result);
7553
+ Py_INCREF_IMMORTAL(result);
7561
7554
  return result;
7562
7555
  }
7563
7556
  /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
@@ -7594,7 +7587,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7594
7587
  return result;
7595
7588
  }
7596
7589
 
7597
- Py_DECREF(result);
7590
+ Py_DECREF_IMMORTAL(result);
7598
7591
  }
7599
7592
 
7600
7593
  // No rich comparison worked, but maybe compare works.
@@ -7635,7 +7628,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7635
7628
 
7636
7629
  bool r = c != 0;
7637
7630
  PyObject *result = BOOL_FROM(r);
7638
- Py_INCREF(result);
7631
+ Py_INCREF_IMMORTAL(result);
7639
7632
  return result;
7640
7633
  }
7641
7634
  }
@@ -7655,11 +7648,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7655
7648
  return result;
7656
7649
  }
7657
7650
 
7658
- Py_DECREF(result);
7651
+ Py_DECREF_IMMORTAL(result);
7659
7652
  }
7660
7653
  }
7661
7654
 
7662
- f = RICHCOMPARE(type1);
7655
+ f = TP_RICHCOMPARE(type1);
7663
7656
  if (f != NULL) {
7664
7657
  PyObject *result = (*f)(operand1, operand2, Py_LE);
7665
7658
 
@@ -7669,7 +7662,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7669
7662
  return result;
7670
7663
  }
7671
7664
 
7672
- Py_DECREF(result);
7665
+ Py_DECREF_IMMORTAL(result);
7673
7666
  }
7674
7667
 
7675
7668
  f = PyFloat_Type.tp_richcompare;
@@ -7682,7 +7675,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7682
7675
  return result;
7683
7676
  }
7684
7677
 
7685
- Py_DECREF(result);
7678
+ Py_DECREF_IMMORTAL(result);
7686
7679
  }
7687
7680
 
7688
7681
  int c;
@@ -7770,7 +7763,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7770
7763
 
7771
7764
  bool r = c != 0;
7772
7765
  PyObject *result = BOOL_FROM(r);
7773
- Py_INCREF(result);
7766
+ Py_INCREF_IMMORTAL(result);
7774
7767
  return result;
7775
7768
  #else
7776
7769
  bool checked_reverse_op = false;
@@ -7790,11 +7783,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7790
7783
  return result;
7791
7784
  }
7792
7785
 
7793
- Py_DECREF(result);
7786
+ Py_DECREF_IMMORTAL(result);
7794
7787
  }
7795
7788
  }
7796
7789
 
7797
- f = RICHCOMPARE(type1);
7790
+ f = TP_RICHCOMPARE(type1);
7798
7791
 
7799
7792
  if (f != NULL) {
7800
7793
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -7805,7 +7798,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7805
7798
  return result;
7806
7799
  }
7807
7800
 
7808
- Py_DECREF(result);
7801
+ Py_DECREF_IMMORTAL(result);
7809
7802
  }
7810
7803
 
7811
7804
  if (checked_reverse_op == false) {
@@ -7820,7 +7813,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7820
7813
  return result;
7821
7814
  }
7822
7815
 
7823
- Py_DECREF(result);
7816
+ Py_DECREF_IMMORTAL(result);
7824
7817
  }
7825
7818
  }
7826
7819
 
@@ -7832,13 +7825,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7832
7825
  case Py_EQ: {
7833
7826
  bool r = operand1 == operand2;
7834
7827
  PyObject *result = BOOL_FROM(r);
7835
- Py_INCREF(result);
7828
+ Py_INCREF_IMMORTAL(result);
7836
7829
  return result;
7837
7830
  }
7838
7831
  case Py_NE: {
7839
7832
  bool r = operand1 != operand2;
7840
7833
  PyObject *result = BOOL_FROM(r);
7841
- Py_INCREF(result);
7834
+ Py_INCREF_IMMORTAL(result);
7842
7835
  return result;
7843
7836
  }
7844
7837
  default:
@@ -7886,7 +7879,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7886
7879
  return result;
7887
7880
  }
7888
7881
 
7889
- Py_DECREF(result);
7882
+ Py_DECREF_IMMORTAL(result);
7890
7883
  }
7891
7884
 
7892
7885
  // No rich comparison worked, but maybe compare works.
@@ -7927,7 +7920,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7927
7920
 
7928
7921
  bool r = c != 0;
7929
7922
  PyObject *result = BOOL_FROM(r);
7930
- Py_INCREF(result);
7923
+ Py_INCREF_IMMORTAL(result);
7931
7924
  return result;
7932
7925
  }
7933
7926
  }
@@ -7936,7 +7929,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7936
7929
  richcmpfunc f;
7937
7930
 
7938
7931
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
7939
- f = RICHCOMPARE(type2);
7932
+ f = TP_RICHCOMPARE(type2);
7940
7933
 
7941
7934
  if (f != NULL) {
7942
7935
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -7947,7 +7940,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7947
7940
  return result;
7948
7941
  }
7949
7942
 
7950
- Py_DECREF(result);
7943
+ Py_DECREF_IMMORTAL(result);
7951
7944
  }
7952
7945
  }
7953
7946
 
@@ -7961,10 +7954,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7961
7954
  return result;
7962
7955
  }
7963
7956
 
7964
- Py_DECREF(result);
7957
+ Py_DECREF_IMMORTAL(result);
7965
7958
  }
7966
7959
 
7967
- f = RICHCOMPARE(type2);
7960
+ f = TP_RICHCOMPARE(type2);
7968
7961
  if (f != NULL) {
7969
7962
  PyObject *result = (*f)(operand2, operand1, Py_GE);
7970
7963
 
@@ -7974,7 +7967,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7974
7967
  return result;
7975
7968
  }
7976
7969
 
7977
- Py_DECREF(result);
7970
+ Py_DECREF_IMMORTAL(result);
7978
7971
  }
7979
7972
 
7980
7973
  int c;
@@ -8062,14 +8055,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8062
8055
 
8063
8056
  bool r = c != 0;
8064
8057
  PyObject *result = BOOL_FROM(r);
8065
- Py_INCREF(result);
8058
+ Py_INCREF_IMMORTAL(result);
8066
8059
  return result;
8067
8060
  #else
8068
8061
  bool checked_reverse_op = false;
8069
8062
  richcmpfunc f;
8070
8063
 
8071
8064
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8072
- f = RICHCOMPARE(type2);
8065
+ f = TP_RICHCOMPARE(type2);
8073
8066
 
8074
8067
  if (f != NULL) {
8075
8068
  checked_reverse_op = true;
@@ -8082,7 +8075,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8082
8075
  return result;
8083
8076
  }
8084
8077
 
8085
- Py_DECREF(result);
8078
+ Py_DECREF_IMMORTAL(result);
8086
8079
  }
8087
8080
  }
8088
8081
 
@@ -8097,11 +8090,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8097
8090
  return result;
8098
8091
  }
8099
8092
 
8100
- Py_DECREF(result);
8093
+ Py_DECREF_IMMORTAL(result);
8101
8094
  }
8102
8095
 
8103
8096
  if (checked_reverse_op == false) {
8104
- f = RICHCOMPARE(type2);
8097
+ f = TP_RICHCOMPARE(type2);
8105
8098
 
8106
8099
  if (f != NULL) {
8107
8100
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -8112,7 +8105,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8112
8105
  return result;
8113
8106
  }
8114
8107
 
8115
- Py_DECREF(result);
8108
+ Py_DECREF_IMMORTAL(result);
8116
8109
  }
8117
8110
  }
8118
8111
 
@@ -8124,13 +8117,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8124
8117
  case Py_EQ: {
8125
8118
  bool r = operand1 == operand2;
8126
8119
  PyObject *result = BOOL_FROM(r);
8127
- Py_INCREF(result);
8120
+ Py_INCREF_IMMORTAL(result);
8128
8121
  return result;
8129
8122
  }
8130
8123
  case Py_NE: {
8131
8124
  bool r = operand1 != operand2;
8132
8125
  PyObject *result = BOOL_FROM(r);
8133
- Py_INCREF(result);
8126
+ Py_INCREF_IMMORTAL(result);
8134
8127
  return result;
8135
8128
  }
8136
8129
  default:
@@ -8214,7 +8207,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8214
8207
  }
8215
8208
  }
8216
8209
 
8217
- Py_DECREF(result);
8210
+ Py_DECREF_IMMORTAL(result);
8218
8211
  }
8219
8212
 
8220
8213
  // No rich comparison worked, but maybe compare works.
@@ -8283,11 +8276,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8283
8276
  }
8284
8277
  }
8285
8278
 
8286
- Py_DECREF(result);
8279
+ Py_DECREF_IMMORTAL(result);
8287
8280
  }
8288
8281
  }
8289
8282
 
8290
- f = RICHCOMPARE(type1);
8283
+ f = TP_RICHCOMPARE(type1);
8291
8284
  if (f != NULL) {
8292
8285
  PyObject *result = (*f)(operand1, operand2, Py_LE);
8293
8286
 
@@ -8305,7 +8298,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8305
8298
  }
8306
8299
  }
8307
8300
 
8308
- Py_DECREF(result);
8301
+ Py_DECREF_IMMORTAL(result);
8309
8302
  }
8310
8303
 
8311
8304
  f = PyFloat_Type.tp_richcompare;
@@ -8326,7 +8319,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8326
8319
  }
8327
8320
  }
8328
8321
 
8329
- Py_DECREF(result);
8322
+ Py_DECREF_IMMORTAL(result);
8330
8323
  }
8331
8324
 
8332
8325
  int c;
@@ -8442,11 +8435,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8442
8435
  }
8443
8436
  }
8444
8437
 
8445
- Py_DECREF(result);
8438
+ Py_DECREF_IMMORTAL(result);
8446
8439
  }
8447
8440
  }
8448
8441
 
8449
- f = RICHCOMPARE(type1);
8442
+ f = TP_RICHCOMPARE(type1);
8450
8443
 
8451
8444
  if (f != NULL) {
8452
8445
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -8465,7 +8458,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8465
8458
  }
8466
8459
  }
8467
8460
 
8468
- Py_DECREF(result);
8461
+ Py_DECREF_IMMORTAL(result);
8469
8462
  }
8470
8463
 
8471
8464
  if (checked_reverse_op == false) {
@@ -8488,7 +8481,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8488
8481
  }
8489
8482
  }
8490
8483
 
8491
- Py_DECREF(result);
8484
+ Py_DECREF_IMMORTAL(result);
8492
8485
  }
8493
8486
  }
8494
8487
 
@@ -8562,7 +8555,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8562
8555
  }
8563
8556
  }
8564
8557
 
8565
- Py_DECREF(result);
8558
+ Py_DECREF_IMMORTAL(result);
8566
8559
  }
8567
8560
 
8568
8561
  // No rich comparison worked, but maybe compare works.
@@ -8612,7 +8605,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8612
8605
  richcmpfunc f;
8613
8606
 
8614
8607
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8615
- f = RICHCOMPARE(type2);
8608
+ f = TP_RICHCOMPARE(type2);
8616
8609
 
8617
8610
  if (f != NULL) {
8618
8611
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -8631,7 +8624,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8631
8624
  }
8632
8625
  }
8633
8626
 
8634
- Py_DECREF(result);
8627
+ Py_DECREF_IMMORTAL(result);
8635
8628
  }
8636
8629
  }
8637
8630
 
@@ -8653,10 +8646,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8653
8646
  }
8654
8647
  }
8655
8648
 
8656
- Py_DECREF(result);
8649
+ Py_DECREF_IMMORTAL(result);
8657
8650
  }
8658
8651
 
8659
- f = RICHCOMPARE(type2);
8652
+ f = TP_RICHCOMPARE(type2);
8660
8653
  if (f != NULL) {
8661
8654
  PyObject *result = (*f)(operand2, operand1, Py_GE);
8662
8655
 
@@ -8674,7 +8667,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8674
8667
  }
8675
8668
  }
8676
8669
 
8677
- Py_DECREF(result);
8670
+ Py_DECREF_IMMORTAL(result);
8678
8671
  }
8679
8672
 
8680
8673
  int c;
@@ -8769,7 +8762,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8769
8762
  richcmpfunc f;
8770
8763
 
8771
8764
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8772
- f = RICHCOMPARE(type2);
8765
+ f = TP_RICHCOMPARE(type2);
8773
8766
 
8774
8767
  if (f != NULL) {
8775
8768
  checked_reverse_op = true;
@@ -8790,7 +8783,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8790
8783
  }
8791
8784
  }
8792
8785
 
8793
- Py_DECREF(result);
8786
+ Py_DECREF_IMMORTAL(result);
8794
8787
  }
8795
8788
  }
8796
8789
 
@@ -8813,11 +8806,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8813
8806
  }
8814
8807
  }
8815
8808
 
8816
- Py_DECREF(result);
8809
+ Py_DECREF_IMMORTAL(result);
8817
8810
  }
8818
8811
 
8819
8812
  if (checked_reverse_op == false) {
8820
- f = RICHCOMPARE(type2);
8813
+ f = TP_RICHCOMPARE(type2);
8821
8814
 
8822
8815
  if (f != NULL) {
8823
8816
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -8836,7 +8829,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8836
8829
  }
8837
8830
  }
8838
8831
 
8839
- Py_DECREF(result);
8832
+ Py_DECREF_IMMORTAL(result);
8840
8833
  }
8841
8834
  }
8842
8835
 
@@ -8909,7 +8902,7 @@ static PyObject *COMPARE_LE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *ope
8909
8902
 
8910
8903
  // Convert to target type.
8911
8904
  PyObject *result = BOOL_FROM(r);
8912
- Py_INCREF(result);
8905
+ Py_INCREF_IMMORTAL(result);
8913
8906
  return result;
8914
8907
  }
8915
8908
 
@@ -8949,7 +8942,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8949
8942
  return result;
8950
8943
  }
8951
8944
 
8952
- Py_DECREF(result);
8945
+ Py_DECREF_IMMORTAL(result);
8953
8946
  }
8954
8947
 
8955
8948
  // No rich comparison worked, but maybe compare works.
@@ -8990,7 +8983,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8990
8983
 
8991
8984
  bool r = c != 0;
8992
8985
  PyObject *result = BOOL_FROM(r);
8993
- Py_INCREF(result);
8986
+ Py_INCREF_IMMORTAL(result);
8994
8987
  return result;
8995
8988
  }
8996
8989
  }
@@ -9010,11 +9003,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9010
9003
  return result;
9011
9004
  }
9012
9005
 
9013
- Py_DECREF(result);
9006
+ Py_DECREF_IMMORTAL(result);
9014
9007
  }
9015
9008
  }
9016
9009
 
9017
- f = RICHCOMPARE(type1);
9010
+ f = TP_RICHCOMPARE(type1);
9018
9011
  if (f != NULL) {
9019
9012
  PyObject *result = (*f)(operand1, operand2, Py_LE);
9020
9013
 
@@ -9024,7 +9017,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9024
9017
  return result;
9025
9018
  }
9026
9019
 
9027
- Py_DECREF(result);
9020
+ Py_DECREF_IMMORTAL(result);
9028
9021
  }
9029
9022
 
9030
9023
  f = PyTuple_Type.tp_richcompare;
@@ -9037,7 +9030,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9037
9030
  return result;
9038
9031
  }
9039
9032
 
9040
- Py_DECREF(result);
9033
+ Py_DECREF_IMMORTAL(result);
9041
9034
  }
9042
9035
 
9043
9036
  int c;
@@ -9125,7 +9118,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9125
9118
 
9126
9119
  bool r = c != 0;
9127
9120
  PyObject *result = BOOL_FROM(r);
9128
- Py_INCREF(result);
9121
+ Py_INCREF_IMMORTAL(result);
9129
9122
  return result;
9130
9123
  #else
9131
9124
  bool checked_reverse_op = false;
@@ -9145,11 +9138,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9145
9138
  return result;
9146
9139
  }
9147
9140
 
9148
- Py_DECREF(result);
9141
+ Py_DECREF_IMMORTAL(result);
9149
9142
  }
9150
9143
  }
9151
9144
 
9152
- f = RICHCOMPARE(type1);
9145
+ f = TP_RICHCOMPARE(type1);
9153
9146
 
9154
9147
  if (f != NULL) {
9155
9148
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -9160,7 +9153,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9160
9153
  return result;
9161
9154
  }
9162
9155
 
9163
- Py_DECREF(result);
9156
+ Py_DECREF_IMMORTAL(result);
9164
9157
  }
9165
9158
 
9166
9159
  if (checked_reverse_op == false) {
@@ -9175,7 +9168,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9175
9168
  return result;
9176
9169
  }
9177
9170
 
9178
- Py_DECREF(result);
9171
+ Py_DECREF_IMMORTAL(result);
9179
9172
  }
9180
9173
  }
9181
9174
 
@@ -9187,13 +9180,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9187
9180
  case Py_EQ: {
9188
9181
  bool r = operand1 == operand2;
9189
9182
  PyObject *result = BOOL_FROM(r);
9190
- Py_INCREF(result);
9183
+ Py_INCREF_IMMORTAL(result);
9191
9184
  return result;
9192
9185
  }
9193
9186
  case Py_NE: {
9194
9187
  bool r = operand1 != operand2;
9195
9188
  PyObject *result = BOOL_FROM(r);
9196
- Py_INCREF(result);
9189
+ Py_INCREF_IMMORTAL(result);
9197
9190
  return result;
9198
9191
  }
9199
9192
  default:
@@ -9241,7 +9234,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9241
9234
  return result;
9242
9235
  }
9243
9236
 
9244
- Py_DECREF(result);
9237
+ Py_DECREF_IMMORTAL(result);
9245
9238
  }
9246
9239
 
9247
9240
  // No rich comparison worked, but maybe compare works.
@@ -9282,7 +9275,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9282
9275
 
9283
9276
  bool r = c != 0;
9284
9277
  PyObject *result = BOOL_FROM(r);
9285
- Py_INCREF(result);
9278
+ Py_INCREF_IMMORTAL(result);
9286
9279
  return result;
9287
9280
  }
9288
9281
  }
@@ -9291,7 +9284,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9291
9284
  richcmpfunc f;
9292
9285
 
9293
9286
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9294
- f = RICHCOMPARE(type2);
9287
+ f = TP_RICHCOMPARE(type2);
9295
9288
 
9296
9289
  if (f != NULL) {
9297
9290
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -9302,7 +9295,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9302
9295
  return result;
9303
9296
  }
9304
9297
 
9305
- Py_DECREF(result);
9298
+ Py_DECREF_IMMORTAL(result);
9306
9299
  }
9307
9300
  }
9308
9301
 
@@ -9316,10 +9309,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9316
9309
  return result;
9317
9310
  }
9318
9311
 
9319
- Py_DECREF(result);
9312
+ Py_DECREF_IMMORTAL(result);
9320
9313
  }
9321
9314
 
9322
- f = RICHCOMPARE(type2);
9315
+ f = TP_RICHCOMPARE(type2);
9323
9316
  if (f != NULL) {
9324
9317
  PyObject *result = (*f)(operand2, operand1, Py_GE);
9325
9318
 
@@ -9329,7 +9322,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9329
9322
  return result;
9330
9323
  }
9331
9324
 
9332
- Py_DECREF(result);
9325
+ Py_DECREF_IMMORTAL(result);
9333
9326
  }
9334
9327
 
9335
9328
  int c;
@@ -9417,14 +9410,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9417
9410
 
9418
9411
  bool r = c != 0;
9419
9412
  PyObject *result = BOOL_FROM(r);
9420
- Py_INCREF(result);
9413
+ Py_INCREF_IMMORTAL(result);
9421
9414
  return result;
9422
9415
  #else
9423
9416
  bool checked_reverse_op = false;
9424
9417
  richcmpfunc f;
9425
9418
 
9426
9419
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9427
- f = RICHCOMPARE(type2);
9420
+ f = TP_RICHCOMPARE(type2);
9428
9421
 
9429
9422
  if (f != NULL) {
9430
9423
  checked_reverse_op = true;
@@ -9437,7 +9430,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9437
9430
  return result;
9438
9431
  }
9439
9432
 
9440
- Py_DECREF(result);
9433
+ Py_DECREF_IMMORTAL(result);
9441
9434
  }
9442
9435
  }
9443
9436
 
@@ -9452,11 +9445,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9452
9445
  return result;
9453
9446
  }
9454
9447
 
9455
- Py_DECREF(result);
9448
+ Py_DECREF_IMMORTAL(result);
9456
9449
  }
9457
9450
 
9458
9451
  if (checked_reverse_op == false) {
9459
- f = RICHCOMPARE(type2);
9452
+ f = TP_RICHCOMPARE(type2);
9460
9453
 
9461
9454
  if (f != NULL) {
9462
9455
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -9467,7 +9460,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9467
9460
  return result;
9468
9461
  }
9469
9462
 
9470
- Py_DECREF(result);
9463
+ Py_DECREF_IMMORTAL(result);
9471
9464
  }
9472
9465
  }
9473
9466
 
@@ -9479,13 +9472,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9479
9472
  case Py_EQ: {
9480
9473
  bool r = operand1 == operand2;
9481
9474
  PyObject *result = BOOL_FROM(r);
9482
- Py_INCREF(result);
9475
+ Py_INCREF_IMMORTAL(result);
9483
9476
  return result;
9484
9477
  }
9485
9478
  case Py_NE: {
9486
9479
  bool r = operand1 != operand2;
9487
9480
  PyObject *result = BOOL_FROM(r);
9488
- Py_INCREF(result);
9481
+ Py_INCREF_IMMORTAL(result);
9489
9482
  return result;
9490
9483
  }
9491
9484
  default:
@@ -9594,7 +9587,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9594
9587
  }
9595
9588
  }
9596
9589
 
9597
- Py_DECREF(result);
9590
+ Py_DECREF_IMMORTAL(result);
9598
9591
  }
9599
9592
 
9600
9593
  // No rich comparison worked, but maybe compare works.
@@ -9663,11 +9656,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9663
9656
  }
9664
9657
  }
9665
9658
 
9666
- Py_DECREF(result);
9659
+ Py_DECREF_IMMORTAL(result);
9667
9660
  }
9668
9661
  }
9669
9662
 
9670
- f = RICHCOMPARE(type1);
9663
+ f = TP_RICHCOMPARE(type1);
9671
9664
  if (f != NULL) {
9672
9665
  PyObject *result = (*f)(operand1, operand2, Py_LE);
9673
9666
 
@@ -9685,7 +9678,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9685
9678
  }
9686
9679
  }
9687
9680
 
9688
- Py_DECREF(result);
9681
+ Py_DECREF_IMMORTAL(result);
9689
9682
  }
9690
9683
 
9691
9684
  f = PyTuple_Type.tp_richcompare;
@@ -9706,7 +9699,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9706
9699
  }
9707
9700
  }
9708
9701
 
9709
- Py_DECREF(result);
9702
+ Py_DECREF_IMMORTAL(result);
9710
9703
  }
9711
9704
 
9712
9705
  int c;
@@ -9822,11 +9815,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9822
9815
  }
9823
9816
  }
9824
9817
 
9825
- Py_DECREF(result);
9818
+ Py_DECREF_IMMORTAL(result);
9826
9819
  }
9827
9820
  }
9828
9821
 
9829
- f = RICHCOMPARE(type1);
9822
+ f = TP_RICHCOMPARE(type1);
9830
9823
 
9831
9824
  if (f != NULL) {
9832
9825
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -9845,7 +9838,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9845
9838
  }
9846
9839
  }
9847
9840
 
9848
- Py_DECREF(result);
9841
+ Py_DECREF_IMMORTAL(result);
9849
9842
  }
9850
9843
 
9851
9844
  if (checked_reverse_op == false) {
@@ -9868,7 +9861,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9868
9861
  }
9869
9862
  }
9870
9863
 
9871
- Py_DECREF(result);
9864
+ Py_DECREF_IMMORTAL(result);
9872
9865
  }
9873
9866
  }
9874
9867
 
@@ -9942,7 +9935,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9942
9935
  }
9943
9936
  }
9944
9937
 
9945
- Py_DECREF(result);
9938
+ Py_DECREF_IMMORTAL(result);
9946
9939
  }
9947
9940
 
9948
9941
  // No rich comparison worked, but maybe compare works.
@@ -9992,7 +9985,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9992
9985
  richcmpfunc f;
9993
9986
 
9994
9987
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9995
- f = RICHCOMPARE(type2);
9988
+ f = TP_RICHCOMPARE(type2);
9996
9989
 
9997
9990
  if (f != NULL) {
9998
9991
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -10011,7 +10004,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10011
10004
  }
10012
10005
  }
10013
10006
 
10014
- Py_DECREF(result);
10007
+ Py_DECREF_IMMORTAL(result);
10015
10008
  }
10016
10009
  }
10017
10010
 
@@ -10033,10 +10026,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10033
10026
  }
10034
10027
  }
10035
10028
 
10036
- Py_DECREF(result);
10029
+ Py_DECREF_IMMORTAL(result);
10037
10030
  }
10038
10031
 
10039
- f = RICHCOMPARE(type2);
10032
+ f = TP_RICHCOMPARE(type2);
10040
10033
  if (f != NULL) {
10041
10034
  PyObject *result = (*f)(operand2, operand1, Py_GE);
10042
10035
 
@@ -10054,7 +10047,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10054
10047
  }
10055
10048
  }
10056
10049
 
10057
- Py_DECREF(result);
10050
+ Py_DECREF_IMMORTAL(result);
10058
10051
  }
10059
10052
 
10060
10053
  int c;
@@ -10149,7 +10142,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10149
10142
  richcmpfunc f;
10150
10143
 
10151
10144
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
10152
- f = RICHCOMPARE(type2);
10145
+ f = TP_RICHCOMPARE(type2);
10153
10146
 
10154
10147
  if (f != NULL) {
10155
10148
  checked_reverse_op = true;
@@ -10170,7 +10163,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10170
10163
  }
10171
10164
  }
10172
10165
 
10173
- Py_DECREF(result);
10166
+ Py_DECREF_IMMORTAL(result);
10174
10167
  }
10175
10168
  }
10176
10169
 
@@ -10193,11 +10186,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10193
10186
  }
10194
10187
  }
10195
10188
 
10196
- Py_DECREF(result);
10189
+ Py_DECREF_IMMORTAL(result);
10197
10190
  }
10198
10191
 
10199
10192
  if (checked_reverse_op == false) {
10200
- f = RICHCOMPARE(type2);
10193
+ f = TP_RICHCOMPARE(type2);
10201
10194
 
10202
10195
  if (f != NULL) {
10203
10196
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -10216,7 +10209,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10216
10209
  }
10217
10210
  }
10218
10211
 
10219
- Py_DECREF(result);
10212
+ Py_DECREF_IMMORTAL(result);
10220
10213
  }
10221
10214
  }
10222
10215
 
@@ -10263,14 +10256,11 @@ static PyObject *COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10263
10256
  PyListObject *a = (PyListObject *)operand1;
10264
10257
  PyListObject *b = (PyListObject *)operand2;
10265
10258
 
10266
- Py_ssize_t len_a = Py_SIZE(a);
10267
- Py_ssize_t len_b = Py_SIZE(b);
10268
-
10269
10259
  bool found = false;
10270
10260
  nuitka_bool res = NUITKA_BOOL_TRUE;
10271
10261
 
10272
10262
  Py_ssize_t i;
10273
- for (i = 0; i < len_a && i < len_b; i++) {
10263
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10274
10264
  PyObject *aa = a->ob_item[i];
10275
10265
  PyObject *bb = b->ob_item[i];
10276
10266
 
@@ -10278,7 +10268,11 @@ static PyObject *COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10278
10268
  continue;
10279
10269
  }
10280
10270
 
10271
+ Py_INCREF(aa);
10272
+ Py_INCREF(bb);
10281
10273
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10274
+ Py_DECREF(aa);
10275
+ Py_DECREF(bb);
10282
10276
 
10283
10277
  if (res == NUITKA_BOOL_EXCEPTION) {
10284
10278
  return NULL;
@@ -10291,11 +10285,11 @@ static PyObject *COMPARE_LE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10291
10285
  }
10292
10286
 
10293
10287
  if (found == false) {
10294
- bool r = len_a <= len_b;
10288
+ bool r = Py_SIZE(a) <= Py_SIZE(b);
10295
10289
 
10296
10290
  // Convert to target type.
10297
10291
  PyObject *result = BOOL_FROM(r);
10298
- Py_INCREF(result);
10292
+ Py_INCREF_IMMORTAL(result);
10299
10293
  return result;
10300
10294
  }
10301
10295
 
@@ -10335,7 +10329,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10335
10329
  return result;
10336
10330
  }
10337
10331
 
10338
- Py_DECREF(result);
10332
+ Py_DECREF_IMMORTAL(result);
10339
10333
  }
10340
10334
 
10341
10335
  // No rich comparison worked, but maybe compare works.
@@ -10376,7 +10370,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10376
10370
 
10377
10371
  bool r = c != 0;
10378
10372
  PyObject *result = BOOL_FROM(r);
10379
- Py_INCREF(result);
10373
+ Py_INCREF_IMMORTAL(result);
10380
10374
  return result;
10381
10375
  }
10382
10376
  }
@@ -10396,11 +10390,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10396
10390
  return result;
10397
10391
  }
10398
10392
 
10399
- Py_DECREF(result);
10393
+ Py_DECREF_IMMORTAL(result);
10400
10394
  }
10401
10395
  }
10402
10396
 
10403
- f = RICHCOMPARE(type1);
10397
+ f = TP_RICHCOMPARE(type1);
10404
10398
  if (f != NULL) {
10405
10399
  PyObject *result = (*f)(operand1, operand2, Py_LE);
10406
10400
 
@@ -10410,7 +10404,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10410
10404
  return result;
10411
10405
  }
10412
10406
 
10413
- Py_DECREF(result);
10407
+ Py_DECREF_IMMORTAL(result);
10414
10408
  }
10415
10409
 
10416
10410
  f = PyList_Type.tp_richcompare;
@@ -10423,7 +10417,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10423
10417
  return result;
10424
10418
  }
10425
10419
 
10426
- Py_DECREF(result);
10420
+ Py_DECREF_IMMORTAL(result);
10427
10421
  }
10428
10422
 
10429
10423
  int c;
@@ -10511,7 +10505,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10511
10505
 
10512
10506
  bool r = c != 0;
10513
10507
  PyObject *result = BOOL_FROM(r);
10514
- Py_INCREF(result);
10508
+ Py_INCREF_IMMORTAL(result);
10515
10509
  return result;
10516
10510
  #else
10517
10511
  bool checked_reverse_op = false;
@@ -10531,11 +10525,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10531
10525
  return result;
10532
10526
  }
10533
10527
 
10534
- Py_DECREF(result);
10528
+ Py_DECREF_IMMORTAL(result);
10535
10529
  }
10536
10530
  }
10537
10531
 
10538
- f = RICHCOMPARE(type1);
10532
+ f = TP_RICHCOMPARE(type1);
10539
10533
 
10540
10534
  if (f != NULL) {
10541
10535
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -10546,7 +10540,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10546
10540
  return result;
10547
10541
  }
10548
10542
 
10549
- Py_DECREF(result);
10543
+ Py_DECREF_IMMORTAL(result);
10550
10544
  }
10551
10545
 
10552
10546
  if (checked_reverse_op == false) {
@@ -10561,7 +10555,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10561
10555
  return result;
10562
10556
  }
10563
10557
 
10564
- Py_DECREF(result);
10558
+ Py_DECREF_IMMORTAL(result);
10565
10559
  }
10566
10560
  }
10567
10561
 
@@ -10573,13 +10567,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10573
10567
  case Py_EQ: {
10574
10568
  bool r = operand1 == operand2;
10575
10569
  PyObject *result = BOOL_FROM(r);
10576
- Py_INCREF(result);
10570
+ Py_INCREF_IMMORTAL(result);
10577
10571
  return result;
10578
10572
  }
10579
10573
  case Py_NE: {
10580
10574
  bool r = operand1 != operand2;
10581
10575
  PyObject *result = BOOL_FROM(r);
10582
- Py_INCREF(result);
10576
+ Py_INCREF_IMMORTAL(result);
10583
10577
  return result;
10584
10578
  }
10585
10579
  default:
@@ -10627,7 +10621,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10627
10621
  return result;
10628
10622
  }
10629
10623
 
10630
- Py_DECREF(result);
10624
+ Py_DECREF_IMMORTAL(result);
10631
10625
  }
10632
10626
 
10633
10627
  // No rich comparison worked, but maybe compare works.
@@ -10668,7 +10662,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10668
10662
 
10669
10663
  bool r = c != 0;
10670
10664
  PyObject *result = BOOL_FROM(r);
10671
- Py_INCREF(result);
10665
+ Py_INCREF_IMMORTAL(result);
10672
10666
  return result;
10673
10667
  }
10674
10668
  }
@@ -10677,7 +10671,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10677
10671
  richcmpfunc f;
10678
10672
 
10679
10673
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10680
- f = RICHCOMPARE(type2);
10674
+ f = TP_RICHCOMPARE(type2);
10681
10675
 
10682
10676
  if (f != NULL) {
10683
10677
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -10688,7 +10682,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10688
10682
  return result;
10689
10683
  }
10690
10684
 
10691
- Py_DECREF(result);
10685
+ Py_DECREF_IMMORTAL(result);
10692
10686
  }
10693
10687
  }
10694
10688
 
@@ -10702,10 +10696,10 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10702
10696
  return result;
10703
10697
  }
10704
10698
 
10705
- Py_DECREF(result);
10699
+ Py_DECREF_IMMORTAL(result);
10706
10700
  }
10707
10701
 
10708
- f = RICHCOMPARE(type2);
10702
+ f = TP_RICHCOMPARE(type2);
10709
10703
  if (f != NULL) {
10710
10704
  PyObject *result = (*f)(operand2, operand1, Py_GE);
10711
10705
 
@@ -10715,7 +10709,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10715
10709
  return result;
10716
10710
  }
10717
10711
 
10718
- Py_DECREF(result);
10712
+ Py_DECREF_IMMORTAL(result);
10719
10713
  }
10720
10714
 
10721
10715
  int c;
@@ -10803,14 +10797,14 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10803
10797
 
10804
10798
  bool r = c != 0;
10805
10799
  PyObject *result = BOOL_FROM(r);
10806
- Py_INCREF(result);
10800
+ Py_INCREF_IMMORTAL(result);
10807
10801
  return result;
10808
10802
  #else
10809
10803
  bool checked_reverse_op = false;
10810
10804
  richcmpfunc f;
10811
10805
 
10812
10806
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10813
- f = RICHCOMPARE(type2);
10807
+ f = TP_RICHCOMPARE(type2);
10814
10808
 
10815
10809
  if (f != NULL) {
10816
10810
  checked_reverse_op = true;
@@ -10823,7 +10817,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10823
10817
  return result;
10824
10818
  }
10825
10819
 
10826
- Py_DECREF(result);
10820
+ Py_DECREF_IMMORTAL(result);
10827
10821
  }
10828
10822
  }
10829
10823
 
@@ -10838,11 +10832,11 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10838
10832
  return result;
10839
10833
  }
10840
10834
 
10841
- Py_DECREF(result);
10835
+ Py_DECREF_IMMORTAL(result);
10842
10836
  }
10843
10837
 
10844
10838
  if (checked_reverse_op == false) {
10845
- f = RICHCOMPARE(type2);
10839
+ f = TP_RICHCOMPARE(type2);
10846
10840
 
10847
10841
  if (f != NULL) {
10848
10842
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -10853,7 +10847,7 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10853
10847
  return result;
10854
10848
  }
10855
10849
 
10856
- Py_DECREF(result);
10850
+ Py_DECREF_IMMORTAL(result);
10857
10851
  }
10858
10852
  }
10859
10853
 
@@ -10865,13 +10859,13 @@ PyObject *RICH_COMPARE_LE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10865
10859
  case Py_EQ: {
10866
10860
  bool r = operand1 == operand2;
10867
10861
  PyObject *result = BOOL_FROM(r);
10868
- Py_INCREF(result);
10862
+ Py_INCREF_IMMORTAL(result);
10869
10863
  return result;
10870
10864
  }
10871
10865
  case Py_NE: {
10872
10866
  bool r = operand1 != operand2;
10873
10867
  PyObject *result = BOOL_FROM(r);
10874
- Py_INCREF(result);
10868
+ Py_INCREF_IMMORTAL(result);
10875
10869
  return result;
10876
10870
  }
10877
10871
  default:
@@ -10900,14 +10894,11 @@ static nuitka_bool COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10900
10894
  PyListObject *a = (PyListObject *)operand1;
10901
10895
  PyListObject *b = (PyListObject *)operand2;
10902
10896
 
10903
- Py_ssize_t len_a = Py_SIZE(a);
10904
- Py_ssize_t len_b = Py_SIZE(b);
10905
-
10906
10897
  bool found = false;
10907
10898
  nuitka_bool res = NUITKA_BOOL_TRUE;
10908
10899
 
10909
10900
  Py_ssize_t i;
10910
- for (i = 0; i < len_a && i < len_b; i++) {
10901
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10911
10902
  PyObject *aa = a->ob_item[i];
10912
10903
  PyObject *bb = b->ob_item[i];
10913
10904
 
@@ -10915,7 +10906,11 @@ static nuitka_bool COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10915
10906
  continue;
10916
10907
  }
10917
10908
 
10909
+ Py_INCREF(aa);
10910
+ Py_INCREF(bb);
10918
10911
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10912
+ Py_DECREF(aa);
10913
+ Py_DECREF(bb);
10919
10914
 
10920
10915
  if (res == NUITKA_BOOL_EXCEPTION) {
10921
10916
  return NUITKA_BOOL_EXCEPTION;
@@ -10928,7 +10923,7 @@ static nuitka_bool COMPARE_LE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10928
10923
  }
10929
10924
 
10930
10925
  if (found == false) {
10931
- bool r = len_a <= len_b;
10926
+ bool r = Py_SIZE(a) <= Py_SIZE(b);
10932
10927
 
10933
10928
  // Convert to target type.
10934
10929
  nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
@@ -10980,7 +10975,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10980
10975
  }
10981
10976
  }
10982
10977
 
10983
- Py_DECREF(result);
10978
+ Py_DECREF_IMMORTAL(result);
10984
10979
  }
10985
10980
 
10986
10981
  // No rich comparison worked, but maybe compare works.
@@ -11049,11 +11044,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11049
11044
  }
11050
11045
  }
11051
11046
 
11052
- Py_DECREF(result);
11047
+ Py_DECREF_IMMORTAL(result);
11053
11048
  }
11054
11049
  }
11055
11050
 
11056
- f = RICHCOMPARE(type1);
11051
+ f = TP_RICHCOMPARE(type1);
11057
11052
  if (f != NULL) {
11058
11053
  PyObject *result = (*f)(operand1, operand2, Py_LE);
11059
11054
 
@@ -11071,7 +11066,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11071
11066
  }
11072
11067
  }
11073
11068
 
11074
- Py_DECREF(result);
11069
+ Py_DECREF_IMMORTAL(result);
11075
11070
  }
11076
11071
 
11077
11072
  f = PyList_Type.tp_richcompare;
@@ -11092,7 +11087,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11092
11087
  }
11093
11088
  }
11094
11089
 
11095
- Py_DECREF(result);
11090
+ Py_DECREF_IMMORTAL(result);
11096
11091
  }
11097
11092
 
11098
11093
  int c;
@@ -11208,11 +11203,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11208
11203
  }
11209
11204
  }
11210
11205
 
11211
- Py_DECREF(result);
11206
+ Py_DECREF_IMMORTAL(result);
11212
11207
  }
11213
11208
  }
11214
11209
 
11215
- f = RICHCOMPARE(type1);
11210
+ f = TP_RICHCOMPARE(type1);
11216
11211
 
11217
11212
  if (f != NULL) {
11218
11213
  PyObject *result = (*f)(operand1, operand2, Py_LE);
@@ -11231,7 +11226,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11231
11226
  }
11232
11227
  }
11233
11228
 
11234
- Py_DECREF(result);
11229
+ Py_DECREF_IMMORTAL(result);
11235
11230
  }
11236
11231
 
11237
11232
  if (checked_reverse_op == false) {
@@ -11254,7 +11249,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11254
11249
  }
11255
11250
  }
11256
11251
 
11257
- Py_DECREF(result);
11252
+ Py_DECREF_IMMORTAL(result);
11258
11253
  }
11259
11254
  }
11260
11255
 
@@ -11328,7 +11323,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11328
11323
  }
11329
11324
  }
11330
11325
 
11331
- Py_DECREF(result);
11326
+ Py_DECREF_IMMORTAL(result);
11332
11327
  }
11333
11328
 
11334
11329
  // No rich comparison worked, but maybe compare works.
@@ -11378,7 +11373,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11378
11373
  richcmpfunc f;
11379
11374
 
11380
11375
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11381
- f = RICHCOMPARE(type2);
11376
+ f = TP_RICHCOMPARE(type2);
11382
11377
 
11383
11378
  if (f != NULL) {
11384
11379
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -11397,7 +11392,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11397
11392
  }
11398
11393
  }
11399
11394
 
11400
- Py_DECREF(result);
11395
+ Py_DECREF_IMMORTAL(result);
11401
11396
  }
11402
11397
  }
11403
11398
 
@@ -11419,10 +11414,10 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11419
11414
  }
11420
11415
  }
11421
11416
 
11422
- Py_DECREF(result);
11417
+ Py_DECREF_IMMORTAL(result);
11423
11418
  }
11424
11419
 
11425
- f = RICHCOMPARE(type2);
11420
+ f = TP_RICHCOMPARE(type2);
11426
11421
  if (f != NULL) {
11427
11422
  PyObject *result = (*f)(operand2, operand1, Py_GE);
11428
11423
 
@@ -11440,7 +11435,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11440
11435
  }
11441
11436
  }
11442
11437
 
11443
- Py_DECREF(result);
11438
+ Py_DECREF_IMMORTAL(result);
11444
11439
  }
11445
11440
 
11446
11441
  int c;
@@ -11535,7 +11530,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11535
11530
  richcmpfunc f;
11536
11531
 
11537
11532
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11538
- f = RICHCOMPARE(type2);
11533
+ f = TP_RICHCOMPARE(type2);
11539
11534
 
11540
11535
  if (f != NULL) {
11541
11536
  checked_reverse_op = true;
@@ -11556,7 +11551,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11556
11551
  }
11557
11552
  }
11558
11553
 
11559
- Py_DECREF(result);
11554
+ Py_DECREF_IMMORTAL(result);
11560
11555
  }
11561
11556
  }
11562
11557
 
@@ -11579,11 +11574,11 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11579
11574
  }
11580
11575
  }
11581
11576
 
11582
- Py_DECREF(result);
11577
+ Py_DECREF_IMMORTAL(result);
11583
11578
  }
11584
11579
 
11585
11580
  if (checked_reverse_op == false) {
11586
- f = RICHCOMPARE(type2);
11581
+ f = TP_RICHCOMPARE(type2);
11587
11582
 
11588
11583
  if (f != NULL) {
11589
11584
  PyObject *result = (*f)(operand2, operand1, Py_GE);
@@ -11602,7 +11597,7 @@ nuitka_bool RICH_COMPARE_LE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11602
11597
  }
11603
11598
  }
11604
11599
 
11605
- Py_DECREF(result);
11600
+ Py_DECREF_IMMORTAL(result);
11606
11601
  }
11607
11602
  }
11608
11603
 
@@ -11659,7 +11654,7 @@ static PyObject *COMPARE_LE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11659
11654
  }
11660
11655
 
11661
11656
  Py_ssize_t operand2_digit_count = 0;
11662
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11657
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11663
11658
  {
11664
11659
  unsigned long t = operand2_abs_ival;
11665
11660
 
@@ -11676,15 +11671,15 @@ static PyObject *COMPARE_LE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11676
11671
 
11677
11672
  bool r;
11678
11673
 
11679
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11680
- r = Py_SIZE(operand1_long_object) - operand2_size < 0;
11674
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11675
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size < 0;
11681
11676
  } else {
11682
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11677
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11683
11678
  r = true;
11684
11679
  while (--i >= 0) {
11685
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11686
- r = operand1_long_object->ob_digit[i] < operand2_digits[i];
11687
- if (Py_SIZE(operand1_long_object) < 0) {
11680
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11681
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];
11682
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11688
11683
  r = !r;
11689
11684
  }
11690
11685
  break;
@@ -11694,7 +11689,7 @@ static PyObject *COMPARE_LE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11694
11689
 
11695
11690
  // Convert to target type.
11696
11691
  PyObject *result = BOOL_FROM(r);
11697
- Py_INCREF(result);
11692
+ Py_INCREF_IMMORTAL(result);
11698
11693
  return result;
11699
11694
  }
11700
11695
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
@@ -11723,7 +11718,7 @@ static bool COMPARE_LE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11723
11718
  }
11724
11719
 
11725
11720
  Py_ssize_t operand2_digit_count = 0;
11726
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11721
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11727
11722
  {
11728
11723
  unsigned long t = operand2_abs_ival;
11729
11724
 
@@ -11740,15 +11735,15 @@ static bool COMPARE_LE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11740
11735
 
11741
11736
  bool r;
11742
11737
 
11743
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11744
- r = Py_SIZE(operand1_long_object) - operand2_size < 0;
11738
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11739
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size < 0;
11745
11740
  } else {
11746
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11741
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11747
11742
  r = true;
11748
11743
  while (--i >= 0) {
11749
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11750
- r = operand1_long_object->ob_digit[i] < operand2_digits[i];
11751
- if (Py_SIZE(operand1_long_object) < 0) {
11744
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11745
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];
11746
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11752
11747
  r = !r;
11753
11748
  }
11754
11749
  break;
@@ -11780,7 +11775,7 @@ static PyObject *COMPARE_LE_OBJECT_INT_CLONG(PyObject *operand1, long operand2)
11780
11775
 
11781
11776
  // Convert to target type.
11782
11777
  PyObject *result = BOOL_FROM(r);
11783
- Py_INCREF(result);
11778
+ Py_INCREF_IMMORTAL(result);
11784
11779
  return result;
11785
11780
  }
11786
11781
  /* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
@@ -11821,15 +11816,18 @@ static PyObject *COMPARE_LE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11821
11816
 
11822
11817
  bool r;
11823
11818
 
11824
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11825
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;
11819
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11820
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11821
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11822
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) <
11823
+ 0;
11826
11824
  } else {
11827
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11825
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11828
11826
  r = true;
11829
11827
  while (--i >= 0) {
11830
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11831
- r = operand1_long_object->ob_digit[i] < (digit)Py_ABS(operand2);
11832
- if (Py_SIZE(operand1_long_object) < 0) {
11828
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11829
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);
11830
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11833
11831
  r = !r;
11834
11832
  }
11835
11833
  break;
@@ -11839,7 +11837,7 @@ static PyObject *COMPARE_LE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11839
11837
 
11840
11838
  // Convert to target type.
11841
11839
  PyObject *result = BOOL_FROM(r);
11842
- Py_INCREF(result);
11840
+ Py_INCREF_IMMORTAL(result);
11843
11841
  return result;
11844
11842
  }
11845
11843
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "DIGIT" to C platform digit value for long
@@ -11858,15 +11856,18 @@ static bool COMPARE_LE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {
11858
11856
 
11859
11857
  bool r;
11860
11858
 
11861
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11862
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;
11859
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11860
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11861
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11862
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) <
11863
+ 0;
11863
11864
  } else {
11864
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11865
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11865
11866
  r = true;
11866
11867
  while (--i >= 0) {
11867
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11868
- r = operand1_long_object->ob_digit[i] < (digit)Py_ABS(operand2);
11869
- if (Py_SIZE(operand1_long_object) < 0) {
11868
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11869
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);
11870
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11870
11871
  r = !r;
11871
11872
  }
11872
11873
  break;
@@ -11897,7 +11898,7 @@ static PyObject *COMPARE_LE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double opera
11897
11898
 
11898
11899
  // Convert to target type.
11899
11900
  PyObject *result = BOOL_FROM(r);
11900
- Py_INCREF(result);
11901
+ Py_INCREF_IMMORTAL(result);
11901
11902
  return result;
11902
11903
  }
11903
11904
  /* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
@@ -11925,3 +11926,18 @@ bool RICH_COMPARE_LE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
11925
11926
 
11926
11927
  return COMPARE_LE_CBOOL_FLOAT_CFLOAT(operand1, operand2);
11927
11928
  }
11929
+
11930
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
11931
+ // integrates with CPython, but also works on its own.
11932
+ //
11933
+ // Licensed under the Apache License, Version 2.0 (the "License");
11934
+ // you may not use this file except in compliance with the License.
11935
+ // You may obtain a copy of the License at
11936
+ //
11937
+ // http://www.apache.org/licenses/LICENSE-2.0
11938
+ //
11939
+ // Unless required by applicable law or agreed to in writing, software
11940
+ // distributed under the License is distributed on an "AS IS" BASIS,
11941
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11942
+ // See the License for the specific language governing permissions and
11943
+ // limitations under the License.