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_GE_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_GE_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_GE_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_GE);
@@ -105,7 +90,7 @@ PyObject *RICH_COMPARE_GE_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_GE_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_GE_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_LE);
@@ -166,11 +151,11 @@ PyObject *RICH_COMPARE_GE_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_GE);
176
161
 
@@ -180,10 +165,10 @@ PyObject *RICH_COMPARE_GE_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_LE);
189
174
 
@@ -193,7 +178,7 @@ PyObject *RICH_COMPARE_GE_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_GE_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_GE_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_GE);
@@ -316,11 +301,11 @@ PyObject *RICH_COMPARE_GE_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_LE);
@@ -331,7 +316,7 @@ PyObject *RICH_COMPARE_GE_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_GE_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_GE_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_GE);
@@ -417,7 +402,7 @@ nuitka_bool RICH_COMPARE_GE_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_GE_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_LE);
@@ -486,11 +471,11 @@ nuitka_bool RICH_COMPARE_GE_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_GE);
496
481
 
@@ -508,10 +493,10 @@ nuitka_bool RICH_COMPARE_GE_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_LE);
517
502
 
@@ -529,7 +514,7 @@ nuitka_bool RICH_COMPARE_GE_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_GE_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_GE_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_GE);
@@ -668,11 +653,11 @@ nuitka_bool RICH_COMPARE_GE_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_LE);
@@ -691,7 +676,7 @@ nuitka_bool RICH_COMPARE_GE_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_GE_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_GE_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_GE_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_GE_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_GE_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_GE);
876
861
 
@@ -880,7 +865,7 @@ PyObject *RICH_COMPARE_GE_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_GE_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_GE_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_GE_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_GE);
@@ -1016,7 +1001,7 @@ PyObject *RICH_COMPARE_GE_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_GE_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_GE_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_GE_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_GE_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_GE_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_LE);
@@ -1160,7 +1145,7 @@ PyObject *RICH_COMPARE_GE_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_GE_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_LE);
1183
1168
 
@@ -1187,7 +1172,7 @@ PyObject *RICH_COMPARE_GE_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_GE_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_GE_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_GE_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_LE);
@@ -1325,7 +1310,7 @@ PyObject *RICH_COMPARE_GE_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_GE_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:
@@ -1447,7 +1432,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1447
1432
  }
1448
1433
  }
1449
1434
 
1450
- Py_DECREF(result);
1435
+ Py_DECREF_IMMORTAL(result);
1451
1436
  }
1452
1437
 
1453
1438
  // No rich comparison worked, but maybe compare works.
@@ -1516,11 +1501,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1516
1501
  }
1517
1502
  }
1518
1503
 
1519
- Py_DECREF(result);
1504
+ Py_DECREF_IMMORTAL(result);
1520
1505
  }
1521
1506
  }
1522
1507
 
1523
- f = RICHCOMPARE(type1);
1508
+ f = TP_RICHCOMPARE(type1);
1524
1509
  if (f != NULL) {
1525
1510
  PyObject *result = (*f)(operand1, operand2, Py_GE);
1526
1511
 
@@ -1538,7 +1523,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1538
1523
  }
1539
1524
  }
1540
1525
 
1541
- Py_DECREF(result);
1526
+ Py_DECREF_IMMORTAL(result);
1542
1527
  }
1543
1528
 
1544
1529
  f = PyString_Type.tp_richcompare;
@@ -1559,7 +1544,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1559
1544
  }
1560
1545
  }
1561
1546
 
1562
- Py_DECREF(result);
1547
+ Py_DECREF_IMMORTAL(result);
1563
1548
  }
1564
1549
 
1565
1550
  int c;
@@ -1675,11 +1660,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1675
1660
  }
1676
1661
  }
1677
1662
 
1678
- Py_DECREF(result);
1663
+ Py_DECREF_IMMORTAL(result);
1679
1664
  }
1680
1665
  }
1681
1666
 
1682
- f = RICHCOMPARE(type1);
1667
+ f = TP_RICHCOMPARE(type1);
1683
1668
 
1684
1669
  if (f != NULL) {
1685
1670
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -1698,7 +1683,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1698
1683
  }
1699
1684
  }
1700
1685
 
1701
- Py_DECREF(result);
1686
+ Py_DECREF_IMMORTAL(result);
1702
1687
  }
1703
1688
 
1704
1689
  if (checked_reverse_op == false) {
@@ -1721,7 +1706,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_STR(PyObject *operand1, PyObject *opera
1721
1706
  }
1722
1707
  }
1723
1708
 
1724
- Py_DECREF(result);
1709
+ Py_DECREF_IMMORTAL(result);
1725
1710
  }
1726
1711
  }
1727
1712
 
@@ -1797,7 +1782,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1797
1782
  }
1798
1783
  }
1799
1784
 
1800
- Py_DECREF(result);
1785
+ Py_DECREF_IMMORTAL(result);
1801
1786
  }
1802
1787
 
1803
1788
  // No rich comparison worked, but maybe compare works.
@@ -1847,7 +1832,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1847
1832
  richcmpfunc f;
1848
1833
 
1849
1834
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1850
- f = RICHCOMPARE(type2);
1835
+ f = TP_RICHCOMPARE(type2);
1851
1836
 
1852
1837
  if (f != NULL) {
1853
1838
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -1866,7 +1851,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1866
1851
  }
1867
1852
  }
1868
1853
 
1869
- Py_DECREF(result);
1854
+ Py_DECREF_IMMORTAL(result);
1870
1855
  }
1871
1856
  }
1872
1857
 
@@ -1888,10 +1873,10 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1888
1873
  }
1889
1874
  }
1890
1875
 
1891
- Py_DECREF(result);
1876
+ Py_DECREF_IMMORTAL(result);
1892
1877
  }
1893
1878
 
1894
- f = RICHCOMPARE(type2);
1879
+ f = TP_RICHCOMPARE(type2);
1895
1880
  if (f != NULL) {
1896
1881
  PyObject *result = (*f)(operand2, operand1, Py_LE);
1897
1882
 
@@ -1909,7 +1894,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
1909
1894
  }
1910
1895
  }
1911
1896
 
1912
- Py_DECREF(result);
1897
+ Py_DECREF_IMMORTAL(result);
1913
1898
  }
1914
1899
 
1915
1900
  int c;
@@ -2004,7 +1989,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2004
1989
  richcmpfunc f;
2005
1990
 
2006
1991
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
2007
- f = RICHCOMPARE(type2);
1992
+ f = TP_RICHCOMPARE(type2);
2008
1993
 
2009
1994
  if (f != NULL) {
2010
1995
  checked_reverse_op = true;
@@ -2025,7 +2010,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2025
2010
  }
2026
2011
  }
2027
2012
 
2028
- Py_DECREF(result);
2013
+ Py_DECREF_IMMORTAL(result);
2029
2014
  }
2030
2015
  }
2031
2016
 
@@ -2048,11 +2033,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2048
2033
  }
2049
2034
  }
2050
2035
 
2051
- Py_DECREF(result);
2036
+ Py_DECREF_IMMORTAL(result);
2052
2037
  }
2053
2038
 
2054
2039
  if (checked_reverse_op == false) {
2055
- f = RICHCOMPARE(type2);
2040
+ f = TP_RICHCOMPARE(type2);
2056
2041
 
2057
2042
  if (f != NULL) {
2058
2043
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -2071,7 +2056,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_STR_OBJECT(PyObject *operand1, PyObject *opera
2071
2056
  }
2072
2057
  }
2073
2058
 
2074
- Py_DECREF(result);
2059
+ Py_DECREF_IMMORTAL(result);
2075
2060
  }
2076
2061
  }
2077
2062
 
@@ -2119,7 +2104,7 @@ static PyObject *COMPARE_GE_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject
2119
2104
 
2120
2105
  // Convert to target type.
2121
2106
  PyObject *result = BOOL_FROM(r);
2122
- Py_INCREF(result);
2107
+ Py_INCREF_IMMORTAL(result);
2123
2108
  return result;
2124
2109
  }
2125
2110
 
@@ -2162,7 +2147,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2162
2147
  return result;
2163
2148
  }
2164
2149
 
2165
- Py_DECREF(result);
2150
+ Py_DECREF_IMMORTAL(result);
2166
2151
  }
2167
2152
 
2168
2153
  // No rich comparison worked, but maybe compare works.
@@ -2203,7 +2188,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2203
2188
 
2204
2189
  bool r = c != 0;
2205
2190
  PyObject *result = BOOL_FROM(r);
2206
- Py_INCREF(result);
2191
+ Py_INCREF_IMMORTAL(result);
2207
2192
  return result;
2208
2193
  }
2209
2194
  }
@@ -2223,11 +2208,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2223
2208
  return result;
2224
2209
  }
2225
2210
 
2226
- Py_DECREF(result);
2211
+ Py_DECREF_IMMORTAL(result);
2227
2212
  }
2228
2213
  }
2229
2214
 
2230
- f = RICHCOMPARE(type1);
2215
+ f = TP_RICHCOMPARE(type1);
2231
2216
  if (f != NULL) {
2232
2217
  PyObject *result = (*f)(operand1, operand2, Py_GE);
2233
2218
 
@@ -2237,7 +2222,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2237
2222
  return result;
2238
2223
  }
2239
2224
 
2240
- Py_DECREF(result);
2225
+ Py_DECREF_IMMORTAL(result);
2241
2226
  }
2242
2227
 
2243
2228
  f = PyUnicode_Type.tp_richcompare;
@@ -2250,7 +2235,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2250
2235
  return result;
2251
2236
  }
2252
2237
 
2253
- Py_DECREF(result);
2238
+ Py_DECREF_IMMORTAL(result);
2254
2239
  }
2255
2240
 
2256
2241
  int c;
@@ -2338,7 +2323,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2338
2323
 
2339
2324
  bool r = c != 0;
2340
2325
  PyObject *result = BOOL_FROM(r);
2341
- Py_INCREF(result);
2326
+ Py_INCREF_IMMORTAL(result);
2342
2327
  return result;
2343
2328
  #else
2344
2329
  bool checked_reverse_op = false;
@@ -2358,11 +2343,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2358
2343
  return result;
2359
2344
  }
2360
2345
 
2361
- Py_DECREF(result);
2346
+ Py_DECREF_IMMORTAL(result);
2362
2347
  }
2363
2348
  }
2364
2349
 
2365
- f = RICHCOMPARE(type1);
2350
+ f = TP_RICHCOMPARE(type1);
2366
2351
 
2367
2352
  if (f != NULL) {
2368
2353
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -2373,7 +2358,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2373
2358
  return result;
2374
2359
  }
2375
2360
 
2376
- Py_DECREF(result);
2361
+ Py_DECREF_IMMORTAL(result);
2377
2362
  }
2378
2363
 
2379
2364
  if (checked_reverse_op == false) {
@@ -2388,7 +2373,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2388
2373
  return result;
2389
2374
  }
2390
2375
 
2391
- Py_DECREF(result);
2376
+ Py_DECREF_IMMORTAL(result);
2392
2377
  }
2393
2378
  }
2394
2379
 
@@ -2400,13 +2385,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *op
2400
2385
  case Py_EQ: {
2401
2386
  bool r = operand1 == operand2;
2402
2387
  PyObject *result = BOOL_FROM(r);
2403
- Py_INCREF(result);
2388
+ Py_INCREF_IMMORTAL(result);
2404
2389
  return result;
2405
2390
  }
2406
2391
  case Py_NE: {
2407
2392
  bool r = operand1 != operand2;
2408
2393
  PyObject *result = BOOL_FROM(r);
2409
- Py_INCREF(result);
2394
+ Py_INCREF_IMMORTAL(result);
2410
2395
  return result;
2411
2396
  }
2412
2397
  default:
@@ -2456,7 +2441,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2456
2441
  return result;
2457
2442
  }
2458
2443
 
2459
- Py_DECREF(result);
2444
+ Py_DECREF_IMMORTAL(result);
2460
2445
  }
2461
2446
 
2462
2447
  // No rich comparison worked, but maybe compare works.
@@ -2497,7 +2482,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2497
2482
 
2498
2483
  bool r = c != 0;
2499
2484
  PyObject *result = BOOL_FROM(r);
2500
- Py_INCREF(result);
2485
+ Py_INCREF_IMMORTAL(result);
2501
2486
  return result;
2502
2487
  }
2503
2488
  }
@@ -2506,7 +2491,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2506
2491
  richcmpfunc f;
2507
2492
 
2508
2493
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2509
- f = RICHCOMPARE(type2);
2494
+ f = TP_RICHCOMPARE(type2);
2510
2495
 
2511
2496
  if (f != NULL) {
2512
2497
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -2517,7 +2502,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2517
2502
  return result;
2518
2503
  }
2519
2504
 
2520
- Py_DECREF(result);
2505
+ Py_DECREF_IMMORTAL(result);
2521
2506
  }
2522
2507
  }
2523
2508
 
@@ -2531,10 +2516,10 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2531
2516
  return result;
2532
2517
  }
2533
2518
 
2534
- Py_DECREF(result);
2519
+ Py_DECREF_IMMORTAL(result);
2535
2520
  }
2536
2521
 
2537
- f = RICHCOMPARE(type2);
2522
+ f = TP_RICHCOMPARE(type2);
2538
2523
  if (f != NULL) {
2539
2524
  PyObject *result = (*f)(operand2, operand1, Py_LE);
2540
2525
 
@@ -2544,7 +2529,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2544
2529
  return result;
2545
2530
  }
2546
2531
 
2547
- Py_DECREF(result);
2532
+ Py_DECREF_IMMORTAL(result);
2548
2533
  }
2549
2534
 
2550
2535
  int c;
@@ -2632,14 +2617,14 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2632
2617
 
2633
2618
  bool r = c != 0;
2634
2619
  PyObject *result = BOOL_FROM(r);
2635
- Py_INCREF(result);
2620
+ Py_INCREF_IMMORTAL(result);
2636
2621
  return result;
2637
2622
  #else
2638
2623
  bool checked_reverse_op = false;
2639
2624
  richcmpfunc f;
2640
2625
 
2641
2626
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
2642
- f = RICHCOMPARE(type2);
2627
+ f = TP_RICHCOMPARE(type2);
2643
2628
 
2644
2629
  if (f != NULL) {
2645
2630
  checked_reverse_op = true;
@@ -2652,7 +2637,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2652
2637
  return result;
2653
2638
  }
2654
2639
 
2655
- Py_DECREF(result);
2640
+ Py_DECREF_IMMORTAL(result);
2656
2641
  }
2657
2642
  }
2658
2643
 
@@ -2667,11 +2652,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2667
2652
  return result;
2668
2653
  }
2669
2654
 
2670
- Py_DECREF(result);
2655
+ Py_DECREF_IMMORTAL(result);
2671
2656
  }
2672
2657
 
2673
2658
  if (checked_reverse_op == false) {
2674
- f = RICHCOMPARE(type2);
2659
+ f = TP_RICHCOMPARE(type2);
2675
2660
 
2676
2661
  if (f != NULL) {
2677
2662
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -2682,7 +2667,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2682
2667
  return result;
2683
2668
  }
2684
2669
 
2685
- Py_DECREF(result);
2670
+ Py_DECREF_IMMORTAL(result);
2686
2671
  }
2687
2672
  }
2688
2673
 
@@ -2694,13 +2679,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *op
2694
2679
  case Py_EQ: {
2695
2680
  bool r = operand1 == operand2;
2696
2681
  PyObject *result = BOOL_FROM(r);
2697
- Py_INCREF(result);
2682
+ Py_INCREF_IMMORTAL(result);
2698
2683
  return result;
2699
2684
  }
2700
2685
  case Py_NE: {
2701
2686
  bool r = operand1 != operand2;
2702
2687
  PyObject *result = BOOL_FROM(r);
2703
- Py_INCREF(result);
2688
+ Py_INCREF_IMMORTAL(result);
2704
2689
  return result;
2705
2690
  }
2706
2691
  default:
@@ -2740,7 +2725,7 @@ static bool COMPARE_GE_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *opera
2740
2725
 
2741
2726
  // Convert to target type if necessary
2742
2727
  bool result = r == Py_True;
2743
- Py_DECREF(r);
2728
+ Py_DECREF_IMMORTAL(r);
2744
2729
 
2745
2730
  return result;
2746
2731
  }
@@ -2786,7 +2771,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2786
2771
  }
2787
2772
  }
2788
2773
 
2789
- Py_DECREF(result);
2774
+ Py_DECREF_IMMORTAL(result);
2790
2775
  }
2791
2776
 
2792
2777
  // No rich comparison worked, but maybe compare works.
@@ -2855,11 +2840,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2855
2840
  }
2856
2841
  }
2857
2842
 
2858
- Py_DECREF(result);
2843
+ Py_DECREF_IMMORTAL(result);
2859
2844
  }
2860
2845
  }
2861
2846
 
2862
- f = RICHCOMPARE(type1);
2847
+ f = TP_RICHCOMPARE(type1);
2863
2848
  if (f != NULL) {
2864
2849
  PyObject *result = (*f)(operand1, operand2, Py_GE);
2865
2850
 
@@ -2877,7 +2862,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2877
2862
  }
2878
2863
  }
2879
2864
 
2880
- Py_DECREF(result);
2865
+ Py_DECREF_IMMORTAL(result);
2881
2866
  }
2882
2867
 
2883
2868
  f = PyUnicode_Type.tp_richcompare;
@@ -2898,7 +2883,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2898
2883
  }
2899
2884
  }
2900
2885
 
2901
- Py_DECREF(result);
2886
+ Py_DECREF_IMMORTAL(result);
2902
2887
  }
2903
2888
 
2904
2889
  int c;
@@ -3014,11 +2999,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3014
2999
  }
3015
3000
  }
3016
3001
 
3017
- Py_DECREF(result);
3002
+ Py_DECREF_IMMORTAL(result);
3018
3003
  }
3019
3004
  }
3020
3005
 
3021
- f = RICHCOMPARE(type1);
3006
+ f = TP_RICHCOMPARE(type1);
3022
3007
 
3023
3008
  if (f != NULL) {
3024
3009
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -3037,7 +3022,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3037
3022
  }
3038
3023
  }
3039
3024
 
3040
- Py_DECREF(result);
3025
+ Py_DECREF_IMMORTAL(result);
3041
3026
  }
3042
3027
 
3043
3028
  if (checked_reverse_op == false) {
@@ -3060,7 +3045,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3060
3045
  }
3061
3046
  }
3062
3047
 
3063
- Py_DECREF(result);
3048
+ Py_DECREF_IMMORTAL(result);
3064
3049
  }
3065
3050
  }
3066
3051
 
@@ -3136,7 +3121,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3136
3121
  }
3137
3122
  }
3138
3123
 
3139
- Py_DECREF(result);
3124
+ Py_DECREF_IMMORTAL(result);
3140
3125
  }
3141
3126
 
3142
3127
  // No rich comparison worked, but maybe compare works.
@@ -3186,7 +3171,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3186
3171
  richcmpfunc f;
3187
3172
 
3188
3173
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3189
- f = RICHCOMPARE(type2);
3174
+ f = TP_RICHCOMPARE(type2);
3190
3175
 
3191
3176
  if (f != NULL) {
3192
3177
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -3205,7 +3190,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3205
3190
  }
3206
3191
  }
3207
3192
 
3208
- Py_DECREF(result);
3193
+ Py_DECREF_IMMORTAL(result);
3209
3194
  }
3210
3195
  }
3211
3196
 
@@ -3227,10 +3212,10 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3227
3212
  }
3228
3213
  }
3229
3214
 
3230
- Py_DECREF(result);
3215
+ Py_DECREF_IMMORTAL(result);
3231
3216
  }
3232
3217
 
3233
- f = RICHCOMPARE(type2);
3218
+ f = TP_RICHCOMPARE(type2);
3234
3219
  if (f != NULL) {
3235
3220
  PyObject *result = (*f)(operand2, operand1, Py_LE);
3236
3221
 
@@ -3248,7 +3233,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3248
3233
  }
3249
3234
  }
3250
3235
 
3251
- Py_DECREF(result);
3236
+ Py_DECREF_IMMORTAL(result);
3252
3237
  }
3253
3238
 
3254
3239
  int c;
@@ -3343,7 +3328,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3343
3328
  richcmpfunc f;
3344
3329
 
3345
3330
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3346
- f = RICHCOMPARE(type2);
3331
+ f = TP_RICHCOMPARE(type2);
3347
3332
 
3348
3333
  if (f != NULL) {
3349
3334
  checked_reverse_op = true;
@@ -3364,7 +3349,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3364
3349
  }
3365
3350
  }
3366
3351
 
3367
- Py_DECREF(result);
3352
+ Py_DECREF_IMMORTAL(result);
3368
3353
  }
3369
3354
  }
3370
3355
 
@@ -3387,11 +3372,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3387
3372
  }
3388
3373
  }
3389
3374
 
3390
- Py_DECREF(result);
3375
+ Py_DECREF_IMMORTAL(result);
3391
3376
  }
3392
3377
 
3393
3378
  if (checked_reverse_op == false) {
3394
- f = RICHCOMPARE(type2);
3379
+ f = TP_RICHCOMPARE(type2);
3395
3380
 
3396
3381
  if (f != NULL) {
3397
3382
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -3410,7 +3395,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3410
3395
  }
3411
3396
  }
3412
3397
 
3413
- Py_DECREF(result);
3398
+ Py_DECREF_IMMORTAL(result);
3414
3399
  }
3415
3400
  }
3416
3401
 
@@ -3460,7 +3445,7 @@ static PyObject *COMPARE_GE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3460
3445
 
3461
3446
  // Convert to target type.
3462
3447
  PyObject *result = BOOL_FROM(r);
3463
- Py_INCREF(result);
3448
+ Py_INCREF_IMMORTAL(result);
3464
3449
  return result;
3465
3450
  }
3466
3451
 
@@ -3488,7 +3473,7 @@ static PyObject *COMPARE_GE_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3488
3473
 
3489
3474
  // Convert to target type.
3490
3475
  PyObject *result = BOOL_FROM(c != 0);
3491
- Py_INCREF(result);
3476
+ Py_INCREF_IMMORTAL(result);
3492
3477
  return result;
3493
3478
  }
3494
3479
  /* Code referring to "OBJECT" corresponds to any Python object and "BYTES" to Python3 'bytes'. */
@@ -3525,7 +3510,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3525
3510
  return result;
3526
3511
  }
3527
3512
 
3528
- Py_DECREF(result);
3513
+ Py_DECREF_IMMORTAL(result);
3529
3514
  }
3530
3515
 
3531
3516
  // No rich comparison worked, but maybe compare works.
@@ -3566,7 +3551,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3566
3551
 
3567
3552
  bool r = c != 0;
3568
3553
  PyObject *result = BOOL_FROM(r);
3569
- Py_INCREF(result);
3554
+ Py_INCREF_IMMORTAL(result);
3570
3555
  return result;
3571
3556
  }
3572
3557
  }
@@ -3586,11 +3571,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3586
3571
  return result;
3587
3572
  }
3588
3573
 
3589
- Py_DECREF(result);
3574
+ Py_DECREF_IMMORTAL(result);
3590
3575
  }
3591
3576
  }
3592
3577
 
3593
- f = RICHCOMPARE(type1);
3578
+ f = TP_RICHCOMPARE(type1);
3594
3579
  if (f != NULL) {
3595
3580
  PyObject *result = (*f)(operand1, operand2, Py_GE);
3596
3581
 
@@ -3600,7 +3585,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3600
3585
  return result;
3601
3586
  }
3602
3587
 
3603
- Py_DECREF(result);
3588
+ Py_DECREF_IMMORTAL(result);
3604
3589
  }
3605
3590
 
3606
3591
  f = PyBytes_Type.tp_richcompare;
@@ -3613,7 +3598,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3613
3598
  return result;
3614
3599
  }
3615
3600
 
3616
- Py_DECREF(result);
3601
+ Py_DECREF_IMMORTAL(result);
3617
3602
  }
3618
3603
 
3619
3604
  int c;
@@ -3701,7 +3686,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3701
3686
 
3702
3687
  bool r = c != 0;
3703
3688
  PyObject *result = BOOL_FROM(r);
3704
- Py_INCREF(result);
3689
+ Py_INCREF_IMMORTAL(result);
3705
3690
  return result;
3706
3691
  #else
3707
3692
  bool checked_reverse_op = false;
@@ -3721,11 +3706,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3721
3706
  return result;
3722
3707
  }
3723
3708
 
3724
- Py_DECREF(result);
3709
+ Py_DECREF_IMMORTAL(result);
3725
3710
  }
3726
3711
  }
3727
3712
 
3728
- f = RICHCOMPARE(type1);
3713
+ f = TP_RICHCOMPARE(type1);
3729
3714
 
3730
3715
  if (f != NULL) {
3731
3716
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -3736,7 +3721,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3736
3721
  return result;
3737
3722
  }
3738
3723
 
3739
- Py_DECREF(result);
3724
+ Py_DECREF_IMMORTAL(result);
3740
3725
  }
3741
3726
 
3742
3727
  if (checked_reverse_op == false) {
@@ -3751,7 +3736,7 @@ PyObject *RICH_COMPARE_GE_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
 
@@ -3763,13 +3748,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3763
3748
  case Py_EQ: {
3764
3749
  bool r = operand1 == operand2;
3765
3750
  PyObject *result = BOOL_FROM(r);
3766
- Py_INCREF(result);
3751
+ Py_INCREF_IMMORTAL(result);
3767
3752
  return result;
3768
3753
  }
3769
3754
  case Py_NE: {
3770
3755
  bool r = operand1 != operand2;
3771
3756
  PyObject *result = BOOL_FROM(r);
3772
- Py_INCREF(result);
3757
+ Py_INCREF_IMMORTAL(result);
3773
3758
  return result;
3774
3759
  }
3775
3760
  default:
@@ -3819,7 +3804,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3819
3804
  return result;
3820
3805
  }
3821
3806
 
3822
- Py_DECREF(result);
3807
+ Py_DECREF_IMMORTAL(result);
3823
3808
  }
3824
3809
 
3825
3810
  // No rich comparison worked, but maybe compare works.
@@ -3860,7 +3845,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3860
3845
 
3861
3846
  bool r = c != 0;
3862
3847
  PyObject *result = BOOL_FROM(r);
3863
- Py_INCREF(result);
3848
+ Py_INCREF_IMMORTAL(result);
3864
3849
  return result;
3865
3850
  }
3866
3851
  }
@@ -3869,7 +3854,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3869
3854
  richcmpfunc f;
3870
3855
 
3871
3856
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
3872
- f = RICHCOMPARE(type2);
3857
+ f = TP_RICHCOMPARE(type2);
3873
3858
 
3874
3859
  if (f != NULL) {
3875
3860
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -3880,7 +3865,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3880
3865
  return result;
3881
3866
  }
3882
3867
 
3883
- Py_DECREF(result);
3868
+ Py_DECREF_IMMORTAL(result);
3884
3869
  }
3885
3870
  }
3886
3871
 
@@ -3894,10 +3879,10 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3894
3879
  return result;
3895
3880
  }
3896
3881
 
3897
- Py_DECREF(result);
3882
+ Py_DECREF_IMMORTAL(result);
3898
3883
  }
3899
3884
 
3900
- f = RICHCOMPARE(type2);
3885
+ f = TP_RICHCOMPARE(type2);
3901
3886
  if (f != NULL) {
3902
3887
  PyObject *result = (*f)(operand2, operand1, Py_LE);
3903
3888
 
@@ -3907,7 +3892,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3907
3892
  return result;
3908
3893
  }
3909
3894
 
3910
- Py_DECREF(result);
3895
+ Py_DECREF_IMMORTAL(result);
3911
3896
  }
3912
3897
 
3913
3898
  int c;
@@ -3995,14 +3980,14 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3995
3980
 
3996
3981
  bool r = c != 0;
3997
3982
  PyObject *result = BOOL_FROM(r);
3998
- Py_INCREF(result);
3983
+ Py_INCREF_IMMORTAL(result);
3999
3984
  return result;
4000
3985
  #else
4001
3986
  bool checked_reverse_op = false;
4002
3987
  richcmpfunc f;
4003
3988
 
4004
3989
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4005
- f = RICHCOMPARE(type2);
3990
+ f = TP_RICHCOMPARE(type2);
4006
3991
 
4007
3992
  if (f != NULL) {
4008
3993
  checked_reverse_op = true;
@@ -4015,7 +4000,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4015
4000
  return result;
4016
4001
  }
4017
4002
 
4018
- Py_DECREF(result);
4003
+ Py_DECREF_IMMORTAL(result);
4019
4004
  }
4020
4005
  }
4021
4006
 
@@ -4030,11 +4015,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4030
4015
  return result;
4031
4016
  }
4032
4017
 
4033
- Py_DECREF(result);
4018
+ Py_DECREF_IMMORTAL(result);
4034
4019
  }
4035
4020
 
4036
4021
  if (checked_reverse_op == false) {
4037
- f = RICHCOMPARE(type2);
4022
+ f = TP_RICHCOMPARE(type2);
4038
4023
 
4039
4024
  if (f != NULL) {
4040
4025
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -4045,7 +4030,7 @@ PyObject *RICH_COMPARE_GE_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
 
@@ -4057,13 +4042,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4057
4042
  case Py_EQ: {
4058
4043
  bool r = operand1 == operand2;
4059
4044
  PyObject *result = BOOL_FROM(r);
4060
- Py_INCREF(result);
4045
+ Py_INCREF_IMMORTAL(result);
4061
4046
  return result;
4062
4047
  }
4063
4048
  case Py_NE: {
4064
4049
  bool r = operand1 != operand2;
4065
4050
  PyObject *result = BOOL_FROM(r);
4066
- Py_INCREF(result);
4051
+ Py_INCREF_IMMORTAL(result);
4067
4052
  return result;
4068
4053
  }
4069
4054
  default:
@@ -4167,7 +4152,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4167
4152
  }
4168
4153
  }
4169
4154
 
4170
- Py_DECREF(result);
4155
+ Py_DECREF_IMMORTAL(result);
4171
4156
  }
4172
4157
 
4173
4158
  // No rich comparison worked, but maybe compare works.
@@ -4236,11 +4221,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4236
4221
  }
4237
4222
  }
4238
4223
 
4239
- Py_DECREF(result);
4224
+ Py_DECREF_IMMORTAL(result);
4240
4225
  }
4241
4226
  }
4242
4227
 
4243
- f = RICHCOMPARE(type1);
4228
+ f = TP_RICHCOMPARE(type1);
4244
4229
  if (f != NULL) {
4245
4230
  PyObject *result = (*f)(operand1, operand2, Py_GE);
4246
4231
 
@@ -4258,7 +4243,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4258
4243
  }
4259
4244
  }
4260
4245
 
4261
- Py_DECREF(result);
4246
+ Py_DECREF_IMMORTAL(result);
4262
4247
  }
4263
4248
 
4264
4249
  f = PyBytes_Type.tp_richcompare;
@@ -4279,7 +4264,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4279
4264
  }
4280
4265
  }
4281
4266
 
4282
- Py_DECREF(result);
4267
+ Py_DECREF_IMMORTAL(result);
4283
4268
  }
4284
4269
 
4285
4270
  int c;
@@ -4395,11 +4380,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4395
4380
  }
4396
4381
  }
4397
4382
 
4398
- Py_DECREF(result);
4383
+ Py_DECREF_IMMORTAL(result);
4399
4384
  }
4400
4385
  }
4401
4386
 
4402
- f = RICHCOMPARE(type1);
4387
+ f = TP_RICHCOMPARE(type1);
4403
4388
 
4404
4389
  if (f != NULL) {
4405
4390
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -4418,7 +4403,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4418
4403
  }
4419
4404
  }
4420
4405
 
4421
- Py_DECREF(result);
4406
+ Py_DECREF_IMMORTAL(result);
4422
4407
  }
4423
4408
 
4424
4409
  if (checked_reverse_op == false) {
@@ -4441,7 +4426,7 @@ nuitka_bool RICH_COMPARE_GE_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
 
@@ -4517,7 +4502,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4517
4502
  }
4518
4503
  }
4519
4504
 
4520
- Py_DECREF(result);
4505
+ Py_DECREF_IMMORTAL(result);
4521
4506
  }
4522
4507
 
4523
4508
  // No rich comparison worked, but maybe compare works.
@@ -4567,7 +4552,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4567
4552
  richcmpfunc f;
4568
4553
 
4569
4554
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4570
- f = RICHCOMPARE(type2);
4555
+ f = TP_RICHCOMPARE(type2);
4571
4556
 
4572
4557
  if (f != NULL) {
4573
4558
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -4586,7 +4571,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4586
4571
  }
4587
4572
  }
4588
4573
 
4589
- Py_DECREF(result);
4574
+ Py_DECREF_IMMORTAL(result);
4590
4575
  }
4591
4576
  }
4592
4577
 
@@ -4608,10 +4593,10 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4608
4593
  }
4609
4594
  }
4610
4595
 
4611
- Py_DECREF(result);
4596
+ Py_DECREF_IMMORTAL(result);
4612
4597
  }
4613
4598
 
4614
- f = RICHCOMPARE(type2);
4599
+ f = TP_RICHCOMPARE(type2);
4615
4600
  if (f != NULL) {
4616
4601
  PyObject *result = (*f)(operand2, operand1, Py_LE);
4617
4602
 
@@ -4629,7 +4614,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4629
4614
  }
4630
4615
  }
4631
4616
 
4632
- Py_DECREF(result);
4617
+ Py_DECREF_IMMORTAL(result);
4633
4618
  }
4634
4619
 
4635
4620
  int c;
@@ -4724,7 +4709,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4724
4709
  richcmpfunc f;
4725
4710
 
4726
4711
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4727
- f = RICHCOMPARE(type2);
4712
+ f = TP_RICHCOMPARE(type2);
4728
4713
 
4729
4714
  if (f != NULL) {
4730
4715
  checked_reverse_op = true;
@@ -4745,7 +4730,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4745
4730
  }
4746
4731
  }
4747
4732
 
4748
- Py_DECREF(result);
4733
+ Py_DECREF_IMMORTAL(result);
4749
4734
  }
4750
4735
  }
4751
4736
 
@@ -4768,11 +4753,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4768
4753
  }
4769
4754
  }
4770
4755
 
4771
- Py_DECREF(result);
4756
+ Py_DECREF_IMMORTAL(result);
4772
4757
  }
4773
4758
 
4774
4759
  if (checked_reverse_op == false) {
4775
- f = RICHCOMPARE(type2);
4760
+ f = TP_RICHCOMPARE(type2);
4776
4761
 
4777
4762
  if (f != NULL) {
4778
4763
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -4791,7 +4776,7 @@ nuitka_bool RICH_COMPARE_GE_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
 
@@ -4859,7 +4844,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4859
4844
  return result;
4860
4845
  }
4861
4846
 
4862
- Py_DECREF(result);
4847
+ Py_DECREF_IMMORTAL(result);
4863
4848
  }
4864
4849
 
4865
4850
  // No rich comparison worked, but maybe compare works.
@@ -4900,7 +4885,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4900
4885
 
4901
4886
  bool r = c != 0;
4902
4887
  PyObject *result = BOOL_FROM(r);
4903
- Py_INCREF(result);
4888
+ Py_INCREF_IMMORTAL(result);
4904
4889
  return result;
4905
4890
  }
4906
4891
  }
@@ -4920,11 +4905,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4920
4905
  return result;
4921
4906
  }
4922
4907
 
4923
- Py_DECREF(result);
4908
+ Py_DECREF_IMMORTAL(result);
4924
4909
  }
4925
4910
  }
4926
4911
 
4927
- f = RICHCOMPARE(type1);
4912
+ f = TP_RICHCOMPARE(type1);
4928
4913
  if (f != NULL) {
4929
4914
  PyObject *result = (*f)(operand1, operand2, Py_GE);
4930
4915
 
@@ -4934,7 +4919,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4934
4919
  return result;
4935
4920
  }
4936
4921
 
4937
- Py_DECREF(result);
4922
+ Py_DECREF_IMMORTAL(result);
4938
4923
  }
4939
4924
 
4940
4925
  f = NULL;
@@ -4947,7 +4932,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4947
4932
  return result;
4948
4933
  }
4949
4934
 
4950
- Py_DECREF(result);
4935
+ Py_DECREF_IMMORTAL(result);
4951
4936
  }
4952
4937
 
4953
4938
  int c;
@@ -5035,7 +5020,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5035
5020
 
5036
5021
  bool r = c != 0;
5037
5022
  PyObject *result = BOOL_FROM(r);
5038
- Py_INCREF(result);
5023
+ Py_INCREF_IMMORTAL(result);
5039
5024
  return result;
5040
5025
  #else
5041
5026
  bool checked_reverse_op = false;
@@ -5055,11 +5040,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5055
5040
  return result;
5056
5041
  }
5057
5042
 
5058
- Py_DECREF(result);
5043
+ Py_DECREF_IMMORTAL(result);
5059
5044
  }
5060
5045
  }
5061
5046
 
5062
- f = RICHCOMPARE(type1);
5047
+ f = TP_RICHCOMPARE(type1);
5063
5048
 
5064
5049
  if (f != NULL) {
5065
5050
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -5070,7 +5055,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5070
5055
  return result;
5071
5056
  }
5072
5057
 
5073
- Py_DECREF(result);
5058
+ Py_DECREF_IMMORTAL(result);
5074
5059
  }
5075
5060
 
5076
5061
  if (checked_reverse_op == false) {
@@ -5085,7 +5070,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5085
5070
  return result;
5086
5071
  }
5087
5072
 
5088
- Py_DECREF(result);
5073
+ Py_DECREF_IMMORTAL(result);
5089
5074
  }
5090
5075
  }
5091
5076
 
@@ -5097,13 +5082,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5097
5082
  case Py_EQ: {
5098
5083
  bool r = operand1 == operand2;
5099
5084
  PyObject *result = BOOL_FROM(r);
5100
- Py_INCREF(result);
5085
+ Py_INCREF_IMMORTAL(result);
5101
5086
  return result;
5102
5087
  }
5103
5088
  case Py_NE: {
5104
5089
  bool r = operand1 != operand2;
5105
5090
  PyObject *result = BOOL_FROM(r);
5106
- Py_INCREF(result);
5091
+ Py_INCREF_IMMORTAL(result);
5107
5092
  return result;
5108
5093
  }
5109
5094
  default:
@@ -5153,7 +5138,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5153
5138
  return result;
5154
5139
  }
5155
5140
 
5156
- Py_DECREF(result);
5141
+ Py_DECREF_IMMORTAL(result);
5157
5142
  }
5158
5143
 
5159
5144
  // No rich comparison worked, but maybe compare works.
@@ -5194,7 +5179,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5194
5179
 
5195
5180
  bool r = c != 0;
5196
5181
  PyObject *result = BOOL_FROM(r);
5197
- Py_INCREF(result);
5182
+ Py_INCREF_IMMORTAL(result);
5198
5183
  return result;
5199
5184
  }
5200
5185
  }
@@ -5203,7 +5188,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5203
5188
  richcmpfunc f;
5204
5189
 
5205
5190
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5206
- f = RICHCOMPARE(type2);
5191
+ f = TP_RICHCOMPARE(type2);
5207
5192
 
5208
5193
  if (f != NULL) {
5209
5194
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -5214,7 +5199,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5214
5199
  return result;
5215
5200
  }
5216
5201
 
5217
- Py_DECREF(result);
5202
+ Py_DECREF_IMMORTAL(result);
5218
5203
  }
5219
5204
  }
5220
5205
 
@@ -5228,10 +5213,10 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5228
5213
  return result;
5229
5214
  }
5230
5215
 
5231
- Py_DECREF(result);
5216
+ Py_DECREF_IMMORTAL(result);
5232
5217
  }
5233
5218
 
5234
- f = RICHCOMPARE(type2);
5219
+ f = TP_RICHCOMPARE(type2);
5235
5220
  if (f != NULL) {
5236
5221
  PyObject *result = (*f)(operand2, operand1, Py_LE);
5237
5222
 
@@ -5241,7 +5226,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5241
5226
  return result;
5242
5227
  }
5243
5228
 
5244
- Py_DECREF(result);
5229
+ Py_DECREF_IMMORTAL(result);
5245
5230
  }
5246
5231
 
5247
5232
  int c;
@@ -5329,14 +5314,14 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5329
5314
 
5330
5315
  bool r = c != 0;
5331
5316
  PyObject *result = BOOL_FROM(r);
5332
- Py_INCREF(result);
5317
+ Py_INCREF_IMMORTAL(result);
5333
5318
  return result;
5334
5319
  #else
5335
5320
  bool checked_reverse_op = false;
5336
5321
  richcmpfunc f;
5337
5322
 
5338
5323
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5339
- f = RICHCOMPARE(type2);
5324
+ f = TP_RICHCOMPARE(type2);
5340
5325
 
5341
5326
  if (f != NULL) {
5342
5327
  checked_reverse_op = true;
@@ -5349,7 +5334,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5349
5334
  return result;
5350
5335
  }
5351
5336
 
5352
- Py_DECREF(result);
5337
+ Py_DECREF_IMMORTAL(result);
5353
5338
  }
5354
5339
  }
5355
5340
 
@@ -5364,11 +5349,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5364
5349
  return result;
5365
5350
  }
5366
5351
 
5367
- Py_DECREF(result);
5352
+ Py_DECREF_IMMORTAL(result);
5368
5353
  }
5369
5354
 
5370
5355
  if (checked_reverse_op == false) {
5371
- f = RICHCOMPARE(type2);
5356
+ f = TP_RICHCOMPARE(type2);
5372
5357
 
5373
5358
  if (f != NULL) {
5374
5359
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -5379,7 +5364,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5379
5364
  return result;
5380
5365
  }
5381
5366
 
5382
- Py_DECREF(result);
5367
+ Py_DECREF_IMMORTAL(result);
5383
5368
  }
5384
5369
  }
5385
5370
 
@@ -5391,13 +5376,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5391
5376
  case Py_EQ: {
5392
5377
  bool r = operand1 == operand2;
5393
5378
  PyObject *result = BOOL_FROM(r);
5394
- Py_INCREF(result);
5379
+ Py_INCREF_IMMORTAL(result);
5395
5380
  return result;
5396
5381
  }
5397
5382
  case Py_NE: {
5398
5383
  bool r = operand1 != operand2;
5399
5384
  PyObject *result = BOOL_FROM(r);
5400
- Py_INCREF(result);
5385
+ Py_INCREF_IMMORTAL(result);
5401
5386
  return result;
5402
5387
  }
5403
5388
  default:
@@ -5455,7 +5440,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5455
5440
  }
5456
5441
  }
5457
5442
 
5458
- Py_DECREF(result);
5443
+ Py_DECREF_IMMORTAL(result);
5459
5444
  }
5460
5445
 
5461
5446
  // No rich comparison worked, but maybe compare works.
@@ -5524,11 +5509,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5524
5509
  }
5525
5510
  }
5526
5511
 
5527
- Py_DECREF(result);
5512
+ Py_DECREF_IMMORTAL(result);
5528
5513
  }
5529
5514
  }
5530
5515
 
5531
- f = RICHCOMPARE(type1);
5516
+ f = TP_RICHCOMPARE(type1);
5532
5517
  if (f != NULL) {
5533
5518
  PyObject *result = (*f)(operand1, operand2, Py_GE);
5534
5519
 
@@ -5546,7 +5531,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5546
5531
  }
5547
5532
  }
5548
5533
 
5549
- Py_DECREF(result);
5534
+ Py_DECREF_IMMORTAL(result);
5550
5535
  }
5551
5536
 
5552
5537
  f = NULL;
@@ -5567,7 +5552,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5567
5552
  }
5568
5553
  }
5569
5554
 
5570
- Py_DECREF(result);
5555
+ Py_DECREF_IMMORTAL(result);
5571
5556
  }
5572
5557
 
5573
5558
  int c;
@@ -5683,11 +5668,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5683
5668
  }
5684
5669
  }
5685
5670
 
5686
- Py_DECREF(result);
5671
+ Py_DECREF_IMMORTAL(result);
5687
5672
  }
5688
5673
  }
5689
5674
 
5690
- f = RICHCOMPARE(type1);
5675
+ f = TP_RICHCOMPARE(type1);
5691
5676
 
5692
5677
  if (f != NULL) {
5693
5678
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -5706,7 +5691,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5706
5691
  }
5707
5692
  }
5708
5693
 
5709
- Py_DECREF(result);
5694
+ Py_DECREF_IMMORTAL(result);
5710
5695
  }
5711
5696
 
5712
5697
  if (checked_reverse_op == false) {
@@ -5729,7 +5714,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5729
5714
  }
5730
5715
  }
5731
5716
 
5732
- Py_DECREF(result);
5717
+ Py_DECREF_IMMORTAL(result);
5733
5718
  }
5734
5719
  }
5735
5720
 
@@ -5805,7 +5790,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5805
5790
  }
5806
5791
  }
5807
5792
 
5808
- Py_DECREF(result);
5793
+ Py_DECREF_IMMORTAL(result);
5809
5794
  }
5810
5795
 
5811
5796
  // No rich comparison worked, but maybe compare works.
@@ -5855,7 +5840,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5855
5840
  richcmpfunc f;
5856
5841
 
5857
5842
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5858
- f = RICHCOMPARE(type2);
5843
+ f = TP_RICHCOMPARE(type2);
5859
5844
 
5860
5845
  if (f != NULL) {
5861
5846
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -5874,7 +5859,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5874
5859
  }
5875
5860
  }
5876
5861
 
5877
- Py_DECREF(result);
5862
+ Py_DECREF_IMMORTAL(result);
5878
5863
  }
5879
5864
  }
5880
5865
 
@@ -5896,10 +5881,10 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5896
5881
  }
5897
5882
  }
5898
5883
 
5899
- Py_DECREF(result);
5884
+ Py_DECREF_IMMORTAL(result);
5900
5885
  }
5901
5886
 
5902
- f = RICHCOMPARE(type2);
5887
+ f = TP_RICHCOMPARE(type2);
5903
5888
  if (f != NULL) {
5904
5889
  PyObject *result = (*f)(operand2, operand1, Py_LE);
5905
5890
 
@@ -5917,7 +5902,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5917
5902
  }
5918
5903
  }
5919
5904
 
5920
- Py_DECREF(result);
5905
+ Py_DECREF_IMMORTAL(result);
5921
5906
  }
5922
5907
 
5923
5908
  int c;
@@ -6012,7 +5997,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6012
5997
  richcmpfunc f;
6013
5998
 
6014
5999
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
6015
- f = RICHCOMPARE(type2);
6000
+ f = TP_RICHCOMPARE(type2);
6016
6001
 
6017
6002
  if (f != NULL) {
6018
6003
  checked_reverse_op = true;
@@ -6033,7 +6018,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6033
6018
  }
6034
6019
  }
6035
6020
 
6036
- Py_DECREF(result);
6021
+ Py_DECREF_IMMORTAL(result);
6037
6022
  }
6038
6023
  }
6039
6024
 
@@ -6056,11 +6041,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6056
6041
  }
6057
6042
  }
6058
6043
 
6059
- Py_DECREF(result);
6044
+ Py_DECREF_IMMORTAL(result);
6060
6045
  }
6061
6046
 
6062
6047
  if (checked_reverse_op == false) {
6063
- f = RICHCOMPARE(type2);
6048
+ f = TP_RICHCOMPARE(type2);
6064
6049
 
6065
6050
  if (f != NULL) {
6066
6051
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -6079,7 +6064,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6079
6064
  }
6080
6065
  }
6081
6066
 
6082
- Py_DECREF(result);
6067
+ Py_DECREF_IMMORTAL(result);
6083
6068
  }
6084
6069
  }
6085
6070
 
@@ -6126,15 +6111,19 @@ static PyObject *COMPARE_GE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6126
6111
 
6127
6112
  if (operand1_long_object == operand2_long_object) {
6128
6113
  r = true;
6129
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6130
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) > 0;
6114
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6115
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6116
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) >
6117
+ 0;
6131
6118
  } else {
6132
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6119
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6133
6120
  r = true;
6134
6121
  while (--i >= 0) {
6135
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6136
- r = operand1_long_object->ob_digit[i] > operand2_long_object->ob_digit[i];
6137
- if (Py_SIZE(operand1_long_object) < 0) {
6122
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6123
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6124
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] >
6125
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6126
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6138
6127
  r = !r;
6139
6128
  }
6140
6129
  break;
@@ -6144,7 +6133,7 @@ static PyObject *COMPARE_GE_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6144
6133
 
6145
6134
  // Convert to target type.
6146
6135
  PyObject *result = BOOL_FROM(r);
6147
- Py_INCREF(result);
6136
+ Py_INCREF_IMMORTAL(result);
6148
6137
  return result;
6149
6138
  }
6150
6139
  /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
@@ -6181,7 +6170,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6181
6170
  return result;
6182
6171
  }
6183
6172
 
6184
- Py_DECREF(result);
6173
+ Py_DECREF_IMMORTAL(result);
6185
6174
  }
6186
6175
 
6187
6176
  // No rich comparison worked, but maybe compare works.
@@ -6222,7 +6211,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6222
6211
 
6223
6212
  bool r = c != 0;
6224
6213
  PyObject *result = BOOL_FROM(r);
6225
- Py_INCREF(result);
6214
+ Py_INCREF_IMMORTAL(result);
6226
6215
  return result;
6227
6216
  }
6228
6217
  }
@@ -6242,11 +6231,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6242
6231
  return result;
6243
6232
  }
6244
6233
 
6245
- Py_DECREF(result);
6234
+ Py_DECREF_IMMORTAL(result);
6246
6235
  }
6247
6236
  }
6248
6237
 
6249
- f = RICHCOMPARE(type1);
6238
+ f = TP_RICHCOMPARE(type1);
6250
6239
  if (f != NULL) {
6251
6240
  PyObject *result = (*f)(operand1, operand2, Py_GE);
6252
6241
 
@@ -6256,7 +6245,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6256
6245
  return result;
6257
6246
  }
6258
6247
 
6259
- Py_DECREF(result);
6248
+ Py_DECREF_IMMORTAL(result);
6260
6249
  }
6261
6250
 
6262
6251
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6269,7 +6258,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6269
6258
  return result;
6270
6259
  }
6271
6260
 
6272
- Py_DECREF(result);
6261
+ Py_DECREF_IMMORTAL(result);
6273
6262
  }
6274
6263
 
6275
6264
  int c;
@@ -6357,7 +6346,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6357
6346
 
6358
6347
  bool r = c != 0;
6359
6348
  PyObject *result = BOOL_FROM(r);
6360
- Py_INCREF(result);
6349
+ Py_INCREF_IMMORTAL(result);
6361
6350
  return result;
6362
6351
  #else
6363
6352
  bool checked_reverse_op = false;
@@ -6377,11 +6366,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6377
6366
  return result;
6378
6367
  }
6379
6368
 
6380
- Py_DECREF(result);
6369
+ Py_DECREF_IMMORTAL(result);
6381
6370
  }
6382
6371
  }
6383
6372
 
6384
- f = RICHCOMPARE(type1);
6373
+ f = TP_RICHCOMPARE(type1);
6385
6374
 
6386
6375
  if (f != NULL) {
6387
6376
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -6392,7 +6381,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6392
6381
  return result;
6393
6382
  }
6394
6383
 
6395
- Py_DECREF(result);
6384
+ Py_DECREF_IMMORTAL(result);
6396
6385
  }
6397
6386
 
6398
6387
  if (checked_reverse_op == false) {
@@ -6407,7 +6396,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6407
6396
  return result;
6408
6397
  }
6409
6398
 
6410
- Py_DECREF(result);
6399
+ Py_DECREF_IMMORTAL(result);
6411
6400
  }
6412
6401
  }
6413
6402
 
@@ -6419,13 +6408,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6419
6408
  case Py_EQ: {
6420
6409
  bool r = operand1 == operand2;
6421
6410
  PyObject *result = BOOL_FROM(r);
6422
- Py_INCREF(result);
6411
+ Py_INCREF_IMMORTAL(result);
6423
6412
  return result;
6424
6413
  }
6425
6414
  case Py_NE: {
6426
6415
  bool r = operand1 != operand2;
6427
6416
  PyObject *result = BOOL_FROM(r);
6428
- Py_INCREF(result);
6417
+ Py_INCREF_IMMORTAL(result);
6429
6418
  return result;
6430
6419
  }
6431
6420
  default:
@@ -6475,7 +6464,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6475
6464
  return result;
6476
6465
  }
6477
6466
 
6478
- Py_DECREF(result);
6467
+ Py_DECREF_IMMORTAL(result);
6479
6468
  }
6480
6469
 
6481
6470
  // No rich comparison worked, but maybe compare works.
@@ -6516,7 +6505,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6516
6505
 
6517
6506
  bool r = c != 0;
6518
6507
  PyObject *result = BOOL_FROM(r);
6519
- Py_INCREF(result);
6508
+ Py_INCREF_IMMORTAL(result);
6520
6509
  return result;
6521
6510
  }
6522
6511
  }
@@ -6525,7 +6514,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6525
6514
  richcmpfunc f;
6526
6515
 
6527
6516
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6528
- f = RICHCOMPARE(type2);
6517
+ f = TP_RICHCOMPARE(type2);
6529
6518
 
6530
6519
  if (f != NULL) {
6531
6520
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -6536,7 +6525,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6536
6525
  return result;
6537
6526
  }
6538
6527
 
6539
- Py_DECREF(result);
6528
+ Py_DECREF_IMMORTAL(result);
6540
6529
  }
6541
6530
  }
6542
6531
 
@@ -6550,10 +6539,10 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6550
6539
  return result;
6551
6540
  }
6552
6541
 
6553
- Py_DECREF(result);
6542
+ Py_DECREF_IMMORTAL(result);
6554
6543
  }
6555
6544
 
6556
- f = RICHCOMPARE(type2);
6545
+ f = TP_RICHCOMPARE(type2);
6557
6546
  if (f != NULL) {
6558
6547
  PyObject *result = (*f)(operand2, operand1, Py_LE);
6559
6548
 
@@ -6563,7 +6552,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6563
6552
  return result;
6564
6553
  }
6565
6554
 
6566
- Py_DECREF(result);
6555
+ Py_DECREF_IMMORTAL(result);
6567
6556
  }
6568
6557
 
6569
6558
  int c;
@@ -6651,14 +6640,14 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6651
6640
 
6652
6641
  bool r = c != 0;
6653
6642
  PyObject *result = BOOL_FROM(r);
6654
- Py_INCREF(result);
6643
+ Py_INCREF_IMMORTAL(result);
6655
6644
  return result;
6656
6645
  #else
6657
6646
  bool checked_reverse_op = false;
6658
6647
  richcmpfunc f;
6659
6648
 
6660
6649
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6661
- f = RICHCOMPARE(type2);
6650
+ f = TP_RICHCOMPARE(type2);
6662
6651
 
6663
6652
  if (f != NULL) {
6664
6653
  checked_reverse_op = true;
@@ -6671,7 +6660,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6671
6660
  return result;
6672
6661
  }
6673
6662
 
6674
- Py_DECREF(result);
6663
+ Py_DECREF_IMMORTAL(result);
6675
6664
  }
6676
6665
  }
6677
6666
 
@@ -6686,11 +6675,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6686
6675
  return result;
6687
6676
  }
6688
6677
 
6689
- Py_DECREF(result);
6678
+ Py_DECREF_IMMORTAL(result);
6690
6679
  }
6691
6680
 
6692
6681
  if (checked_reverse_op == false) {
6693
- f = RICHCOMPARE(type2);
6682
+ f = TP_RICHCOMPARE(type2);
6694
6683
 
6695
6684
  if (f != NULL) {
6696
6685
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -6701,7 +6690,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6701
6690
  return result;
6702
6691
  }
6703
6692
 
6704
- Py_DECREF(result);
6693
+ Py_DECREF_IMMORTAL(result);
6705
6694
  }
6706
6695
  }
6707
6696
 
@@ -6713,13 +6702,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6713
6702
  case Py_EQ: {
6714
6703
  bool r = operand1 == operand2;
6715
6704
  PyObject *result = BOOL_FROM(r);
6716
- Py_INCREF(result);
6705
+ Py_INCREF_IMMORTAL(result);
6717
6706
  return result;
6718
6707
  }
6719
6708
  case Py_NE: {
6720
6709
  bool r = operand1 != operand2;
6721
6710
  PyObject *result = BOOL_FROM(r);
6722
- Py_INCREF(result);
6711
+ Py_INCREF_IMMORTAL(result);
6723
6712
  return result;
6724
6713
  }
6725
6714
  default:
@@ -6749,15 +6738,19 @@ static bool COMPARE_GE_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
6749
6738
 
6750
6739
  if (operand1_long_object == operand2_long_object) {
6751
6740
  r = true;
6752
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6753
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) > 0;
6741
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6742
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6743
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) >
6744
+ 0;
6754
6745
  } else {
6755
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6746
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6756
6747
  r = true;
6757
6748
  while (--i >= 0) {
6758
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6759
- r = operand1_long_object->ob_digit[i] > operand2_long_object->ob_digit[i];
6760
- if (Py_SIZE(operand1_long_object) < 0) {
6749
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6750
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6751
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] >
6752
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6753
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6761
6754
  r = !r;
6762
6755
  }
6763
6756
  break;
@@ -6812,7 +6805,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6812
6805
  }
6813
6806
  }
6814
6807
 
6815
- Py_DECREF(result);
6808
+ Py_DECREF_IMMORTAL(result);
6816
6809
  }
6817
6810
 
6818
6811
  // No rich comparison worked, but maybe compare works.
@@ -6881,11 +6874,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6881
6874
  }
6882
6875
  }
6883
6876
 
6884
- Py_DECREF(result);
6877
+ Py_DECREF_IMMORTAL(result);
6885
6878
  }
6886
6879
  }
6887
6880
 
6888
- f = RICHCOMPARE(type1);
6881
+ f = TP_RICHCOMPARE(type1);
6889
6882
  if (f != NULL) {
6890
6883
  PyObject *result = (*f)(operand1, operand2, Py_GE);
6891
6884
 
@@ -6903,7 +6896,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6903
6896
  }
6904
6897
  }
6905
6898
 
6906
- Py_DECREF(result);
6899
+ Py_DECREF_IMMORTAL(result);
6907
6900
  }
6908
6901
 
6909
6902
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6924,7 +6917,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6924
6917
  }
6925
6918
  }
6926
6919
 
6927
- Py_DECREF(result);
6920
+ Py_DECREF_IMMORTAL(result);
6928
6921
  }
6929
6922
 
6930
6923
  int c;
@@ -7040,11 +7033,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7040
7033
  }
7041
7034
  }
7042
7035
 
7043
- Py_DECREF(result);
7036
+ Py_DECREF_IMMORTAL(result);
7044
7037
  }
7045
7038
  }
7046
7039
 
7047
- f = RICHCOMPARE(type1);
7040
+ f = TP_RICHCOMPARE(type1);
7048
7041
 
7049
7042
  if (f != NULL) {
7050
7043
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -7063,7 +7056,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7063
7056
  }
7064
7057
  }
7065
7058
 
7066
- Py_DECREF(result);
7059
+ Py_DECREF_IMMORTAL(result);
7067
7060
  }
7068
7061
 
7069
7062
  if (checked_reverse_op == false) {
@@ -7086,7 +7079,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7086
7079
  }
7087
7080
  }
7088
7081
 
7089
- Py_DECREF(result);
7082
+ Py_DECREF_IMMORTAL(result);
7090
7083
  }
7091
7084
  }
7092
7085
 
@@ -7162,7 +7155,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7162
7155
  }
7163
7156
  }
7164
7157
 
7165
- Py_DECREF(result);
7158
+ Py_DECREF_IMMORTAL(result);
7166
7159
  }
7167
7160
 
7168
7161
  // No rich comparison worked, but maybe compare works.
@@ -7212,7 +7205,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7212
7205
  richcmpfunc f;
7213
7206
 
7214
7207
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7215
- f = RICHCOMPARE(type2);
7208
+ f = TP_RICHCOMPARE(type2);
7216
7209
 
7217
7210
  if (f != NULL) {
7218
7211
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -7231,7 +7224,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7231
7224
  }
7232
7225
  }
7233
7226
 
7234
- Py_DECREF(result);
7227
+ Py_DECREF_IMMORTAL(result);
7235
7228
  }
7236
7229
  }
7237
7230
 
@@ -7253,10 +7246,10 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7253
7246
  }
7254
7247
  }
7255
7248
 
7256
- Py_DECREF(result);
7249
+ Py_DECREF_IMMORTAL(result);
7257
7250
  }
7258
7251
 
7259
- f = RICHCOMPARE(type2);
7252
+ f = TP_RICHCOMPARE(type2);
7260
7253
  if (f != NULL) {
7261
7254
  PyObject *result = (*f)(operand2, operand1, Py_LE);
7262
7255
 
@@ -7274,7 +7267,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7274
7267
  }
7275
7268
  }
7276
7269
 
7277
- Py_DECREF(result);
7270
+ Py_DECREF_IMMORTAL(result);
7278
7271
  }
7279
7272
 
7280
7273
  int c;
@@ -7369,7 +7362,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7369
7362
  richcmpfunc f;
7370
7363
 
7371
7364
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7372
- f = RICHCOMPARE(type2);
7365
+ f = TP_RICHCOMPARE(type2);
7373
7366
 
7374
7367
  if (f != NULL) {
7375
7368
  checked_reverse_op = true;
@@ -7390,7 +7383,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7390
7383
  }
7391
7384
  }
7392
7385
 
7393
- Py_DECREF(result);
7386
+ Py_DECREF_IMMORTAL(result);
7394
7387
  }
7395
7388
  }
7396
7389
 
@@ -7413,11 +7406,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7413
7406
  }
7414
7407
  }
7415
7408
 
7416
- Py_DECREF(result);
7409
+ Py_DECREF_IMMORTAL(result);
7417
7410
  }
7418
7411
 
7419
7412
  if (checked_reverse_op == false) {
7420
- f = RICHCOMPARE(type2);
7413
+ f = TP_RICHCOMPARE(type2);
7421
7414
 
7422
7415
  if (f != NULL) {
7423
7416
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -7436,7 +7429,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7436
7429
  }
7437
7430
  }
7438
7431
 
7439
- Py_DECREF(result);
7432
+ Py_DECREF_IMMORTAL(result);
7440
7433
  }
7441
7434
  }
7442
7435
 
@@ -7483,7 +7476,7 @@ static PyObject *COMPARE_GE_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *ope
7483
7476
 
7484
7477
  // Convert to target type.
7485
7478
  PyObject *result = BOOL_FROM(r);
7486
- Py_INCREF(result);
7479
+ Py_INCREF_IMMORTAL(result);
7487
7480
  return result;
7488
7481
  }
7489
7482
  /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
@@ -7520,7 +7513,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7520
7513
  return result;
7521
7514
  }
7522
7515
 
7523
- Py_DECREF(result);
7516
+ Py_DECREF_IMMORTAL(result);
7524
7517
  }
7525
7518
 
7526
7519
  // No rich comparison worked, but maybe compare works.
@@ -7561,7 +7554,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7561
7554
 
7562
7555
  bool r = c != 0;
7563
7556
  PyObject *result = BOOL_FROM(r);
7564
- Py_INCREF(result);
7557
+ Py_INCREF_IMMORTAL(result);
7565
7558
  return result;
7566
7559
  }
7567
7560
  }
@@ -7581,11 +7574,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7581
7574
  return result;
7582
7575
  }
7583
7576
 
7584
- Py_DECREF(result);
7577
+ Py_DECREF_IMMORTAL(result);
7585
7578
  }
7586
7579
  }
7587
7580
 
7588
- f = RICHCOMPARE(type1);
7581
+ f = TP_RICHCOMPARE(type1);
7589
7582
  if (f != NULL) {
7590
7583
  PyObject *result = (*f)(operand1, operand2, Py_GE);
7591
7584
 
@@ -7595,7 +7588,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7595
7588
  return result;
7596
7589
  }
7597
7590
 
7598
- Py_DECREF(result);
7591
+ Py_DECREF_IMMORTAL(result);
7599
7592
  }
7600
7593
 
7601
7594
  f = PyFloat_Type.tp_richcompare;
@@ -7608,7 +7601,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7608
7601
  return result;
7609
7602
  }
7610
7603
 
7611
- Py_DECREF(result);
7604
+ Py_DECREF_IMMORTAL(result);
7612
7605
  }
7613
7606
 
7614
7607
  int c;
@@ -7696,7 +7689,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7696
7689
 
7697
7690
  bool r = c != 0;
7698
7691
  PyObject *result = BOOL_FROM(r);
7699
- Py_INCREF(result);
7692
+ Py_INCREF_IMMORTAL(result);
7700
7693
  return result;
7701
7694
  #else
7702
7695
  bool checked_reverse_op = false;
@@ -7716,11 +7709,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7716
7709
  return result;
7717
7710
  }
7718
7711
 
7719
- Py_DECREF(result);
7712
+ Py_DECREF_IMMORTAL(result);
7720
7713
  }
7721
7714
  }
7722
7715
 
7723
- f = RICHCOMPARE(type1);
7716
+ f = TP_RICHCOMPARE(type1);
7724
7717
 
7725
7718
  if (f != NULL) {
7726
7719
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -7731,7 +7724,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7731
7724
  return result;
7732
7725
  }
7733
7726
 
7734
- Py_DECREF(result);
7727
+ Py_DECREF_IMMORTAL(result);
7735
7728
  }
7736
7729
 
7737
7730
  if (checked_reverse_op == false) {
@@ -7746,7 +7739,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7746
7739
  return result;
7747
7740
  }
7748
7741
 
7749
- Py_DECREF(result);
7742
+ Py_DECREF_IMMORTAL(result);
7750
7743
  }
7751
7744
  }
7752
7745
 
@@ -7758,13 +7751,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7758
7751
  case Py_EQ: {
7759
7752
  bool r = operand1 == operand2;
7760
7753
  PyObject *result = BOOL_FROM(r);
7761
- Py_INCREF(result);
7754
+ Py_INCREF_IMMORTAL(result);
7762
7755
  return result;
7763
7756
  }
7764
7757
  case Py_NE: {
7765
7758
  bool r = operand1 != operand2;
7766
7759
  PyObject *result = BOOL_FROM(r);
7767
- Py_INCREF(result);
7760
+ Py_INCREF_IMMORTAL(result);
7768
7761
  return result;
7769
7762
  }
7770
7763
  default:
@@ -7812,7 +7805,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7812
7805
  return result;
7813
7806
  }
7814
7807
 
7815
- Py_DECREF(result);
7808
+ Py_DECREF_IMMORTAL(result);
7816
7809
  }
7817
7810
 
7818
7811
  // No rich comparison worked, but maybe compare works.
@@ -7853,7 +7846,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7853
7846
 
7854
7847
  bool r = c != 0;
7855
7848
  PyObject *result = BOOL_FROM(r);
7856
- Py_INCREF(result);
7849
+ Py_INCREF_IMMORTAL(result);
7857
7850
  return result;
7858
7851
  }
7859
7852
  }
@@ -7862,7 +7855,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7862
7855
  richcmpfunc f;
7863
7856
 
7864
7857
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
7865
- f = RICHCOMPARE(type2);
7858
+ f = TP_RICHCOMPARE(type2);
7866
7859
 
7867
7860
  if (f != NULL) {
7868
7861
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -7873,7 +7866,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7873
7866
  return result;
7874
7867
  }
7875
7868
 
7876
- Py_DECREF(result);
7869
+ Py_DECREF_IMMORTAL(result);
7877
7870
  }
7878
7871
  }
7879
7872
 
@@ -7887,10 +7880,10 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7887
7880
  return result;
7888
7881
  }
7889
7882
 
7890
- Py_DECREF(result);
7883
+ Py_DECREF_IMMORTAL(result);
7891
7884
  }
7892
7885
 
7893
- f = RICHCOMPARE(type2);
7886
+ f = TP_RICHCOMPARE(type2);
7894
7887
  if (f != NULL) {
7895
7888
  PyObject *result = (*f)(operand2, operand1, Py_LE);
7896
7889
 
@@ -7900,7 +7893,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7900
7893
  return result;
7901
7894
  }
7902
7895
 
7903
- Py_DECREF(result);
7896
+ Py_DECREF_IMMORTAL(result);
7904
7897
  }
7905
7898
 
7906
7899
  int c;
@@ -7988,14 +7981,14 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7988
7981
 
7989
7982
  bool r = c != 0;
7990
7983
  PyObject *result = BOOL_FROM(r);
7991
- Py_INCREF(result);
7984
+ Py_INCREF_IMMORTAL(result);
7992
7985
  return result;
7993
7986
  #else
7994
7987
  bool checked_reverse_op = false;
7995
7988
  richcmpfunc f;
7996
7989
 
7997
7990
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
7998
- f = RICHCOMPARE(type2);
7991
+ f = TP_RICHCOMPARE(type2);
7999
7992
 
8000
7993
  if (f != NULL) {
8001
7994
  checked_reverse_op = true;
@@ -8008,7 +8001,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8008
8001
  return result;
8009
8002
  }
8010
8003
 
8011
- Py_DECREF(result);
8004
+ Py_DECREF_IMMORTAL(result);
8012
8005
  }
8013
8006
  }
8014
8007
 
@@ -8023,11 +8016,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8023
8016
  return result;
8024
8017
  }
8025
8018
 
8026
- Py_DECREF(result);
8019
+ Py_DECREF_IMMORTAL(result);
8027
8020
  }
8028
8021
 
8029
8022
  if (checked_reverse_op == false) {
8030
- f = RICHCOMPARE(type2);
8023
+ f = TP_RICHCOMPARE(type2);
8031
8024
 
8032
8025
  if (f != NULL) {
8033
8026
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -8038,7 +8031,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8038
8031
  return result;
8039
8032
  }
8040
8033
 
8041
- Py_DECREF(result);
8034
+ Py_DECREF_IMMORTAL(result);
8042
8035
  }
8043
8036
  }
8044
8037
 
@@ -8050,13 +8043,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8050
8043
  case Py_EQ: {
8051
8044
  bool r = operand1 == operand2;
8052
8045
  PyObject *result = BOOL_FROM(r);
8053
- Py_INCREF(result);
8046
+ Py_INCREF_IMMORTAL(result);
8054
8047
  return result;
8055
8048
  }
8056
8049
  case Py_NE: {
8057
8050
  bool r = operand1 != operand2;
8058
8051
  PyObject *result = BOOL_FROM(r);
8059
- Py_INCREF(result);
8052
+ Py_INCREF_IMMORTAL(result);
8060
8053
  return result;
8061
8054
  }
8062
8055
  default:
@@ -8128,7 +8121,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8128
8121
  }
8129
8122
  }
8130
8123
 
8131
- Py_DECREF(result);
8124
+ Py_DECREF_IMMORTAL(result);
8132
8125
  }
8133
8126
 
8134
8127
  // No rich comparison worked, but maybe compare works.
@@ -8197,11 +8190,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8197
8190
  }
8198
8191
  }
8199
8192
 
8200
- Py_DECREF(result);
8193
+ Py_DECREF_IMMORTAL(result);
8201
8194
  }
8202
8195
  }
8203
8196
 
8204
- f = RICHCOMPARE(type1);
8197
+ f = TP_RICHCOMPARE(type1);
8205
8198
  if (f != NULL) {
8206
8199
  PyObject *result = (*f)(operand1, operand2, Py_GE);
8207
8200
 
@@ -8219,7 +8212,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8219
8212
  }
8220
8213
  }
8221
8214
 
8222
- Py_DECREF(result);
8215
+ Py_DECREF_IMMORTAL(result);
8223
8216
  }
8224
8217
 
8225
8218
  f = PyFloat_Type.tp_richcompare;
@@ -8240,7 +8233,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8240
8233
  }
8241
8234
  }
8242
8235
 
8243
- Py_DECREF(result);
8236
+ Py_DECREF_IMMORTAL(result);
8244
8237
  }
8245
8238
 
8246
8239
  int c;
@@ -8356,11 +8349,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8356
8349
  }
8357
8350
  }
8358
8351
 
8359
- Py_DECREF(result);
8352
+ Py_DECREF_IMMORTAL(result);
8360
8353
  }
8361
8354
  }
8362
8355
 
8363
- f = RICHCOMPARE(type1);
8356
+ f = TP_RICHCOMPARE(type1);
8364
8357
 
8365
8358
  if (f != NULL) {
8366
8359
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -8379,7 +8372,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8379
8372
  }
8380
8373
  }
8381
8374
 
8382
- Py_DECREF(result);
8375
+ Py_DECREF_IMMORTAL(result);
8383
8376
  }
8384
8377
 
8385
8378
  if (checked_reverse_op == false) {
@@ -8402,7 +8395,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8402
8395
  }
8403
8396
  }
8404
8397
 
8405
- Py_DECREF(result);
8398
+ Py_DECREF_IMMORTAL(result);
8406
8399
  }
8407
8400
  }
8408
8401
 
@@ -8476,7 +8469,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8476
8469
  }
8477
8470
  }
8478
8471
 
8479
- Py_DECREF(result);
8472
+ Py_DECREF_IMMORTAL(result);
8480
8473
  }
8481
8474
 
8482
8475
  // No rich comparison worked, but maybe compare works.
@@ -8526,7 +8519,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8526
8519
  richcmpfunc f;
8527
8520
 
8528
8521
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8529
- f = RICHCOMPARE(type2);
8522
+ f = TP_RICHCOMPARE(type2);
8530
8523
 
8531
8524
  if (f != NULL) {
8532
8525
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -8545,7 +8538,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8545
8538
  }
8546
8539
  }
8547
8540
 
8548
- Py_DECREF(result);
8541
+ Py_DECREF_IMMORTAL(result);
8549
8542
  }
8550
8543
  }
8551
8544
 
@@ -8567,10 +8560,10 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8567
8560
  }
8568
8561
  }
8569
8562
 
8570
- Py_DECREF(result);
8563
+ Py_DECREF_IMMORTAL(result);
8571
8564
  }
8572
8565
 
8573
- f = RICHCOMPARE(type2);
8566
+ f = TP_RICHCOMPARE(type2);
8574
8567
  if (f != NULL) {
8575
8568
  PyObject *result = (*f)(operand2, operand1, Py_LE);
8576
8569
 
@@ -8588,7 +8581,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8588
8581
  }
8589
8582
  }
8590
8583
 
8591
- Py_DECREF(result);
8584
+ Py_DECREF_IMMORTAL(result);
8592
8585
  }
8593
8586
 
8594
8587
  int c;
@@ -8683,7 +8676,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8683
8676
  richcmpfunc f;
8684
8677
 
8685
8678
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8686
- f = RICHCOMPARE(type2);
8679
+ f = TP_RICHCOMPARE(type2);
8687
8680
 
8688
8681
  if (f != NULL) {
8689
8682
  checked_reverse_op = true;
@@ -8704,7 +8697,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8704
8697
  }
8705
8698
  }
8706
8699
 
8707
- Py_DECREF(result);
8700
+ Py_DECREF_IMMORTAL(result);
8708
8701
  }
8709
8702
  }
8710
8703
 
@@ -8727,11 +8720,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8727
8720
  }
8728
8721
  }
8729
8722
 
8730
- Py_DECREF(result);
8723
+ Py_DECREF_IMMORTAL(result);
8731
8724
  }
8732
8725
 
8733
8726
  if (checked_reverse_op == false) {
8734
- f = RICHCOMPARE(type2);
8727
+ f = TP_RICHCOMPARE(type2);
8735
8728
 
8736
8729
  if (f != NULL) {
8737
8730
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -8750,7 +8743,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8750
8743
  }
8751
8744
  }
8752
8745
 
8753
- Py_DECREF(result);
8746
+ Py_DECREF_IMMORTAL(result);
8754
8747
  }
8755
8748
  }
8756
8749
 
@@ -8823,7 +8816,7 @@ static PyObject *COMPARE_GE_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *ope
8823
8816
 
8824
8817
  // Convert to target type.
8825
8818
  PyObject *result = BOOL_FROM(r);
8826
- Py_INCREF(result);
8819
+ Py_INCREF_IMMORTAL(result);
8827
8820
  return result;
8828
8821
  }
8829
8822
 
@@ -8863,7 +8856,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8863
8856
  return result;
8864
8857
  }
8865
8858
 
8866
- Py_DECREF(result);
8859
+ Py_DECREF_IMMORTAL(result);
8867
8860
  }
8868
8861
 
8869
8862
  // No rich comparison worked, but maybe compare works.
@@ -8904,7 +8897,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8904
8897
 
8905
8898
  bool r = c != 0;
8906
8899
  PyObject *result = BOOL_FROM(r);
8907
- Py_INCREF(result);
8900
+ Py_INCREF_IMMORTAL(result);
8908
8901
  return result;
8909
8902
  }
8910
8903
  }
@@ -8924,11 +8917,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8924
8917
  return result;
8925
8918
  }
8926
8919
 
8927
- Py_DECREF(result);
8920
+ Py_DECREF_IMMORTAL(result);
8928
8921
  }
8929
8922
  }
8930
8923
 
8931
- f = RICHCOMPARE(type1);
8924
+ f = TP_RICHCOMPARE(type1);
8932
8925
  if (f != NULL) {
8933
8926
  PyObject *result = (*f)(operand1, operand2, Py_GE);
8934
8927
 
@@ -8938,7 +8931,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8938
8931
  return result;
8939
8932
  }
8940
8933
 
8941
- Py_DECREF(result);
8934
+ Py_DECREF_IMMORTAL(result);
8942
8935
  }
8943
8936
 
8944
8937
  f = PyTuple_Type.tp_richcompare;
@@ -8951,7 +8944,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8951
8944
  return result;
8952
8945
  }
8953
8946
 
8954
- Py_DECREF(result);
8947
+ Py_DECREF_IMMORTAL(result);
8955
8948
  }
8956
8949
 
8957
8950
  int c;
@@ -9039,7 +9032,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9039
9032
 
9040
9033
  bool r = c != 0;
9041
9034
  PyObject *result = BOOL_FROM(r);
9042
- Py_INCREF(result);
9035
+ Py_INCREF_IMMORTAL(result);
9043
9036
  return result;
9044
9037
  #else
9045
9038
  bool checked_reverse_op = false;
@@ -9059,11 +9052,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9059
9052
  return result;
9060
9053
  }
9061
9054
 
9062
- Py_DECREF(result);
9055
+ Py_DECREF_IMMORTAL(result);
9063
9056
  }
9064
9057
  }
9065
9058
 
9066
- f = RICHCOMPARE(type1);
9059
+ f = TP_RICHCOMPARE(type1);
9067
9060
 
9068
9061
  if (f != NULL) {
9069
9062
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -9074,7 +9067,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9074
9067
  return result;
9075
9068
  }
9076
9069
 
9077
- Py_DECREF(result);
9070
+ Py_DECREF_IMMORTAL(result);
9078
9071
  }
9079
9072
 
9080
9073
  if (checked_reverse_op == false) {
@@ -9089,7 +9082,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9089
9082
  return result;
9090
9083
  }
9091
9084
 
9092
- Py_DECREF(result);
9085
+ Py_DECREF_IMMORTAL(result);
9093
9086
  }
9094
9087
  }
9095
9088
 
@@ -9101,13 +9094,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9101
9094
  case Py_EQ: {
9102
9095
  bool r = operand1 == operand2;
9103
9096
  PyObject *result = BOOL_FROM(r);
9104
- Py_INCREF(result);
9097
+ Py_INCREF_IMMORTAL(result);
9105
9098
  return result;
9106
9099
  }
9107
9100
  case Py_NE: {
9108
9101
  bool r = operand1 != operand2;
9109
9102
  PyObject *result = BOOL_FROM(r);
9110
- Py_INCREF(result);
9103
+ Py_INCREF_IMMORTAL(result);
9111
9104
  return result;
9112
9105
  }
9113
9106
  default:
@@ -9155,7 +9148,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9155
9148
  return result;
9156
9149
  }
9157
9150
 
9158
- Py_DECREF(result);
9151
+ Py_DECREF_IMMORTAL(result);
9159
9152
  }
9160
9153
 
9161
9154
  // No rich comparison worked, but maybe compare works.
@@ -9196,7 +9189,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9196
9189
 
9197
9190
  bool r = c != 0;
9198
9191
  PyObject *result = BOOL_FROM(r);
9199
- Py_INCREF(result);
9192
+ Py_INCREF_IMMORTAL(result);
9200
9193
  return result;
9201
9194
  }
9202
9195
  }
@@ -9205,7 +9198,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9205
9198
  richcmpfunc f;
9206
9199
 
9207
9200
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9208
- f = RICHCOMPARE(type2);
9201
+ f = TP_RICHCOMPARE(type2);
9209
9202
 
9210
9203
  if (f != NULL) {
9211
9204
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -9216,7 +9209,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9216
9209
  return result;
9217
9210
  }
9218
9211
 
9219
- Py_DECREF(result);
9212
+ Py_DECREF_IMMORTAL(result);
9220
9213
  }
9221
9214
  }
9222
9215
 
@@ -9230,10 +9223,10 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9230
9223
  return result;
9231
9224
  }
9232
9225
 
9233
- Py_DECREF(result);
9226
+ Py_DECREF_IMMORTAL(result);
9234
9227
  }
9235
9228
 
9236
- f = RICHCOMPARE(type2);
9229
+ f = TP_RICHCOMPARE(type2);
9237
9230
  if (f != NULL) {
9238
9231
  PyObject *result = (*f)(operand2, operand1, Py_LE);
9239
9232
 
@@ -9243,7 +9236,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9243
9236
  return result;
9244
9237
  }
9245
9238
 
9246
- Py_DECREF(result);
9239
+ Py_DECREF_IMMORTAL(result);
9247
9240
  }
9248
9241
 
9249
9242
  int c;
@@ -9331,14 +9324,14 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9331
9324
 
9332
9325
  bool r = c != 0;
9333
9326
  PyObject *result = BOOL_FROM(r);
9334
- Py_INCREF(result);
9327
+ Py_INCREF_IMMORTAL(result);
9335
9328
  return result;
9336
9329
  #else
9337
9330
  bool checked_reverse_op = false;
9338
9331
  richcmpfunc f;
9339
9332
 
9340
9333
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9341
- f = RICHCOMPARE(type2);
9334
+ f = TP_RICHCOMPARE(type2);
9342
9335
 
9343
9336
  if (f != NULL) {
9344
9337
  checked_reverse_op = true;
@@ -9351,7 +9344,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9351
9344
  return result;
9352
9345
  }
9353
9346
 
9354
- Py_DECREF(result);
9347
+ Py_DECREF_IMMORTAL(result);
9355
9348
  }
9356
9349
  }
9357
9350
 
@@ -9366,11 +9359,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9366
9359
  return result;
9367
9360
  }
9368
9361
 
9369
- Py_DECREF(result);
9362
+ Py_DECREF_IMMORTAL(result);
9370
9363
  }
9371
9364
 
9372
9365
  if (checked_reverse_op == false) {
9373
- f = RICHCOMPARE(type2);
9366
+ f = TP_RICHCOMPARE(type2);
9374
9367
 
9375
9368
  if (f != NULL) {
9376
9369
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -9381,7 +9374,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9381
9374
  return result;
9382
9375
  }
9383
9376
 
9384
- Py_DECREF(result);
9377
+ Py_DECREF_IMMORTAL(result);
9385
9378
  }
9386
9379
  }
9387
9380
 
@@ -9393,13 +9386,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9393
9386
  case Py_EQ: {
9394
9387
  bool r = operand1 == operand2;
9395
9388
  PyObject *result = BOOL_FROM(r);
9396
- Py_INCREF(result);
9389
+ Py_INCREF_IMMORTAL(result);
9397
9390
  return result;
9398
9391
  }
9399
9392
  case Py_NE: {
9400
9393
  bool r = operand1 != operand2;
9401
9394
  PyObject *result = BOOL_FROM(r);
9402
- Py_INCREF(result);
9395
+ Py_INCREF_IMMORTAL(result);
9403
9396
  return result;
9404
9397
  }
9405
9398
  default:
@@ -9508,7 +9501,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9508
9501
  }
9509
9502
  }
9510
9503
 
9511
- Py_DECREF(result);
9504
+ Py_DECREF_IMMORTAL(result);
9512
9505
  }
9513
9506
 
9514
9507
  // No rich comparison worked, but maybe compare works.
@@ -9577,11 +9570,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9577
9570
  }
9578
9571
  }
9579
9572
 
9580
- Py_DECREF(result);
9573
+ Py_DECREF_IMMORTAL(result);
9581
9574
  }
9582
9575
  }
9583
9576
 
9584
- f = RICHCOMPARE(type1);
9577
+ f = TP_RICHCOMPARE(type1);
9585
9578
  if (f != NULL) {
9586
9579
  PyObject *result = (*f)(operand1, operand2, Py_GE);
9587
9580
 
@@ -9599,7 +9592,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9599
9592
  }
9600
9593
  }
9601
9594
 
9602
- Py_DECREF(result);
9595
+ Py_DECREF_IMMORTAL(result);
9603
9596
  }
9604
9597
 
9605
9598
  f = PyTuple_Type.tp_richcompare;
@@ -9620,7 +9613,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9620
9613
  }
9621
9614
  }
9622
9615
 
9623
- Py_DECREF(result);
9616
+ Py_DECREF_IMMORTAL(result);
9624
9617
  }
9625
9618
 
9626
9619
  int c;
@@ -9736,11 +9729,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9736
9729
  }
9737
9730
  }
9738
9731
 
9739
- Py_DECREF(result);
9732
+ Py_DECREF_IMMORTAL(result);
9740
9733
  }
9741
9734
  }
9742
9735
 
9743
- f = RICHCOMPARE(type1);
9736
+ f = TP_RICHCOMPARE(type1);
9744
9737
 
9745
9738
  if (f != NULL) {
9746
9739
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -9759,7 +9752,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9759
9752
  }
9760
9753
  }
9761
9754
 
9762
- Py_DECREF(result);
9755
+ Py_DECREF_IMMORTAL(result);
9763
9756
  }
9764
9757
 
9765
9758
  if (checked_reverse_op == false) {
@@ -9782,7 +9775,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9782
9775
  }
9783
9776
  }
9784
9777
 
9785
- Py_DECREF(result);
9778
+ Py_DECREF_IMMORTAL(result);
9786
9779
  }
9787
9780
  }
9788
9781
 
@@ -9856,7 +9849,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9856
9849
  }
9857
9850
  }
9858
9851
 
9859
- Py_DECREF(result);
9852
+ Py_DECREF_IMMORTAL(result);
9860
9853
  }
9861
9854
 
9862
9855
  // No rich comparison worked, but maybe compare works.
@@ -9906,7 +9899,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9906
9899
  richcmpfunc f;
9907
9900
 
9908
9901
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9909
- f = RICHCOMPARE(type2);
9902
+ f = TP_RICHCOMPARE(type2);
9910
9903
 
9911
9904
  if (f != NULL) {
9912
9905
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -9925,7 +9918,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9925
9918
  }
9926
9919
  }
9927
9920
 
9928
- Py_DECREF(result);
9921
+ Py_DECREF_IMMORTAL(result);
9929
9922
  }
9930
9923
  }
9931
9924
 
@@ -9947,10 +9940,10 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9947
9940
  }
9948
9941
  }
9949
9942
 
9950
- Py_DECREF(result);
9943
+ Py_DECREF_IMMORTAL(result);
9951
9944
  }
9952
9945
 
9953
- f = RICHCOMPARE(type2);
9946
+ f = TP_RICHCOMPARE(type2);
9954
9947
  if (f != NULL) {
9955
9948
  PyObject *result = (*f)(operand2, operand1, Py_LE);
9956
9949
 
@@ -9968,7 +9961,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9968
9961
  }
9969
9962
  }
9970
9963
 
9971
- Py_DECREF(result);
9964
+ Py_DECREF_IMMORTAL(result);
9972
9965
  }
9973
9966
 
9974
9967
  int c;
@@ -10063,7 +10056,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10063
10056
  richcmpfunc f;
10064
10057
 
10065
10058
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
10066
- f = RICHCOMPARE(type2);
10059
+ f = TP_RICHCOMPARE(type2);
10067
10060
 
10068
10061
  if (f != NULL) {
10069
10062
  checked_reverse_op = true;
@@ -10084,7 +10077,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10084
10077
  }
10085
10078
  }
10086
10079
 
10087
- Py_DECREF(result);
10080
+ Py_DECREF_IMMORTAL(result);
10088
10081
  }
10089
10082
  }
10090
10083
 
@@ -10107,11 +10100,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10107
10100
  }
10108
10101
  }
10109
10102
 
10110
- Py_DECREF(result);
10103
+ Py_DECREF_IMMORTAL(result);
10111
10104
  }
10112
10105
 
10113
10106
  if (checked_reverse_op == false) {
10114
- f = RICHCOMPARE(type2);
10107
+ f = TP_RICHCOMPARE(type2);
10115
10108
 
10116
10109
  if (f != NULL) {
10117
10110
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -10130,7 +10123,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10130
10123
  }
10131
10124
  }
10132
10125
 
10133
- Py_DECREF(result);
10126
+ Py_DECREF_IMMORTAL(result);
10134
10127
  }
10135
10128
  }
10136
10129
 
@@ -10177,14 +10170,11 @@ static PyObject *COMPARE_GE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10177
10170
  PyListObject *a = (PyListObject *)operand1;
10178
10171
  PyListObject *b = (PyListObject *)operand2;
10179
10172
 
10180
- Py_ssize_t len_a = Py_SIZE(a);
10181
- Py_ssize_t len_b = Py_SIZE(b);
10182
-
10183
10173
  bool found = false;
10184
10174
  nuitka_bool res = NUITKA_BOOL_TRUE;
10185
10175
 
10186
10176
  Py_ssize_t i;
10187
- for (i = 0; i < len_a && i < len_b; i++) {
10177
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10188
10178
  PyObject *aa = a->ob_item[i];
10189
10179
  PyObject *bb = b->ob_item[i];
10190
10180
 
@@ -10192,7 +10182,11 @@ static PyObject *COMPARE_GE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10192
10182
  continue;
10193
10183
  }
10194
10184
 
10185
+ Py_INCREF(aa);
10186
+ Py_INCREF(bb);
10195
10187
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10188
+ Py_DECREF(aa);
10189
+ Py_DECREF(bb);
10196
10190
 
10197
10191
  if (res == NUITKA_BOOL_EXCEPTION) {
10198
10192
  return NULL;
@@ -10205,11 +10199,11 @@ static PyObject *COMPARE_GE_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10205
10199
  }
10206
10200
 
10207
10201
  if (found == false) {
10208
- bool r = len_a >= len_b;
10202
+ bool r = Py_SIZE(a) >= Py_SIZE(b);
10209
10203
 
10210
10204
  // Convert to target type.
10211
10205
  PyObject *result = BOOL_FROM(r);
10212
- Py_INCREF(result);
10206
+ Py_INCREF_IMMORTAL(result);
10213
10207
  return result;
10214
10208
  }
10215
10209
 
@@ -10249,7 +10243,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10249
10243
  return result;
10250
10244
  }
10251
10245
 
10252
- Py_DECREF(result);
10246
+ Py_DECREF_IMMORTAL(result);
10253
10247
  }
10254
10248
 
10255
10249
  // No rich comparison worked, but maybe compare works.
@@ -10290,7 +10284,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10290
10284
 
10291
10285
  bool r = c != 0;
10292
10286
  PyObject *result = BOOL_FROM(r);
10293
- Py_INCREF(result);
10287
+ Py_INCREF_IMMORTAL(result);
10294
10288
  return result;
10295
10289
  }
10296
10290
  }
@@ -10310,11 +10304,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10310
10304
  return result;
10311
10305
  }
10312
10306
 
10313
- Py_DECREF(result);
10307
+ Py_DECREF_IMMORTAL(result);
10314
10308
  }
10315
10309
  }
10316
10310
 
10317
- f = RICHCOMPARE(type1);
10311
+ f = TP_RICHCOMPARE(type1);
10318
10312
  if (f != NULL) {
10319
10313
  PyObject *result = (*f)(operand1, operand2, Py_GE);
10320
10314
 
@@ -10324,7 +10318,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10324
10318
  return result;
10325
10319
  }
10326
10320
 
10327
- Py_DECREF(result);
10321
+ Py_DECREF_IMMORTAL(result);
10328
10322
  }
10329
10323
 
10330
10324
  f = PyList_Type.tp_richcompare;
@@ -10337,7 +10331,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10337
10331
  return result;
10338
10332
  }
10339
10333
 
10340
- Py_DECREF(result);
10334
+ Py_DECREF_IMMORTAL(result);
10341
10335
  }
10342
10336
 
10343
10337
  int c;
@@ -10425,7 +10419,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10425
10419
 
10426
10420
  bool r = c != 0;
10427
10421
  PyObject *result = BOOL_FROM(r);
10428
- Py_INCREF(result);
10422
+ Py_INCREF_IMMORTAL(result);
10429
10423
  return result;
10430
10424
  #else
10431
10425
  bool checked_reverse_op = false;
@@ -10445,11 +10439,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10445
10439
  return result;
10446
10440
  }
10447
10441
 
10448
- Py_DECREF(result);
10442
+ Py_DECREF_IMMORTAL(result);
10449
10443
  }
10450
10444
  }
10451
10445
 
10452
- f = RICHCOMPARE(type1);
10446
+ f = TP_RICHCOMPARE(type1);
10453
10447
 
10454
10448
  if (f != NULL) {
10455
10449
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -10460,7 +10454,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10460
10454
  return result;
10461
10455
  }
10462
10456
 
10463
- Py_DECREF(result);
10457
+ Py_DECREF_IMMORTAL(result);
10464
10458
  }
10465
10459
 
10466
10460
  if (checked_reverse_op == false) {
@@ -10475,7 +10469,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10475
10469
  return result;
10476
10470
  }
10477
10471
 
10478
- Py_DECREF(result);
10472
+ Py_DECREF_IMMORTAL(result);
10479
10473
  }
10480
10474
  }
10481
10475
 
@@ -10487,13 +10481,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10487
10481
  case Py_EQ: {
10488
10482
  bool r = operand1 == operand2;
10489
10483
  PyObject *result = BOOL_FROM(r);
10490
- Py_INCREF(result);
10484
+ Py_INCREF_IMMORTAL(result);
10491
10485
  return result;
10492
10486
  }
10493
10487
  case Py_NE: {
10494
10488
  bool r = operand1 != operand2;
10495
10489
  PyObject *result = BOOL_FROM(r);
10496
- Py_INCREF(result);
10490
+ Py_INCREF_IMMORTAL(result);
10497
10491
  return result;
10498
10492
  }
10499
10493
  default:
@@ -10541,7 +10535,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10541
10535
  return result;
10542
10536
  }
10543
10537
 
10544
- Py_DECREF(result);
10538
+ Py_DECREF_IMMORTAL(result);
10545
10539
  }
10546
10540
 
10547
10541
  // No rich comparison worked, but maybe compare works.
@@ -10582,7 +10576,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10582
10576
 
10583
10577
  bool r = c != 0;
10584
10578
  PyObject *result = BOOL_FROM(r);
10585
- Py_INCREF(result);
10579
+ Py_INCREF_IMMORTAL(result);
10586
10580
  return result;
10587
10581
  }
10588
10582
  }
@@ -10591,7 +10585,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10591
10585
  richcmpfunc f;
10592
10586
 
10593
10587
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10594
- f = RICHCOMPARE(type2);
10588
+ f = TP_RICHCOMPARE(type2);
10595
10589
 
10596
10590
  if (f != NULL) {
10597
10591
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -10602,7 +10596,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10602
10596
  return result;
10603
10597
  }
10604
10598
 
10605
- Py_DECREF(result);
10599
+ Py_DECREF_IMMORTAL(result);
10606
10600
  }
10607
10601
  }
10608
10602
 
@@ -10616,10 +10610,10 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10616
10610
  return result;
10617
10611
  }
10618
10612
 
10619
- Py_DECREF(result);
10613
+ Py_DECREF_IMMORTAL(result);
10620
10614
  }
10621
10615
 
10622
- f = RICHCOMPARE(type2);
10616
+ f = TP_RICHCOMPARE(type2);
10623
10617
  if (f != NULL) {
10624
10618
  PyObject *result = (*f)(operand2, operand1, Py_LE);
10625
10619
 
@@ -10629,7 +10623,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10629
10623
  return result;
10630
10624
  }
10631
10625
 
10632
- Py_DECREF(result);
10626
+ Py_DECREF_IMMORTAL(result);
10633
10627
  }
10634
10628
 
10635
10629
  int c;
@@ -10717,14 +10711,14 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10717
10711
 
10718
10712
  bool r = c != 0;
10719
10713
  PyObject *result = BOOL_FROM(r);
10720
- Py_INCREF(result);
10714
+ Py_INCREF_IMMORTAL(result);
10721
10715
  return result;
10722
10716
  #else
10723
10717
  bool checked_reverse_op = false;
10724
10718
  richcmpfunc f;
10725
10719
 
10726
10720
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10727
- f = RICHCOMPARE(type2);
10721
+ f = TP_RICHCOMPARE(type2);
10728
10722
 
10729
10723
  if (f != NULL) {
10730
10724
  checked_reverse_op = true;
@@ -10737,7 +10731,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10737
10731
  return result;
10738
10732
  }
10739
10733
 
10740
- Py_DECREF(result);
10734
+ Py_DECREF_IMMORTAL(result);
10741
10735
  }
10742
10736
  }
10743
10737
 
@@ -10752,11 +10746,11 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10752
10746
  return result;
10753
10747
  }
10754
10748
 
10755
- Py_DECREF(result);
10749
+ Py_DECREF_IMMORTAL(result);
10756
10750
  }
10757
10751
 
10758
10752
  if (checked_reverse_op == false) {
10759
- f = RICHCOMPARE(type2);
10753
+ f = TP_RICHCOMPARE(type2);
10760
10754
 
10761
10755
  if (f != NULL) {
10762
10756
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -10767,7 +10761,7 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10767
10761
  return result;
10768
10762
  }
10769
10763
 
10770
- Py_DECREF(result);
10764
+ Py_DECREF_IMMORTAL(result);
10771
10765
  }
10772
10766
  }
10773
10767
 
@@ -10779,13 +10773,13 @@ PyObject *RICH_COMPARE_GE_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10779
10773
  case Py_EQ: {
10780
10774
  bool r = operand1 == operand2;
10781
10775
  PyObject *result = BOOL_FROM(r);
10782
- Py_INCREF(result);
10776
+ Py_INCREF_IMMORTAL(result);
10783
10777
  return result;
10784
10778
  }
10785
10779
  case Py_NE: {
10786
10780
  bool r = operand1 != operand2;
10787
10781
  PyObject *result = BOOL_FROM(r);
10788
- Py_INCREF(result);
10782
+ Py_INCREF_IMMORTAL(result);
10789
10783
  return result;
10790
10784
  }
10791
10785
  default:
@@ -10814,14 +10808,11 @@ static nuitka_bool COMPARE_GE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10814
10808
  PyListObject *a = (PyListObject *)operand1;
10815
10809
  PyListObject *b = (PyListObject *)operand2;
10816
10810
 
10817
- Py_ssize_t len_a = Py_SIZE(a);
10818
- Py_ssize_t len_b = Py_SIZE(b);
10819
-
10820
10811
  bool found = false;
10821
10812
  nuitka_bool res = NUITKA_BOOL_TRUE;
10822
10813
 
10823
10814
  Py_ssize_t i;
10824
- for (i = 0; i < len_a && i < len_b; i++) {
10815
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10825
10816
  PyObject *aa = a->ob_item[i];
10826
10817
  PyObject *bb = b->ob_item[i];
10827
10818
 
@@ -10829,7 +10820,11 @@ static nuitka_bool COMPARE_GE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10829
10820
  continue;
10830
10821
  }
10831
10822
 
10823
+ Py_INCREF(aa);
10824
+ Py_INCREF(bb);
10832
10825
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10826
+ Py_DECREF(aa);
10827
+ Py_DECREF(bb);
10833
10828
 
10834
10829
  if (res == NUITKA_BOOL_EXCEPTION) {
10835
10830
  return NUITKA_BOOL_EXCEPTION;
@@ -10842,7 +10837,7 @@ static nuitka_bool COMPARE_GE_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10842
10837
  }
10843
10838
 
10844
10839
  if (found == false) {
10845
- bool r = len_a >= len_b;
10840
+ bool r = Py_SIZE(a) >= Py_SIZE(b);
10846
10841
 
10847
10842
  // Convert to target type.
10848
10843
  nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
@@ -10894,7 +10889,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10894
10889
  }
10895
10890
  }
10896
10891
 
10897
- Py_DECREF(result);
10892
+ Py_DECREF_IMMORTAL(result);
10898
10893
  }
10899
10894
 
10900
10895
  // No rich comparison worked, but maybe compare works.
@@ -10963,11 +10958,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10963
10958
  }
10964
10959
  }
10965
10960
 
10966
- Py_DECREF(result);
10961
+ Py_DECREF_IMMORTAL(result);
10967
10962
  }
10968
10963
  }
10969
10964
 
10970
- f = RICHCOMPARE(type1);
10965
+ f = TP_RICHCOMPARE(type1);
10971
10966
  if (f != NULL) {
10972
10967
  PyObject *result = (*f)(operand1, operand2, Py_GE);
10973
10968
 
@@ -10985,7 +10980,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10985
10980
  }
10986
10981
  }
10987
10982
 
10988
- Py_DECREF(result);
10983
+ Py_DECREF_IMMORTAL(result);
10989
10984
  }
10990
10985
 
10991
10986
  f = PyList_Type.tp_richcompare;
@@ -11006,7 +11001,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11006
11001
  }
11007
11002
  }
11008
11003
 
11009
- Py_DECREF(result);
11004
+ Py_DECREF_IMMORTAL(result);
11010
11005
  }
11011
11006
 
11012
11007
  int c;
@@ -11122,11 +11117,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11122
11117
  }
11123
11118
  }
11124
11119
 
11125
- Py_DECREF(result);
11120
+ Py_DECREF_IMMORTAL(result);
11126
11121
  }
11127
11122
  }
11128
11123
 
11129
- f = RICHCOMPARE(type1);
11124
+ f = TP_RICHCOMPARE(type1);
11130
11125
 
11131
11126
  if (f != NULL) {
11132
11127
  PyObject *result = (*f)(operand1, operand2, Py_GE);
@@ -11145,7 +11140,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11145
11140
  }
11146
11141
  }
11147
11142
 
11148
- Py_DECREF(result);
11143
+ Py_DECREF_IMMORTAL(result);
11149
11144
  }
11150
11145
 
11151
11146
  if (checked_reverse_op == false) {
@@ -11168,7 +11163,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11168
11163
  }
11169
11164
  }
11170
11165
 
11171
- Py_DECREF(result);
11166
+ Py_DECREF_IMMORTAL(result);
11172
11167
  }
11173
11168
  }
11174
11169
 
@@ -11242,7 +11237,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11242
11237
  }
11243
11238
  }
11244
11239
 
11245
- Py_DECREF(result);
11240
+ Py_DECREF_IMMORTAL(result);
11246
11241
  }
11247
11242
 
11248
11243
  // No rich comparison worked, but maybe compare works.
@@ -11292,7 +11287,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11292
11287
  richcmpfunc f;
11293
11288
 
11294
11289
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11295
- f = RICHCOMPARE(type2);
11290
+ f = TP_RICHCOMPARE(type2);
11296
11291
 
11297
11292
  if (f != NULL) {
11298
11293
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -11311,7 +11306,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11311
11306
  }
11312
11307
  }
11313
11308
 
11314
- Py_DECREF(result);
11309
+ Py_DECREF_IMMORTAL(result);
11315
11310
  }
11316
11311
  }
11317
11312
 
@@ -11333,10 +11328,10 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11333
11328
  }
11334
11329
  }
11335
11330
 
11336
- Py_DECREF(result);
11331
+ Py_DECREF_IMMORTAL(result);
11337
11332
  }
11338
11333
 
11339
- f = RICHCOMPARE(type2);
11334
+ f = TP_RICHCOMPARE(type2);
11340
11335
  if (f != NULL) {
11341
11336
  PyObject *result = (*f)(operand2, operand1, Py_LE);
11342
11337
 
@@ -11354,7 +11349,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11354
11349
  }
11355
11350
  }
11356
11351
 
11357
- Py_DECREF(result);
11352
+ Py_DECREF_IMMORTAL(result);
11358
11353
  }
11359
11354
 
11360
11355
  int c;
@@ -11449,7 +11444,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11449
11444
  richcmpfunc f;
11450
11445
 
11451
11446
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11452
- f = RICHCOMPARE(type2);
11447
+ f = TP_RICHCOMPARE(type2);
11453
11448
 
11454
11449
  if (f != NULL) {
11455
11450
  checked_reverse_op = true;
@@ -11470,7 +11465,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11470
11465
  }
11471
11466
  }
11472
11467
 
11473
- Py_DECREF(result);
11468
+ Py_DECREF_IMMORTAL(result);
11474
11469
  }
11475
11470
  }
11476
11471
 
@@ -11493,11 +11488,11 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11493
11488
  }
11494
11489
  }
11495
11490
 
11496
- Py_DECREF(result);
11491
+ Py_DECREF_IMMORTAL(result);
11497
11492
  }
11498
11493
 
11499
11494
  if (checked_reverse_op == false) {
11500
- f = RICHCOMPARE(type2);
11495
+ f = TP_RICHCOMPARE(type2);
11501
11496
 
11502
11497
  if (f != NULL) {
11503
11498
  PyObject *result = (*f)(operand2, operand1, Py_LE);
@@ -11516,7 +11511,7 @@ nuitka_bool RICH_COMPARE_GE_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11516
11511
  }
11517
11512
  }
11518
11513
 
11519
- Py_DECREF(result);
11514
+ Py_DECREF_IMMORTAL(result);
11520
11515
  }
11521
11516
  }
11522
11517
 
@@ -11573,7 +11568,7 @@ static PyObject *COMPARE_GE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11573
11568
  }
11574
11569
 
11575
11570
  Py_ssize_t operand2_digit_count = 0;
11576
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11571
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11577
11572
  {
11578
11573
  unsigned long t = operand2_abs_ival;
11579
11574
 
@@ -11590,15 +11585,15 @@ static PyObject *COMPARE_GE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11590
11585
 
11591
11586
  bool r;
11592
11587
 
11593
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11594
- r = Py_SIZE(operand1_long_object) - operand2_size > 0;
11588
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11589
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size > 0;
11595
11590
  } else {
11596
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11591
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11597
11592
  r = true;
11598
11593
  while (--i >= 0) {
11599
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11600
- r = operand1_long_object->ob_digit[i] > operand2_digits[i];
11601
- if (Py_SIZE(operand1_long_object) < 0) {
11594
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11595
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > operand2_digits[i];
11596
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11602
11597
  r = !r;
11603
11598
  }
11604
11599
  break;
@@ -11608,7 +11603,7 @@ static PyObject *COMPARE_GE_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11608
11603
 
11609
11604
  // Convert to target type.
11610
11605
  PyObject *result = BOOL_FROM(r);
11611
- Py_INCREF(result);
11606
+ Py_INCREF_IMMORTAL(result);
11612
11607
  return result;
11613
11608
  }
11614
11609
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
@@ -11637,7 +11632,7 @@ static bool COMPARE_GE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11637
11632
  }
11638
11633
 
11639
11634
  Py_ssize_t operand2_digit_count = 0;
11640
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11635
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11641
11636
  {
11642
11637
  unsigned long t = operand2_abs_ival;
11643
11638
 
@@ -11654,15 +11649,15 @@ static bool COMPARE_GE_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11654
11649
 
11655
11650
  bool r;
11656
11651
 
11657
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11658
- r = Py_SIZE(operand1_long_object) - operand2_size > 0;
11652
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11653
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size > 0;
11659
11654
  } else {
11660
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11655
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11661
11656
  r = true;
11662
11657
  while (--i >= 0) {
11663
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11664
- r = operand1_long_object->ob_digit[i] > operand2_digits[i];
11665
- if (Py_SIZE(operand1_long_object) < 0) {
11658
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11659
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > operand2_digits[i];
11660
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11666
11661
  r = !r;
11667
11662
  }
11668
11663
  break;
@@ -11694,7 +11689,7 @@ static PyObject *COMPARE_GE_OBJECT_INT_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 "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
@@ -11735,15 +11730,18 @@ static PyObject *COMPARE_GE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11735
11730
 
11736
11731
  bool r;
11737
11732
 
11738
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11739
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) > 0;
11733
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11734
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11735
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11736
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) >
11737
+ 0;
11740
11738
  } else {
11741
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11739
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11742
11740
  r = true;
11743
11741
  while (--i >= 0) {
11744
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11745
- r = operand1_long_object->ob_digit[i] > (digit)Py_ABS(operand2);
11746
- if (Py_SIZE(operand1_long_object) < 0) {
11742
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11743
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > (digit)Py_ABS(operand2);
11744
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11747
11745
  r = !r;
11748
11746
  }
11749
11747
  break;
@@ -11753,7 +11751,7 @@ static PyObject *COMPARE_GE_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11753
11751
 
11754
11752
  // Convert to target type.
11755
11753
  PyObject *result = BOOL_FROM(r);
11756
- Py_INCREF(result);
11754
+ Py_INCREF_IMMORTAL(result);
11757
11755
  return result;
11758
11756
  }
11759
11757
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "DIGIT" to C platform digit value for long
@@ -11772,15 +11770,18 @@ static bool COMPARE_GE_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {
11772
11770
 
11773
11771
  bool r;
11774
11772
 
11775
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11776
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) > 0;
11773
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11774
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11775
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11776
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) >
11777
+ 0;
11777
11778
  } else {
11778
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11779
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11779
11780
  r = true;
11780
11781
  while (--i >= 0) {
11781
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11782
- r = operand1_long_object->ob_digit[i] > (digit)Py_ABS(operand2);
11783
- if (Py_SIZE(operand1_long_object) < 0) {
11782
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11783
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] > (digit)Py_ABS(operand2);
11784
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11784
11785
  r = !r;
11785
11786
  }
11786
11787
  break;
@@ -11811,7 +11812,7 @@ static PyObject *COMPARE_GE_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double opera
11811
11812
 
11812
11813
  // Convert to target type.
11813
11814
  PyObject *result = BOOL_FROM(r);
11814
- Py_INCREF(result);
11815
+ Py_INCREF_IMMORTAL(result);
11815
11816
  return result;
11816
11817
  }
11817
11818
  /* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
@@ -11839,3 +11840,18 @@ bool RICH_COMPARE_GE_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
11839
11840
 
11840
11841
  return COMPARE_GE_CBOOL_FLOAT_CFLOAT(operand1, operand2);
11841
11842
  }
11843
+
11844
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
11845
+ // integrates with CPython, but also works on its own.
11846
+ //
11847
+ // Licensed under the Apache License, Version 2.0 (the "License");
11848
+ // you may not use this file except in compliance with the License.
11849
+ // You may obtain a copy of the License at
11850
+ //
11851
+ // http://www.apache.org/licenses/LICENSE-2.0
11852
+ //
11853
+ // Unless required by applicable law or agreed to in writing, software
11854
+ // distributed under the License is distributed on an "AS IS" BASIS,
11855
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11856
+ // See the License for the specific language governing permissions and
11857
+ // limitations under the License.