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_LT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand
38
23
 
39
24
  // Convert to target type.
40
25
  PyObject *result = BOOL_FROM(r);
41
- Py_INCREF(result);
26
+ Py_INCREF_IMMORTAL(result);
42
27
  return result;
43
28
  }
44
29
  #endif
@@ -86,7 +71,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
86
71
  // If the types are equal, we may get away immediately except for instances.
87
72
  if (type1 == type2 && !PyInstance_Check(operand1)) {
88
73
 
89
- richcmpfunc frich = RICHCOMPARE(type1);
74
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
90
75
 
91
76
  if (frich != NULL) {
92
77
  PyObject *result = (*frich)(operand1, operand2, Py_LT);
@@ -97,7 +82,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
97
82
  return result;
98
83
  }
99
84
 
100
- Py_DECREF(result);
85
+ Py_DECREF_IMMORTAL(result);
101
86
  }
102
87
 
103
88
  // No rich comparison worked, but maybe compare works.
@@ -138,7 +123,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
138
123
 
139
124
  bool r = c != 0;
140
125
  PyObject *result = BOOL_FROM(r);
141
- Py_INCREF(result);
126
+ Py_INCREF_IMMORTAL(result);
142
127
  return result;
143
128
  }
144
129
  }
@@ -147,7 +132,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
147
132
  richcmpfunc f;
148
133
 
149
134
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
150
- f = RICHCOMPARE(type2);
135
+ f = TP_RICHCOMPARE(type2);
151
136
 
152
137
  if (f != NULL) {
153
138
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -158,11 +143,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
158
143
  return result;
159
144
  }
160
145
 
161
- Py_DECREF(result);
146
+ Py_DECREF_IMMORTAL(result);
162
147
  }
163
148
  }
164
149
 
165
- f = RICHCOMPARE(type1);
150
+ f = TP_RICHCOMPARE(type1);
166
151
  if (f != NULL) {
167
152
  PyObject *result = (*f)(operand1, operand2, Py_LT);
168
153
 
@@ -172,10 +157,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
172
157
  return result;
173
158
  }
174
159
 
175
- Py_DECREF(result);
160
+ Py_DECREF_IMMORTAL(result);
176
161
  }
177
162
 
178
- f = RICHCOMPARE(type2);
163
+ f = TP_RICHCOMPARE(type2);
179
164
  if (f != NULL) {
180
165
  PyObject *result = (*f)(operand2, operand1, Py_GT);
181
166
 
@@ -185,7 +170,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
185
170
  return result;
186
171
  }
187
172
 
188
- Py_DECREF(result);
173
+ Py_DECREF_IMMORTAL(result);
189
174
  }
190
175
 
191
176
  int c;
@@ -273,14 +258,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
273
258
 
274
259
  bool r = c != 0;
275
260
  PyObject *result = BOOL_FROM(r);
276
- Py_INCREF(result);
261
+ Py_INCREF_IMMORTAL(result);
277
262
  return result;
278
263
  #else
279
264
  bool checked_reverse_op = false;
280
265
  richcmpfunc f;
281
266
 
282
267
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
283
- f = RICHCOMPARE(type2);
268
+ f = TP_RICHCOMPARE(type2);
284
269
 
285
270
  if (f != NULL) {
286
271
  checked_reverse_op = true;
@@ -293,11 +278,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
293
278
  return result;
294
279
  }
295
280
 
296
- Py_DECREF(result);
281
+ Py_DECREF_IMMORTAL(result);
297
282
  }
298
283
  }
299
284
 
300
- f = RICHCOMPARE(type1);
285
+ f = TP_RICHCOMPARE(type1);
301
286
 
302
287
  if (f != NULL) {
303
288
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -308,11 +293,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
308
293
  return result;
309
294
  }
310
295
 
311
- Py_DECREF(result);
296
+ Py_DECREF_IMMORTAL(result);
312
297
  }
313
298
 
314
299
  if (checked_reverse_op == false) {
315
- f = RICHCOMPARE(type2);
300
+ f = TP_RICHCOMPARE(type2);
316
301
 
317
302
  if (f != NULL) {
318
303
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -323,7 +308,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
323
308
  return result;
324
309
  }
325
310
 
326
- Py_DECREF(result);
311
+ Py_DECREF_IMMORTAL(result);
327
312
  }
328
313
  }
329
314
 
@@ -335,13 +320,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *ope
335
320
  case Py_EQ: {
336
321
  bool r = operand1 == operand2;
337
322
  PyObject *result = BOOL_FROM(r);
338
- Py_INCREF(result);
323
+ Py_INCREF_IMMORTAL(result);
339
324
  return result;
340
325
  }
341
326
  case Py_NE: {
342
327
  bool r = operand1 != operand2;
343
328
  PyObject *result = BOOL_FROM(r);
344
- Py_INCREF(result);
329
+ Py_INCREF_IMMORTAL(result);
345
330
  return result;
346
331
  }
347
332
  default:
@@ -382,7 +367,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
382
367
  // If the types are equal, we may get away immediately except for instances.
383
368
  if (type1 == type2 && !PyInstance_Check(operand1)) {
384
369
 
385
- richcmpfunc frich = RICHCOMPARE(type1);
370
+ richcmpfunc frich = TP_RICHCOMPARE(type1);
386
371
 
387
372
  if (frich != NULL) {
388
373
  PyObject *result = (*frich)(operand1, operand2, Py_LT);
@@ -401,7 +386,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
401
386
  }
402
387
  }
403
388
 
404
- Py_DECREF(result);
389
+ Py_DECREF_IMMORTAL(result);
405
390
  }
406
391
 
407
392
  // No rich comparison worked, but maybe compare works.
@@ -451,7 +436,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
451
436
  richcmpfunc f;
452
437
 
453
438
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
454
- f = RICHCOMPARE(type2);
439
+ f = TP_RICHCOMPARE(type2);
455
440
 
456
441
  if (f != NULL) {
457
442
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -470,11 +455,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
470
455
  }
471
456
  }
472
457
 
473
- Py_DECREF(result);
458
+ Py_DECREF_IMMORTAL(result);
474
459
  }
475
460
  }
476
461
 
477
- f = RICHCOMPARE(type1);
462
+ f = TP_RICHCOMPARE(type1);
478
463
  if (f != NULL) {
479
464
  PyObject *result = (*f)(operand1, operand2, Py_LT);
480
465
 
@@ -492,10 +477,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
492
477
  }
493
478
  }
494
479
 
495
- Py_DECREF(result);
480
+ Py_DECREF_IMMORTAL(result);
496
481
  }
497
482
 
498
- f = RICHCOMPARE(type2);
483
+ f = TP_RICHCOMPARE(type2);
499
484
  if (f != NULL) {
500
485
  PyObject *result = (*f)(operand2, operand1, Py_GT);
501
486
 
@@ -513,7 +498,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
513
498
  }
514
499
  }
515
500
 
516
- Py_DECREF(result);
501
+ Py_DECREF_IMMORTAL(result);
517
502
  }
518
503
 
519
504
  int c;
@@ -608,7 +593,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
608
593
  richcmpfunc f;
609
594
 
610
595
  if (type1 != type2 && Nuitka_Type_IsSubtype(type2, type1)) {
611
- f = RICHCOMPARE(type2);
596
+ f = TP_RICHCOMPARE(type2);
612
597
 
613
598
  if (f != NULL) {
614
599
  checked_reverse_op = true;
@@ -629,11 +614,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
629
614
  }
630
615
  }
631
616
 
632
- Py_DECREF(result);
617
+ Py_DECREF_IMMORTAL(result);
633
618
  }
634
619
  }
635
620
 
636
- f = RICHCOMPARE(type1);
621
+ f = TP_RICHCOMPARE(type1);
637
622
 
638
623
  if (f != NULL) {
639
624
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -652,11 +637,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
652
637
  }
653
638
  }
654
639
 
655
- Py_DECREF(result);
640
+ Py_DECREF_IMMORTAL(result);
656
641
  }
657
642
 
658
643
  if (checked_reverse_op == false) {
659
- f = RICHCOMPARE(type2);
644
+ f = TP_RICHCOMPARE(type2);
660
645
 
661
646
  if (f != NULL) {
662
647
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -675,7 +660,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *op
675
660
  }
676
661
  }
677
662
 
678
- Py_DECREF(result);
663
+ Py_DECREF_IMMORTAL(result);
679
664
  }
680
665
  }
681
666
 
@@ -724,7 +709,7 @@ static PyObject *COMPARE_LT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
724
709
 
725
710
  // Convert to target type.
726
711
  PyObject *result = BOOL_FROM(r);
727
- Py_INCREF(result);
712
+ Py_INCREF_IMMORTAL(result);
728
713
  return result;
729
714
  }
730
715
 
@@ -752,7 +737,7 @@ static PyObject *COMPARE_LT_OBJECT_STR_STR(PyObject *operand1, PyObject *operand
752
737
 
753
738
  // Convert to target type.
754
739
  PyObject *result = BOOL_FROM(c != 0);
755
- Py_INCREF(result);
740
+ Py_INCREF_IMMORTAL(result);
756
741
  return result;
757
742
  }
758
743
  /* Code referring to "OBJECT" corresponds to any Python object and "STR" to Python2 'str'. */
@@ -789,7 +774,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
789
774
  return result;
790
775
  }
791
776
 
792
- Py_DECREF(result);
777
+ Py_DECREF_IMMORTAL(result);
793
778
  }
794
779
 
795
780
  // No rich comparison worked, but maybe compare works.
@@ -830,7 +815,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
830
815
 
831
816
  bool r = c != 0;
832
817
  PyObject *result = BOOL_FROM(r);
833
- Py_INCREF(result);
818
+ Py_INCREF_IMMORTAL(result);
834
819
  return result;
835
820
  }
836
821
  }
@@ -850,11 +835,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
850
835
  return result;
851
836
  }
852
837
 
853
- Py_DECREF(result);
838
+ Py_DECREF_IMMORTAL(result);
854
839
  }
855
840
  }
856
841
 
857
- f = RICHCOMPARE(type1);
842
+ f = TP_RICHCOMPARE(type1);
858
843
  if (f != NULL) {
859
844
  PyObject *result = (*f)(operand1, operand2, Py_LT);
860
845
 
@@ -864,7 +849,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
864
849
  return result;
865
850
  }
866
851
 
867
- Py_DECREF(result);
852
+ Py_DECREF_IMMORTAL(result);
868
853
  }
869
854
 
870
855
  f = PyString_Type.tp_richcompare;
@@ -877,7 +862,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
877
862
  return result;
878
863
  }
879
864
 
880
- Py_DECREF(result);
865
+ Py_DECREF_IMMORTAL(result);
881
866
  }
882
867
 
883
868
  int c;
@@ -965,7 +950,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
965
950
 
966
951
  bool r = c != 0;
967
952
  PyObject *result = BOOL_FROM(r);
968
- Py_INCREF(result);
953
+ Py_INCREF_IMMORTAL(result);
969
954
  return result;
970
955
  #else
971
956
  bool checked_reverse_op = false;
@@ -985,11 +970,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
985
970
  return result;
986
971
  }
987
972
 
988
- Py_DECREF(result);
973
+ Py_DECREF_IMMORTAL(result);
989
974
  }
990
975
  }
991
976
 
992
- f = RICHCOMPARE(type1);
977
+ f = TP_RICHCOMPARE(type1);
993
978
 
994
979
  if (f != NULL) {
995
980
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -1000,7 +985,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1000
985
  return result;
1001
986
  }
1002
987
 
1003
- Py_DECREF(result);
988
+ Py_DECREF_IMMORTAL(result);
1004
989
  }
1005
990
 
1006
991
  if (checked_reverse_op == false) {
@@ -1015,7 +1000,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1015
1000
  return result;
1016
1001
  }
1017
1002
 
1018
- Py_DECREF(result);
1003
+ Py_DECREF_IMMORTAL(result);
1019
1004
  }
1020
1005
  }
1021
1006
 
@@ -1027,13 +1012,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operan
1027
1012
  case Py_EQ: {
1028
1013
  bool r = operand1 == operand2;
1029
1014
  PyObject *result = BOOL_FROM(r);
1030
- Py_INCREF(result);
1015
+ Py_INCREF_IMMORTAL(result);
1031
1016
  return result;
1032
1017
  }
1033
1018
  case Py_NE: {
1034
1019
  bool r = operand1 != operand2;
1035
1020
  PyObject *result = BOOL_FROM(r);
1036
- Py_INCREF(result);
1021
+ Py_INCREF_IMMORTAL(result);
1037
1022
  return result;
1038
1023
  }
1039
1024
  default:
@@ -1083,7 +1068,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1083
1068
  return result;
1084
1069
  }
1085
1070
 
1086
- Py_DECREF(result);
1071
+ Py_DECREF_IMMORTAL(result);
1087
1072
  }
1088
1073
 
1089
1074
  // No rich comparison worked, but maybe compare works.
@@ -1124,7 +1109,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1124
1109
 
1125
1110
  bool r = c != 0;
1126
1111
  PyObject *result = BOOL_FROM(r);
1127
- Py_INCREF(result);
1112
+ Py_INCREF_IMMORTAL(result);
1128
1113
  return result;
1129
1114
  }
1130
1115
  }
@@ -1133,7 +1118,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1133
1118
  richcmpfunc f;
1134
1119
 
1135
1120
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1136
- f = RICHCOMPARE(type2);
1121
+ f = TP_RICHCOMPARE(type2);
1137
1122
 
1138
1123
  if (f != NULL) {
1139
1124
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -1144,7 +1129,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1144
1129
  return result;
1145
1130
  }
1146
1131
 
1147
- Py_DECREF(result);
1132
+ Py_DECREF_IMMORTAL(result);
1148
1133
  }
1149
1134
  }
1150
1135
 
@@ -1158,10 +1143,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1158
1143
  return result;
1159
1144
  }
1160
1145
 
1161
- Py_DECREF(result);
1146
+ Py_DECREF_IMMORTAL(result);
1162
1147
  }
1163
1148
 
1164
- f = RICHCOMPARE(type2);
1149
+ f = TP_RICHCOMPARE(type2);
1165
1150
  if (f != NULL) {
1166
1151
  PyObject *result = (*f)(operand2, operand1, Py_GT);
1167
1152
 
@@ -1171,7 +1156,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1171
1156
  return result;
1172
1157
  }
1173
1158
 
1174
- Py_DECREF(result);
1159
+ Py_DECREF_IMMORTAL(result);
1175
1160
  }
1176
1161
 
1177
1162
  int c;
@@ -1259,14 +1244,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1259
1244
 
1260
1245
  bool r = c != 0;
1261
1246
  PyObject *result = BOOL_FROM(r);
1262
- Py_INCREF(result);
1247
+ Py_INCREF_IMMORTAL(result);
1263
1248
  return result;
1264
1249
  #else
1265
1250
  bool checked_reverse_op = false;
1266
1251
  richcmpfunc f;
1267
1252
 
1268
1253
  if (&PyString_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
1269
- f = RICHCOMPARE(type2);
1254
+ f = TP_RICHCOMPARE(type2);
1270
1255
 
1271
1256
  if (f != NULL) {
1272
1257
  checked_reverse_op = true;
@@ -1279,7 +1264,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1279
1264
  return result;
1280
1265
  }
1281
1266
 
1282
- Py_DECREF(result);
1267
+ Py_DECREF_IMMORTAL(result);
1283
1268
  }
1284
1269
  }
1285
1270
 
@@ -1294,11 +1279,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1294
1279
  return result;
1295
1280
  }
1296
1281
 
1297
- Py_DECREF(result);
1282
+ Py_DECREF_IMMORTAL(result);
1298
1283
  }
1299
1284
 
1300
1285
  if (checked_reverse_op == false) {
1301
- f = RICHCOMPARE(type2);
1286
+ f = TP_RICHCOMPARE(type2);
1302
1287
 
1303
1288
  if (f != NULL) {
1304
1289
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -1309,7 +1294,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1309
1294
  return result;
1310
1295
  }
1311
1296
 
1312
- Py_DECREF(result);
1297
+ Py_DECREF_IMMORTAL(result);
1313
1298
  }
1314
1299
  }
1315
1300
 
@@ -1321,13 +1306,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operan
1321
1306
  case Py_EQ: {
1322
1307
  bool r = operand1 == operand2;
1323
1308
  PyObject *result = BOOL_FROM(r);
1324
- Py_INCREF(result);
1309
+ Py_INCREF_IMMORTAL(result);
1325
1310
  return result;
1326
1311
  }
1327
1312
  case Py_NE: {
1328
1313
  bool r = operand1 != operand2;
1329
1314
  PyObject *result = BOOL_FROM(r);
1330
- Py_INCREF(result);
1315
+ Py_INCREF_IMMORTAL(result);
1331
1316
  return result;
1332
1317
  }
1333
1318
  default:
@@ -1447,7 +1432,7 @@ nuitka_bool RICH_COMPARE_LT_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_LT_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_LT);
1526
1511
 
@@ -1538,7 +1523,7 @@ nuitka_bool RICH_COMPARE_LT_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_LT_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_LT_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_LT);
@@ -1698,7 +1683,7 @@ nuitka_bool RICH_COMPARE_LT_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_LT_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_LT_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_LT_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_GT);
@@ -1866,7 +1851,7 @@ nuitka_bool RICH_COMPARE_LT_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_LT_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_GT);
1897
1882
 
@@ -1909,7 +1894,7 @@ nuitka_bool RICH_COMPARE_LT_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_LT_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_LT_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_LT_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_GT);
@@ -2071,7 +2056,7 @@ nuitka_bool RICH_COMPARE_LT_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_LT_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_LT_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_LT_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_LT_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_LT);
2233
2218
 
@@ -2237,7 +2222,7 @@ PyObject *RICH_COMPARE_LT_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_LT_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_LT_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_LT_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_LT);
@@ -2373,7 +2358,7 @@ PyObject *RICH_COMPARE_LT_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_LT_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_LT_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_LT_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_LT_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_LT_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_GT);
@@ -2517,7 +2502,7 @@ PyObject *RICH_COMPARE_LT_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_LT_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_GT);
2540
2525
 
@@ -2544,7 +2529,7 @@ PyObject *RICH_COMPARE_LT_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_LT_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_LT_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_LT_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_GT);
@@ -2682,7 +2667,7 @@ PyObject *RICH_COMPARE_LT_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_LT_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:
@@ -2747,7 +2732,7 @@ static bool COMPARE_LT_CBOOL_UNICODE_UNICODE(PyObject *operand1, PyObject *opera
2747
2732
 
2748
2733
  // Convert to target type if necessary
2749
2734
  bool result = r == Py_True;
2750
- Py_DECREF(r);
2735
+ Py_DECREF_IMMORTAL(r);
2751
2736
 
2752
2737
  return result;
2753
2738
  }
@@ -2800,7 +2785,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2800
2785
  }
2801
2786
  }
2802
2787
 
2803
- Py_DECREF(result);
2788
+ Py_DECREF_IMMORTAL(result);
2804
2789
  }
2805
2790
 
2806
2791
  // No rich comparison worked, but maybe compare works.
@@ -2869,11 +2854,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2869
2854
  }
2870
2855
  }
2871
2856
 
2872
- Py_DECREF(result);
2857
+ Py_DECREF_IMMORTAL(result);
2873
2858
  }
2874
2859
  }
2875
2860
 
2876
- f = RICHCOMPARE(type1);
2861
+ f = TP_RICHCOMPARE(type1);
2877
2862
  if (f != NULL) {
2878
2863
  PyObject *result = (*f)(operand1, operand2, Py_LT);
2879
2864
 
@@ -2891,7 +2876,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2891
2876
  }
2892
2877
  }
2893
2878
 
2894
- Py_DECREF(result);
2879
+ Py_DECREF_IMMORTAL(result);
2895
2880
  }
2896
2881
 
2897
2882
  f = PyUnicode_Type.tp_richcompare;
@@ -2912,7 +2897,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
2912
2897
  }
2913
2898
  }
2914
2899
 
2915
- Py_DECREF(result);
2900
+ Py_DECREF_IMMORTAL(result);
2916
2901
  }
2917
2902
 
2918
2903
  int c;
@@ -3028,11 +3013,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3028
3013
  }
3029
3014
  }
3030
3015
 
3031
- Py_DECREF(result);
3016
+ Py_DECREF_IMMORTAL(result);
3032
3017
  }
3033
3018
  }
3034
3019
 
3035
- f = RICHCOMPARE(type1);
3020
+ f = TP_RICHCOMPARE(type1);
3036
3021
 
3037
3022
  if (f != NULL) {
3038
3023
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -3051,7 +3036,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3051
3036
  }
3052
3037
  }
3053
3038
 
3054
- Py_DECREF(result);
3039
+ Py_DECREF_IMMORTAL(result);
3055
3040
  }
3056
3041
 
3057
3042
  if (checked_reverse_op == false) {
@@ -3074,7 +3059,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_UNICODE(PyObject *operand1, PyObject *o
3074
3059
  }
3075
3060
  }
3076
3061
 
3077
- Py_DECREF(result);
3062
+ Py_DECREF_IMMORTAL(result);
3078
3063
  }
3079
3064
  }
3080
3065
 
@@ -3150,7 +3135,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3150
3135
  }
3151
3136
  }
3152
3137
 
3153
- Py_DECREF(result);
3138
+ Py_DECREF_IMMORTAL(result);
3154
3139
  }
3155
3140
 
3156
3141
  // No rich comparison worked, but maybe compare works.
@@ -3200,7 +3185,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3200
3185
  richcmpfunc f;
3201
3186
 
3202
3187
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3203
- f = RICHCOMPARE(type2);
3188
+ f = TP_RICHCOMPARE(type2);
3204
3189
 
3205
3190
  if (f != NULL) {
3206
3191
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -3219,7 +3204,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3219
3204
  }
3220
3205
  }
3221
3206
 
3222
- Py_DECREF(result);
3207
+ Py_DECREF_IMMORTAL(result);
3223
3208
  }
3224
3209
  }
3225
3210
 
@@ -3241,10 +3226,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3241
3226
  }
3242
3227
  }
3243
3228
 
3244
- Py_DECREF(result);
3229
+ Py_DECREF_IMMORTAL(result);
3245
3230
  }
3246
3231
 
3247
- f = RICHCOMPARE(type2);
3232
+ f = TP_RICHCOMPARE(type2);
3248
3233
  if (f != NULL) {
3249
3234
  PyObject *result = (*f)(operand2, operand1, Py_GT);
3250
3235
 
@@ -3262,7 +3247,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3262
3247
  }
3263
3248
  }
3264
3249
 
3265
- Py_DECREF(result);
3250
+ Py_DECREF_IMMORTAL(result);
3266
3251
  }
3267
3252
 
3268
3253
  int c;
@@ -3357,7 +3342,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3357
3342
  richcmpfunc f;
3358
3343
 
3359
3344
  if (&PyUnicode_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
3360
- f = RICHCOMPARE(type2);
3345
+ f = TP_RICHCOMPARE(type2);
3361
3346
 
3362
3347
  if (f != NULL) {
3363
3348
  checked_reverse_op = true;
@@ -3378,7 +3363,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3378
3363
  }
3379
3364
  }
3380
3365
 
3381
- Py_DECREF(result);
3366
+ Py_DECREF_IMMORTAL(result);
3382
3367
  }
3383
3368
  }
3384
3369
 
@@ -3401,11 +3386,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3401
3386
  }
3402
3387
  }
3403
3388
 
3404
- Py_DECREF(result);
3389
+ Py_DECREF_IMMORTAL(result);
3405
3390
  }
3406
3391
 
3407
3392
  if (checked_reverse_op == false) {
3408
- f = RICHCOMPARE(type2);
3393
+ f = TP_RICHCOMPARE(type2);
3409
3394
 
3410
3395
  if (f != NULL) {
3411
3396
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -3424,7 +3409,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_UNICODE_OBJECT(PyObject *operand1, PyObject *o
3424
3409
  }
3425
3410
  }
3426
3411
 
3427
- Py_DECREF(result);
3412
+ Py_DECREF_IMMORTAL(result);
3428
3413
  }
3429
3414
  }
3430
3415
 
@@ -3474,7 +3459,7 @@ static PyObject *COMPARE_LT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3474
3459
 
3475
3460
  // Convert to target type.
3476
3461
  PyObject *result = BOOL_FROM(r);
3477
- Py_INCREF(result);
3462
+ Py_INCREF_IMMORTAL(result);
3478
3463
  return result;
3479
3464
  }
3480
3465
 
@@ -3502,7 +3487,7 @@ static PyObject *COMPARE_LT_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *ope
3502
3487
 
3503
3488
  // Convert to target type.
3504
3489
  PyObject *result = BOOL_FROM(c != 0);
3505
- Py_INCREF(result);
3490
+ Py_INCREF_IMMORTAL(result);
3506
3491
  return result;
3507
3492
  }
3508
3493
  /* Code referring to "OBJECT" corresponds to any Python object and "BYTES" to Python3 'bytes'. */
@@ -3539,7 +3524,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3539
3524
  return result;
3540
3525
  }
3541
3526
 
3542
- Py_DECREF(result);
3527
+ Py_DECREF_IMMORTAL(result);
3543
3528
  }
3544
3529
 
3545
3530
  // No rich comparison worked, but maybe compare works.
@@ -3580,7 +3565,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3580
3565
 
3581
3566
  bool r = c != 0;
3582
3567
  PyObject *result = BOOL_FROM(r);
3583
- Py_INCREF(result);
3568
+ Py_INCREF_IMMORTAL(result);
3584
3569
  return result;
3585
3570
  }
3586
3571
  }
@@ -3600,11 +3585,11 @@ PyObject *RICH_COMPARE_LT_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
 
3607
- f = RICHCOMPARE(type1);
3592
+ f = TP_RICHCOMPARE(type1);
3608
3593
  if (f != NULL) {
3609
3594
  PyObject *result = (*f)(operand1, operand2, Py_LT);
3610
3595
 
@@ -3614,7 +3599,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3614
3599
  return result;
3615
3600
  }
3616
3601
 
3617
- Py_DECREF(result);
3602
+ Py_DECREF_IMMORTAL(result);
3618
3603
  }
3619
3604
 
3620
3605
  f = PyBytes_Type.tp_richcompare;
@@ -3627,7 +3612,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3627
3612
  return result;
3628
3613
  }
3629
3614
 
3630
- Py_DECREF(result);
3615
+ Py_DECREF_IMMORTAL(result);
3631
3616
  }
3632
3617
 
3633
3618
  int c;
@@ -3715,7 +3700,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3715
3700
 
3716
3701
  bool r = c != 0;
3717
3702
  PyObject *result = BOOL_FROM(r);
3718
- Py_INCREF(result);
3703
+ Py_INCREF_IMMORTAL(result);
3719
3704
  return result;
3720
3705
  #else
3721
3706
  bool checked_reverse_op = false;
@@ -3735,11 +3720,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3735
3720
  return result;
3736
3721
  }
3737
3722
 
3738
- Py_DECREF(result);
3723
+ Py_DECREF_IMMORTAL(result);
3739
3724
  }
3740
3725
  }
3741
3726
 
3742
- f = RICHCOMPARE(type1);
3727
+ f = TP_RICHCOMPARE(type1);
3743
3728
 
3744
3729
  if (f != NULL) {
3745
3730
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -3750,7 +3735,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3750
3735
  return result;
3751
3736
  }
3752
3737
 
3753
- Py_DECREF(result);
3738
+ Py_DECREF_IMMORTAL(result);
3754
3739
  }
3755
3740
 
3756
3741
  if (checked_reverse_op == false) {
@@ -3765,7 +3750,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3765
3750
  return result;
3766
3751
  }
3767
3752
 
3768
- Py_DECREF(result);
3753
+ Py_DECREF_IMMORTAL(result);
3769
3754
  }
3770
3755
  }
3771
3756
 
@@ -3777,13 +3762,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *oper
3777
3762
  case Py_EQ: {
3778
3763
  bool r = operand1 == operand2;
3779
3764
  PyObject *result = BOOL_FROM(r);
3780
- Py_INCREF(result);
3765
+ Py_INCREF_IMMORTAL(result);
3781
3766
  return result;
3782
3767
  }
3783
3768
  case Py_NE: {
3784
3769
  bool r = operand1 != operand2;
3785
3770
  PyObject *result = BOOL_FROM(r);
3786
- Py_INCREF(result);
3771
+ Py_INCREF_IMMORTAL(result);
3787
3772
  return result;
3788
3773
  }
3789
3774
  default:
@@ -3833,7 +3818,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3833
3818
  return result;
3834
3819
  }
3835
3820
 
3836
- Py_DECREF(result);
3821
+ Py_DECREF_IMMORTAL(result);
3837
3822
  }
3838
3823
 
3839
3824
  // No rich comparison worked, but maybe compare works.
@@ -3874,7 +3859,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3874
3859
 
3875
3860
  bool r = c != 0;
3876
3861
  PyObject *result = BOOL_FROM(r);
3877
- Py_INCREF(result);
3862
+ Py_INCREF_IMMORTAL(result);
3878
3863
  return result;
3879
3864
  }
3880
3865
  }
@@ -3883,7 +3868,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3883
3868
  richcmpfunc f;
3884
3869
 
3885
3870
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
3886
- f = RICHCOMPARE(type2);
3871
+ f = TP_RICHCOMPARE(type2);
3887
3872
 
3888
3873
  if (f != NULL) {
3889
3874
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -3894,7 +3879,7 @@ PyObject *RICH_COMPARE_LT_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
3885
 
@@ -3908,10 +3893,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3908
3893
  return result;
3909
3894
  }
3910
3895
 
3911
- Py_DECREF(result);
3896
+ Py_DECREF_IMMORTAL(result);
3912
3897
  }
3913
3898
 
3914
- f = RICHCOMPARE(type2);
3899
+ f = TP_RICHCOMPARE(type2);
3915
3900
  if (f != NULL) {
3916
3901
  PyObject *result = (*f)(operand2, operand1, Py_GT);
3917
3902
 
@@ -3921,7 +3906,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
3921
3906
  return result;
3922
3907
  }
3923
3908
 
3924
- Py_DECREF(result);
3909
+ Py_DECREF_IMMORTAL(result);
3925
3910
  }
3926
3911
 
3927
3912
  int c;
@@ -4009,14 +3994,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4009
3994
 
4010
3995
  bool r = c != 0;
4011
3996
  PyObject *result = BOOL_FROM(r);
4012
- Py_INCREF(result);
3997
+ Py_INCREF_IMMORTAL(result);
4013
3998
  return result;
4014
3999
  #else
4015
4000
  bool checked_reverse_op = false;
4016
4001
  richcmpfunc f;
4017
4002
 
4018
4003
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4019
- f = RICHCOMPARE(type2);
4004
+ f = TP_RICHCOMPARE(type2);
4020
4005
 
4021
4006
  if (f != NULL) {
4022
4007
  checked_reverse_op = true;
@@ -4029,7 +4014,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4029
4014
  return result;
4030
4015
  }
4031
4016
 
4032
- Py_DECREF(result);
4017
+ Py_DECREF_IMMORTAL(result);
4033
4018
  }
4034
4019
  }
4035
4020
 
@@ -4044,11 +4029,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4044
4029
  return result;
4045
4030
  }
4046
4031
 
4047
- Py_DECREF(result);
4032
+ Py_DECREF_IMMORTAL(result);
4048
4033
  }
4049
4034
 
4050
4035
  if (checked_reverse_op == false) {
4051
- f = RICHCOMPARE(type2);
4036
+ f = TP_RICHCOMPARE(type2);
4052
4037
 
4053
4038
  if (f != NULL) {
4054
4039
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -4059,7 +4044,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4059
4044
  return result;
4060
4045
  }
4061
4046
 
4062
- Py_DECREF(result);
4047
+ Py_DECREF_IMMORTAL(result);
4063
4048
  }
4064
4049
  }
4065
4050
 
@@ -4071,13 +4056,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *oper
4071
4056
  case Py_EQ: {
4072
4057
  bool r = operand1 == operand2;
4073
4058
  PyObject *result = BOOL_FROM(r);
4074
- Py_INCREF(result);
4059
+ Py_INCREF_IMMORTAL(result);
4075
4060
  return result;
4076
4061
  }
4077
4062
  case Py_NE: {
4078
4063
  bool r = operand1 != operand2;
4079
4064
  PyObject *result = BOOL_FROM(r);
4080
- Py_INCREF(result);
4065
+ Py_INCREF_IMMORTAL(result);
4081
4066
  return result;
4082
4067
  }
4083
4068
  default:
@@ -4197,7 +4182,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4197
4182
  }
4198
4183
  }
4199
4184
 
4200
- Py_DECREF(result);
4185
+ Py_DECREF_IMMORTAL(result);
4201
4186
  }
4202
4187
 
4203
4188
  // No rich comparison worked, but maybe compare works.
@@ -4266,11 +4251,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4266
4251
  }
4267
4252
  }
4268
4253
 
4269
- Py_DECREF(result);
4254
+ Py_DECREF_IMMORTAL(result);
4270
4255
  }
4271
4256
  }
4272
4257
 
4273
- f = RICHCOMPARE(type1);
4258
+ f = TP_RICHCOMPARE(type1);
4274
4259
  if (f != NULL) {
4275
4260
  PyObject *result = (*f)(operand1, operand2, Py_LT);
4276
4261
 
@@ -4288,7 +4273,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4288
4273
  }
4289
4274
  }
4290
4275
 
4291
- Py_DECREF(result);
4276
+ Py_DECREF_IMMORTAL(result);
4292
4277
  }
4293
4278
 
4294
4279
  f = PyBytes_Type.tp_richcompare;
@@ -4309,7 +4294,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4309
4294
  }
4310
4295
  }
4311
4296
 
4312
- Py_DECREF(result);
4297
+ Py_DECREF_IMMORTAL(result);
4313
4298
  }
4314
4299
 
4315
4300
  int c;
@@ -4425,11 +4410,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4425
4410
  }
4426
4411
  }
4427
4412
 
4428
- Py_DECREF(result);
4413
+ Py_DECREF_IMMORTAL(result);
4429
4414
  }
4430
4415
  }
4431
4416
 
4432
- f = RICHCOMPARE(type1);
4417
+ f = TP_RICHCOMPARE(type1);
4433
4418
 
4434
4419
  if (f != NULL) {
4435
4420
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -4448,7 +4433,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4448
4433
  }
4449
4434
  }
4450
4435
 
4451
- Py_DECREF(result);
4436
+ Py_DECREF_IMMORTAL(result);
4452
4437
  }
4453
4438
 
4454
4439
  if (checked_reverse_op == false) {
@@ -4471,7 +4456,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_BYTES(PyObject *operand1, PyObject *ope
4471
4456
  }
4472
4457
  }
4473
4458
 
4474
- Py_DECREF(result);
4459
+ Py_DECREF_IMMORTAL(result);
4475
4460
  }
4476
4461
  }
4477
4462
 
@@ -4547,7 +4532,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4547
4532
  }
4548
4533
  }
4549
4534
 
4550
- Py_DECREF(result);
4535
+ Py_DECREF_IMMORTAL(result);
4551
4536
  }
4552
4537
 
4553
4538
  // No rich comparison worked, but maybe compare works.
@@ -4597,7 +4582,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4597
4582
  richcmpfunc f;
4598
4583
 
4599
4584
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4600
- f = RICHCOMPARE(type2);
4585
+ f = TP_RICHCOMPARE(type2);
4601
4586
 
4602
4587
  if (f != NULL) {
4603
4588
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -4616,7 +4601,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4616
4601
  }
4617
4602
  }
4618
4603
 
4619
- Py_DECREF(result);
4604
+ Py_DECREF_IMMORTAL(result);
4620
4605
  }
4621
4606
  }
4622
4607
 
@@ -4638,10 +4623,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4638
4623
  }
4639
4624
  }
4640
4625
 
4641
- Py_DECREF(result);
4626
+ Py_DECREF_IMMORTAL(result);
4642
4627
  }
4643
4628
 
4644
- f = RICHCOMPARE(type2);
4629
+ f = TP_RICHCOMPARE(type2);
4645
4630
  if (f != NULL) {
4646
4631
  PyObject *result = (*f)(operand2, operand1, Py_GT);
4647
4632
 
@@ -4659,7 +4644,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4659
4644
  }
4660
4645
  }
4661
4646
 
4662
- Py_DECREF(result);
4647
+ Py_DECREF_IMMORTAL(result);
4663
4648
  }
4664
4649
 
4665
4650
  int c;
@@ -4754,7 +4739,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4754
4739
  richcmpfunc f;
4755
4740
 
4756
4741
  if (&PyBytes_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
4757
- f = RICHCOMPARE(type2);
4742
+ f = TP_RICHCOMPARE(type2);
4758
4743
 
4759
4744
  if (f != NULL) {
4760
4745
  checked_reverse_op = true;
@@ -4775,7 +4760,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4775
4760
  }
4776
4761
  }
4777
4762
 
4778
- Py_DECREF(result);
4763
+ Py_DECREF_IMMORTAL(result);
4779
4764
  }
4780
4765
  }
4781
4766
 
@@ -4798,11 +4783,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4798
4783
  }
4799
4784
  }
4800
4785
 
4801
- Py_DECREF(result);
4786
+ Py_DECREF_IMMORTAL(result);
4802
4787
  }
4803
4788
 
4804
4789
  if (checked_reverse_op == false) {
4805
- f = RICHCOMPARE(type2);
4790
+ f = TP_RICHCOMPARE(type2);
4806
4791
 
4807
4792
  if (f != NULL) {
4808
4793
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -4821,7 +4806,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_BYTES_OBJECT(PyObject *operand1, PyObject *ope
4821
4806
  }
4822
4807
  }
4823
4808
 
4824
- Py_DECREF(result);
4809
+ Py_DECREF_IMMORTAL(result);
4825
4810
  }
4826
4811
  }
4827
4812
 
@@ -4889,7 +4874,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4889
4874
  return result;
4890
4875
  }
4891
4876
 
4892
- Py_DECREF(result);
4877
+ Py_DECREF_IMMORTAL(result);
4893
4878
  }
4894
4879
 
4895
4880
  // No rich comparison worked, but maybe compare works.
@@ -4930,7 +4915,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4930
4915
 
4931
4916
  bool r = c != 0;
4932
4917
  PyObject *result = BOOL_FROM(r);
4933
- Py_INCREF(result);
4918
+ Py_INCREF_IMMORTAL(result);
4934
4919
  return result;
4935
4920
  }
4936
4921
  }
@@ -4950,11 +4935,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4950
4935
  return result;
4951
4936
  }
4952
4937
 
4953
- Py_DECREF(result);
4938
+ Py_DECREF_IMMORTAL(result);
4954
4939
  }
4955
4940
  }
4956
4941
 
4957
- f = RICHCOMPARE(type1);
4942
+ f = TP_RICHCOMPARE(type1);
4958
4943
  if (f != NULL) {
4959
4944
  PyObject *result = (*f)(operand1, operand2, Py_LT);
4960
4945
 
@@ -4964,7 +4949,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4964
4949
  return result;
4965
4950
  }
4966
4951
 
4967
- Py_DECREF(result);
4952
+ Py_DECREF_IMMORTAL(result);
4968
4953
  }
4969
4954
 
4970
4955
  f = NULL;
@@ -4977,7 +4962,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
4977
4962
  return result;
4978
4963
  }
4979
4964
 
4980
- Py_DECREF(result);
4965
+ Py_DECREF_IMMORTAL(result);
4981
4966
  }
4982
4967
 
4983
4968
  int c;
@@ -5065,7 +5050,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5065
5050
 
5066
5051
  bool r = c != 0;
5067
5052
  PyObject *result = BOOL_FROM(r);
5068
- Py_INCREF(result);
5053
+ Py_INCREF_IMMORTAL(result);
5069
5054
  return result;
5070
5055
  #else
5071
5056
  bool checked_reverse_op = false;
@@ -5085,11 +5070,11 @@ PyObject *RICH_COMPARE_LT_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
 
5092
- f = RICHCOMPARE(type1);
5077
+ f = TP_RICHCOMPARE(type1);
5093
5078
 
5094
5079
  if (f != NULL) {
5095
5080
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -5100,7 +5085,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5100
5085
  return result;
5101
5086
  }
5102
5087
 
5103
- Py_DECREF(result);
5088
+ Py_DECREF_IMMORTAL(result);
5104
5089
  }
5105
5090
 
5106
5091
  if (checked_reverse_op == false) {
@@ -5115,7 +5100,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5115
5100
  return result;
5116
5101
  }
5117
5102
 
5118
- Py_DECREF(result);
5103
+ Py_DECREF_IMMORTAL(result);
5119
5104
  }
5120
5105
  }
5121
5106
 
@@ -5127,13 +5112,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operan
5127
5112
  case Py_EQ: {
5128
5113
  bool r = operand1 == operand2;
5129
5114
  PyObject *result = BOOL_FROM(r);
5130
- Py_INCREF(result);
5115
+ Py_INCREF_IMMORTAL(result);
5131
5116
  return result;
5132
5117
  }
5133
5118
  case Py_NE: {
5134
5119
  bool r = operand1 != operand2;
5135
5120
  PyObject *result = BOOL_FROM(r);
5136
- Py_INCREF(result);
5121
+ Py_INCREF_IMMORTAL(result);
5137
5122
  return result;
5138
5123
  }
5139
5124
  default:
@@ -5183,7 +5168,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5183
5168
  return result;
5184
5169
  }
5185
5170
 
5186
- Py_DECREF(result);
5171
+ Py_DECREF_IMMORTAL(result);
5187
5172
  }
5188
5173
 
5189
5174
  // No rich comparison worked, but maybe compare works.
@@ -5224,7 +5209,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5224
5209
 
5225
5210
  bool r = c != 0;
5226
5211
  PyObject *result = BOOL_FROM(r);
5227
- Py_INCREF(result);
5212
+ Py_INCREF_IMMORTAL(result);
5228
5213
  return result;
5229
5214
  }
5230
5215
  }
@@ -5233,7 +5218,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5233
5218
  richcmpfunc f;
5234
5219
 
5235
5220
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5236
- f = RICHCOMPARE(type2);
5221
+ f = TP_RICHCOMPARE(type2);
5237
5222
 
5238
5223
  if (f != NULL) {
5239
5224
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -5244,7 +5229,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5244
5229
  return result;
5245
5230
  }
5246
5231
 
5247
- Py_DECREF(result);
5232
+ Py_DECREF_IMMORTAL(result);
5248
5233
  }
5249
5234
  }
5250
5235
 
@@ -5258,10 +5243,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5258
5243
  return result;
5259
5244
  }
5260
5245
 
5261
- Py_DECREF(result);
5246
+ Py_DECREF_IMMORTAL(result);
5262
5247
  }
5263
5248
 
5264
- f = RICHCOMPARE(type2);
5249
+ f = TP_RICHCOMPARE(type2);
5265
5250
  if (f != NULL) {
5266
5251
  PyObject *result = (*f)(operand2, operand1, Py_GT);
5267
5252
 
@@ -5271,7 +5256,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5271
5256
  return result;
5272
5257
  }
5273
5258
 
5274
- Py_DECREF(result);
5259
+ Py_DECREF_IMMORTAL(result);
5275
5260
  }
5276
5261
 
5277
5262
  int c;
@@ -5359,14 +5344,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5359
5344
 
5360
5345
  bool r = c != 0;
5361
5346
  PyObject *result = BOOL_FROM(r);
5362
- Py_INCREF(result);
5347
+ Py_INCREF_IMMORTAL(result);
5363
5348
  return result;
5364
5349
  #else
5365
5350
  bool checked_reverse_op = false;
5366
5351
  richcmpfunc f;
5367
5352
 
5368
5353
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5369
- f = RICHCOMPARE(type2);
5354
+ f = TP_RICHCOMPARE(type2);
5370
5355
 
5371
5356
  if (f != NULL) {
5372
5357
  checked_reverse_op = true;
@@ -5379,7 +5364,7 @@ PyObject *RICH_COMPARE_LT_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
 
@@ -5394,11 +5379,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5394
5379
  return result;
5395
5380
  }
5396
5381
 
5397
- Py_DECREF(result);
5382
+ Py_DECREF_IMMORTAL(result);
5398
5383
  }
5399
5384
 
5400
5385
  if (checked_reverse_op == false) {
5401
- f = RICHCOMPARE(type2);
5386
+ f = TP_RICHCOMPARE(type2);
5402
5387
 
5403
5388
  if (f != NULL) {
5404
5389
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -5409,7 +5394,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5409
5394
  return result;
5410
5395
  }
5411
5396
 
5412
- Py_DECREF(result);
5397
+ Py_DECREF_IMMORTAL(result);
5413
5398
  }
5414
5399
  }
5415
5400
 
@@ -5421,13 +5406,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operan
5421
5406
  case Py_EQ: {
5422
5407
  bool r = operand1 == operand2;
5423
5408
  PyObject *result = BOOL_FROM(r);
5424
- Py_INCREF(result);
5409
+ Py_INCREF_IMMORTAL(result);
5425
5410
  return result;
5426
5411
  }
5427
5412
  case Py_NE: {
5428
5413
  bool r = operand1 != operand2;
5429
5414
  PyObject *result = BOOL_FROM(r);
5430
- Py_INCREF(result);
5415
+ Py_INCREF_IMMORTAL(result);
5431
5416
  return result;
5432
5417
  }
5433
5418
  default:
@@ -5501,7 +5486,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5501
5486
  }
5502
5487
  }
5503
5488
 
5504
- Py_DECREF(result);
5489
+ Py_DECREF_IMMORTAL(result);
5505
5490
  }
5506
5491
 
5507
5492
  // No rich comparison worked, but maybe compare works.
@@ -5570,11 +5555,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5570
5555
  }
5571
5556
  }
5572
5557
 
5573
- Py_DECREF(result);
5558
+ Py_DECREF_IMMORTAL(result);
5574
5559
  }
5575
5560
  }
5576
5561
 
5577
- f = RICHCOMPARE(type1);
5562
+ f = TP_RICHCOMPARE(type1);
5578
5563
  if (f != NULL) {
5579
5564
  PyObject *result = (*f)(operand1, operand2, Py_LT);
5580
5565
 
@@ -5592,7 +5577,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5592
5577
  }
5593
5578
  }
5594
5579
 
5595
- Py_DECREF(result);
5580
+ Py_DECREF_IMMORTAL(result);
5596
5581
  }
5597
5582
 
5598
5583
  f = NULL;
@@ -5613,7 +5598,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5613
5598
  }
5614
5599
  }
5615
5600
 
5616
- Py_DECREF(result);
5601
+ Py_DECREF_IMMORTAL(result);
5617
5602
  }
5618
5603
 
5619
5604
  int c;
@@ -5729,11 +5714,11 @@ nuitka_bool RICH_COMPARE_LT_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
 
5736
- f = RICHCOMPARE(type1);
5721
+ f = TP_RICHCOMPARE(type1);
5737
5722
 
5738
5723
  if (f != NULL) {
5739
5724
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -5752,7 +5737,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5752
5737
  }
5753
5738
  }
5754
5739
 
5755
- Py_DECREF(result);
5740
+ Py_DECREF_IMMORTAL(result);
5756
5741
  }
5757
5742
 
5758
5743
  if (checked_reverse_op == false) {
@@ -5775,7 +5760,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *opera
5775
5760
  }
5776
5761
  }
5777
5762
 
5778
- Py_DECREF(result);
5763
+ Py_DECREF_IMMORTAL(result);
5779
5764
  }
5780
5765
  }
5781
5766
 
@@ -5851,7 +5836,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5851
5836
  }
5852
5837
  }
5853
5838
 
5854
- Py_DECREF(result);
5839
+ Py_DECREF_IMMORTAL(result);
5855
5840
  }
5856
5841
 
5857
5842
  // No rich comparison worked, but maybe compare works.
@@ -5901,7 +5886,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5901
5886
  richcmpfunc f;
5902
5887
 
5903
5888
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
5904
- f = RICHCOMPARE(type2);
5889
+ f = TP_RICHCOMPARE(type2);
5905
5890
 
5906
5891
  if (f != NULL) {
5907
5892
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -5920,7 +5905,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5920
5905
  }
5921
5906
  }
5922
5907
 
5923
- Py_DECREF(result);
5908
+ Py_DECREF_IMMORTAL(result);
5924
5909
  }
5925
5910
  }
5926
5911
 
@@ -5942,10 +5927,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5942
5927
  }
5943
5928
  }
5944
5929
 
5945
- Py_DECREF(result);
5930
+ Py_DECREF_IMMORTAL(result);
5946
5931
  }
5947
5932
 
5948
- f = RICHCOMPARE(type2);
5933
+ f = TP_RICHCOMPARE(type2);
5949
5934
  if (f != NULL) {
5950
5935
  PyObject *result = (*f)(operand2, operand1, Py_GT);
5951
5936
 
@@ -5963,7 +5948,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
5963
5948
  }
5964
5949
  }
5965
5950
 
5966
- Py_DECREF(result);
5951
+ Py_DECREF_IMMORTAL(result);
5967
5952
  }
5968
5953
 
5969
5954
  int c;
@@ -6058,7 +6043,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6058
6043
  richcmpfunc f;
6059
6044
 
6060
6045
  if (&PyInt_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
6061
- f = RICHCOMPARE(type2);
6046
+ f = TP_RICHCOMPARE(type2);
6062
6047
 
6063
6048
  if (f != NULL) {
6064
6049
  checked_reverse_op = true;
@@ -6079,7 +6064,7 @@ nuitka_bool RICH_COMPARE_LT_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
 
@@ -6102,11 +6087,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6102
6087
  }
6103
6088
  }
6104
6089
 
6105
- Py_DECREF(result);
6090
+ Py_DECREF_IMMORTAL(result);
6106
6091
  }
6107
6092
 
6108
6093
  if (checked_reverse_op == false) {
6109
- f = RICHCOMPARE(type2);
6094
+ f = TP_RICHCOMPARE(type2);
6110
6095
 
6111
6096
  if (f != NULL) {
6112
6097
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -6125,7 +6110,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *opera
6125
6110
  }
6126
6111
  }
6127
6112
 
6128
- Py_DECREF(result);
6113
+ Py_DECREF_IMMORTAL(result);
6129
6114
  }
6130
6115
  }
6131
6116
 
@@ -6172,15 +6157,19 @@ static PyObject *COMPARE_LT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6172
6157
 
6173
6158
  if (operand1_long_object == operand2_long_object) {
6174
6159
  r = false;
6175
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6176
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;
6160
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6161
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6162
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) <
6163
+ 0;
6177
6164
  } else {
6178
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6165
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6179
6166
  r = false;
6180
6167
  while (--i >= 0) {
6181
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6182
- r = operand1_long_object->ob_digit[i] < operand2_long_object->ob_digit[i];
6183
- if (Py_SIZE(operand1_long_object) < 0) {
6168
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6169
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6170
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <
6171
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6172
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6184
6173
  r = !r;
6185
6174
  }
6186
6175
  break;
@@ -6190,7 +6179,7 @@ static PyObject *COMPARE_LT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *opera
6190
6179
 
6191
6180
  // Convert to target type.
6192
6181
  PyObject *result = BOOL_FROM(r);
6193
- Py_INCREF(result);
6182
+ Py_INCREF_IMMORTAL(result);
6194
6183
  return result;
6195
6184
  }
6196
6185
  /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
@@ -6227,7 +6216,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6227
6216
  return result;
6228
6217
  }
6229
6218
 
6230
- Py_DECREF(result);
6219
+ Py_DECREF_IMMORTAL(result);
6231
6220
  }
6232
6221
 
6233
6222
  // No rich comparison worked, but maybe compare works.
@@ -6268,7 +6257,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6268
6257
 
6269
6258
  bool r = c != 0;
6270
6259
  PyObject *result = BOOL_FROM(r);
6271
- Py_INCREF(result);
6260
+ Py_INCREF_IMMORTAL(result);
6272
6261
  return result;
6273
6262
  }
6274
6263
  }
@@ -6288,11 +6277,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6288
6277
  return result;
6289
6278
  }
6290
6279
 
6291
- Py_DECREF(result);
6280
+ Py_DECREF_IMMORTAL(result);
6292
6281
  }
6293
6282
  }
6294
6283
 
6295
- f = RICHCOMPARE(type1);
6284
+ f = TP_RICHCOMPARE(type1);
6296
6285
  if (f != NULL) {
6297
6286
  PyObject *result = (*f)(operand1, operand2, Py_LT);
6298
6287
 
@@ -6302,7 +6291,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6302
6291
  return result;
6303
6292
  }
6304
6293
 
6305
- Py_DECREF(result);
6294
+ Py_DECREF_IMMORTAL(result);
6306
6295
  }
6307
6296
 
6308
6297
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6315,7 +6304,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6315
6304
  return result;
6316
6305
  }
6317
6306
 
6318
- Py_DECREF(result);
6307
+ Py_DECREF_IMMORTAL(result);
6319
6308
  }
6320
6309
 
6321
6310
  int c;
@@ -6403,7 +6392,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6403
6392
 
6404
6393
  bool r = c != 0;
6405
6394
  PyObject *result = BOOL_FROM(r);
6406
- Py_INCREF(result);
6395
+ Py_INCREF_IMMORTAL(result);
6407
6396
  return result;
6408
6397
  #else
6409
6398
  bool checked_reverse_op = false;
@@ -6423,11 +6412,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6423
6412
  return result;
6424
6413
  }
6425
6414
 
6426
- Py_DECREF(result);
6415
+ Py_DECREF_IMMORTAL(result);
6427
6416
  }
6428
6417
  }
6429
6418
 
6430
- f = RICHCOMPARE(type1);
6419
+ f = TP_RICHCOMPARE(type1);
6431
6420
 
6432
6421
  if (f != NULL) {
6433
6422
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -6438,7 +6427,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6438
6427
  return result;
6439
6428
  }
6440
6429
 
6441
- Py_DECREF(result);
6430
+ Py_DECREF_IMMORTAL(result);
6442
6431
  }
6443
6432
 
6444
6433
  if (checked_reverse_op == false) {
@@ -6453,7 +6442,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6453
6442
  return result;
6454
6443
  }
6455
6444
 
6456
- Py_DECREF(result);
6445
+ Py_DECREF_IMMORTAL(result);
6457
6446
  }
6458
6447
  }
6459
6448
 
@@ -6465,13 +6454,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *opera
6465
6454
  case Py_EQ: {
6466
6455
  bool r = operand1 == operand2;
6467
6456
  PyObject *result = BOOL_FROM(r);
6468
- Py_INCREF(result);
6457
+ Py_INCREF_IMMORTAL(result);
6469
6458
  return result;
6470
6459
  }
6471
6460
  case Py_NE: {
6472
6461
  bool r = operand1 != operand2;
6473
6462
  PyObject *result = BOOL_FROM(r);
6474
- Py_INCREF(result);
6463
+ Py_INCREF_IMMORTAL(result);
6475
6464
  return result;
6476
6465
  }
6477
6466
  default:
@@ -6521,7 +6510,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6521
6510
  return result;
6522
6511
  }
6523
6512
 
6524
- Py_DECREF(result);
6513
+ Py_DECREF_IMMORTAL(result);
6525
6514
  }
6526
6515
 
6527
6516
  // No rich comparison worked, but maybe compare works.
@@ -6562,7 +6551,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6562
6551
 
6563
6552
  bool r = c != 0;
6564
6553
  PyObject *result = BOOL_FROM(r);
6565
- Py_INCREF(result);
6554
+ Py_INCREF_IMMORTAL(result);
6566
6555
  return result;
6567
6556
  }
6568
6557
  }
@@ -6571,7 +6560,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6571
6560
  richcmpfunc f;
6572
6561
 
6573
6562
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6574
- f = RICHCOMPARE(type2);
6563
+ f = TP_RICHCOMPARE(type2);
6575
6564
 
6576
6565
  if (f != NULL) {
6577
6566
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -6582,7 +6571,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6582
6571
  return result;
6583
6572
  }
6584
6573
 
6585
- Py_DECREF(result);
6574
+ Py_DECREF_IMMORTAL(result);
6586
6575
  }
6587
6576
  }
6588
6577
 
@@ -6596,10 +6585,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6596
6585
  return result;
6597
6586
  }
6598
6587
 
6599
- Py_DECREF(result);
6588
+ Py_DECREF_IMMORTAL(result);
6600
6589
  }
6601
6590
 
6602
- f = RICHCOMPARE(type2);
6591
+ f = TP_RICHCOMPARE(type2);
6603
6592
  if (f != NULL) {
6604
6593
  PyObject *result = (*f)(operand2, operand1, Py_GT);
6605
6594
 
@@ -6609,7 +6598,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6609
6598
  return result;
6610
6599
  }
6611
6600
 
6612
- Py_DECREF(result);
6601
+ Py_DECREF_IMMORTAL(result);
6613
6602
  }
6614
6603
 
6615
6604
  int c;
@@ -6697,14 +6686,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6697
6686
 
6698
6687
  bool r = c != 0;
6699
6688
  PyObject *result = BOOL_FROM(r);
6700
- Py_INCREF(result);
6689
+ Py_INCREF_IMMORTAL(result);
6701
6690
  return result;
6702
6691
  #else
6703
6692
  bool checked_reverse_op = false;
6704
6693
  richcmpfunc f;
6705
6694
 
6706
6695
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
6707
- f = RICHCOMPARE(type2);
6696
+ f = TP_RICHCOMPARE(type2);
6708
6697
 
6709
6698
  if (f != NULL) {
6710
6699
  checked_reverse_op = true;
@@ -6717,7 +6706,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6717
6706
  return result;
6718
6707
  }
6719
6708
 
6720
- Py_DECREF(result);
6709
+ Py_DECREF_IMMORTAL(result);
6721
6710
  }
6722
6711
  }
6723
6712
 
@@ -6732,11 +6721,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6732
6721
  return result;
6733
6722
  }
6734
6723
 
6735
- Py_DECREF(result);
6724
+ Py_DECREF_IMMORTAL(result);
6736
6725
  }
6737
6726
 
6738
6727
  if (checked_reverse_op == false) {
6739
- f = RICHCOMPARE(type2);
6728
+ f = TP_RICHCOMPARE(type2);
6740
6729
 
6741
6730
  if (f != NULL) {
6742
6731
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -6747,7 +6736,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6747
6736
  return result;
6748
6737
  }
6749
6738
 
6750
- Py_DECREF(result);
6739
+ Py_DECREF_IMMORTAL(result);
6751
6740
  }
6752
6741
  }
6753
6742
 
@@ -6759,13 +6748,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *opera
6759
6748
  case Py_EQ: {
6760
6749
  bool r = operand1 == operand2;
6761
6750
  PyObject *result = BOOL_FROM(r);
6762
- Py_INCREF(result);
6751
+ Py_INCREF_IMMORTAL(result);
6763
6752
  return result;
6764
6753
  }
6765
6754
  case Py_NE: {
6766
6755
  bool r = operand1 != operand2;
6767
6756
  PyObject *result = BOOL_FROM(r);
6768
- Py_INCREF(result);
6757
+ Py_INCREF_IMMORTAL(result);
6769
6758
  return result;
6770
6759
  }
6771
6760
  default:
@@ -6801,15 +6790,19 @@ static bool COMPARE_LT_CBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
6801
6790
 
6802
6791
  if (operand1_long_object == operand2_long_object) {
6803
6792
  r = false;
6804
- } else if (Py_SIZE(operand1_long_object) != Py_SIZE(operand2_long_object)) {
6805
- r = Py_SIZE(operand1_long_object) - Py_SIZE(operand2_long_object) < 0;
6793
+ } else if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
6794
+ Nuitka_LongGetSignedDigitSize(operand2_long_object)) {
6795
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - Nuitka_LongGetSignedDigitSize(operand2_long_object) <
6796
+ 0;
6806
6797
  } else {
6807
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
6798
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
6808
6799
  r = false;
6809
6800
  while (--i >= 0) {
6810
- if (operand1_long_object->ob_digit[i] != operand2_long_object->ob_digit[i]) {
6811
- r = operand1_long_object->ob_digit[i] < operand2_long_object->ob_digit[i];
6812
- if (Py_SIZE(operand1_long_object) < 0) {
6801
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] !=
6802
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i]) {
6803
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] <
6804
+ Nuitka_LongGetDigitPointer(operand2_long_object)[i];
6805
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
6813
6806
  r = !r;
6814
6807
  }
6815
6808
  break;
@@ -6870,7 +6863,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6870
6863
  }
6871
6864
  }
6872
6865
 
6873
- Py_DECREF(result);
6866
+ Py_DECREF_IMMORTAL(result);
6874
6867
  }
6875
6868
 
6876
6869
  // No rich comparison worked, but maybe compare works.
@@ -6939,11 +6932,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6939
6932
  }
6940
6933
  }
6941
6934
 
6942
- Py_DECREF(result);
6935
+ Py_DECREF_IMMORTAL(result);
6943
6936
  }
6944
6937
  }
6945
6938
 
6946
- f = RICHCOMPARE(type1);
6939
+ f = TP_RICHCOMPARE(type1);
6947
6940
  if (f != NULL) {
6948
6941
  PyObject *result = (*f)(operand1, operand2, Py_LT);
6949
6942
 
@@ -6961,7 +6954,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6961
6954
  }
6962
6955
  }
6963
6956
 
6964
- Py_DECREF(result);
6957
+ Py_DECREF_IMMORTAL(result);
6965
6958
  }
6966
6959
 
6967
6960
  f = (PYTHON_VERSION < 0x300 ? NULL : PyLong_Type.tp_richcompare);
@@ -6982,7 +6975,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
6982
6975
  }
6983
6976
  }
6984
6977
 
6985
- Py_DECREF(result);
6978
+ Py_DECREF_IMMORTAL(result);
6986
6979
  }
6987
6980
 
6988
6981
  int c;
@@ -7098,11 +7091,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7098
7091
  }
7099
7092
  }
7100
7093
 
7101
- Py_DECREF(result);
7094
+ Py_DECREF_IMMORTAL(result);
7102
7095
  }
7103
7096
  }
7104
7097
 
7105
- f = RICHCOMPARE(type1);
7098
+ f = TP_RICHCOMPARE(type1);
7106
7099
 
7107
7100
  if (f != NULL) {
7108
7101
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -7121,7 +7114,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7121
7114
  }
7122
7115
  }
7123
7116
 
7124
- Py_DECREF(result);
7117
+ Py_DECREF_IMMORTAL(result);
7125
7118
  }
7126
7119
 
7127
7120
  if (checked_reverse_op == false) {
@@ -7144,7 +7137,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *oper
7144
7137
  }
7145
7138
  }
7146
7139
 
7147
- Py_DECREF(result);
7140
+ Py_DECREF_IMMORTAL(result);
7148
7141
  }
7149
7142
  }
7150
7143
 
@@ -7220,7 +7213,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7220
7213
  }
7221
7214
  }
7222
7215
 
7223
- Py_DECREF(result);
7216
+ Py_DECREF_IMMORTAL(result);
7224
7217
  }
7225
7218
 
7226
7219
  // No rich comparison worked, but maybe compare works.
@@ -7270,7 +7263,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7270
7263
  richcmpfunc f;
7271
7264
 
7272
7265
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7273
- f = RICHCOMPARE(type2);
7266
+ f = TP_RICHCOMPARE(type2);
7274
7267
 
7275
7268
  if (f != NULL) {
7276
7269
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -7289,7 +7282,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7289
7282
  }
7290
7283
  }
7291
7284
 
7292
- Py_DECREF(result);
7285
+ Py_DECREF_IMMORTAL(result);
7293
7286
  }
7294
7287
  }
7295
7288
 
@@ -7311,10 +7304,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7311
7304
  }
7312
7305
  }
7313
7306
 
7314
- Py_DECREF(result);
7307
+ Py_DECREF_IMMORTAL(result);
7315
7308
  }
7316
7309
 
7317
- f = RICHCOMPARE(type2);
7310
+ f = TP_RICHCOMPARE(type2);
7318
7311
  if (f != NULL) {
7319
7312
  PyObject *result = (*f)(operand2, operand1, Py_GT);
7320
7313
 
@@ -7332,7 +7325,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7332
7325
  }
7333
7326
  }
7334
7327
 
7335
- Py_DECREF(result);
7328
+ Py_DECREF_IMMORTAL(result);
7336
7329
  }
7337
7330
 
7338
7331
  int c;
@@ -7427,7 +7420,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7427
7420
  richcmpfunc f;
7428
7421
 
7429
7422
  if (&PyLong_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
7430
- f = RICHCOMPARE(type2);
7423
+ f = TP_RICHCOMPARE(type2);
7431
7424
 
7432
7425
  if (f != NULL) {
7433
7426
  checked_reverse_op = true;
@@ -7448,7 +7441,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7448
7441
  }
7449
7442
  }
7450
7443
 
7451
- Py_DECREF(result);
7444
+ Py_DECREF_IMMORTAL(result);
7452
7445
  }
7453
7446
  }
7454
7447
 
@@ -7471,11 +7464,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7471
7464
  }
7472
7465
  }
7473
7466
 
7474
- Py_DECREF(result);
7467
+ Py_DECREF_IMMORTAL(result);
7475
7468
  }
7476
7469
 
7477
7470
  if (checked_reverse_op == false) {
7478
- f = RICHCOMPARE(type2);
7471
+ f = TP_RICHCOMPARE(type2);
7479
7472
 
7480
7473
  if (f != NULL) {
7481
7474
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -7494,7 +7487,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *oper
7494
7487
  }
7495
7488
  }
7496
7489
 
7497
- Py_DECREF(result);
7490
+ Py_DECREF_IMMORTAL(result);
7498
7491
  }
7499
7492
  }
7500
7493
 
@@ -7541,7 +7534,7 @@ static PyObject *COMPARE_LT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *ope
7541
7534
 
7542
7535
  // Convert to target type.
7543
7536
  PyObject *result = BOOL_FROM(r);
7544
- Py_INCREF(result);
7537
+ Py_INCREF_IMMORTAL(result);
7545
7538
  return result;
7546
7539
  }
7547
7540
  /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
@@ -7578,7 +7571,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7578
7571
  return result;
7579
7572
  }
7580
7573
 
7581
- Py_DECREF(result);
7574
+ Py_DECREF_IMMORTAL(result);
7582
7575
  }
7583
7576
 
7584
7577
  // No rich comparison worked, but maybe compare works.
@@ -7619,7 +7612,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7619
7612
 
7620
7613
  bool r = c != 0;
7621
7614
  PyObject *result = BOOL_FROM(r);
7622
- Py_INCREF(result);
7615
+ Py_INCREF_IMMORTAL(result);
7623
7616
  return result;
7624
7617
  }
7625
7618
  }
@@ -7639,11 +7632,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7639
7632
  return result;
7640
7633
  }
7641
7634
 
7642
- Py_DECREF(result);
7635
+ Py_DECREF_IMMORTAL(result);
7643
7636
  }
7644
7637
  }
7645
7638
 
7646
- f = RICHCOMPARE(type1);
7639
+ f = TP_RICHCOMPARE(type1);
7647
7640
  if (f != NULL) {
7648
7641
  PyObject *result = (*f)(operand1, operand2, Py_LT);
7649
7642
 
@@ -7653,7 +7646,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7653
7646
  return result;
7654
7647
  }
7655
7648
 
7656
- Py_DECREF(result);
7649
+ Py_DECREF_IMMORTAL(result);
7657
7650
  }
7658
7651
 
7659
7652
  f = PyFloat_Type.tp_richcompare;
@@ -7666,7 +7659,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7666
7659
  return result;
7667
7660
  }
7668
7661
 
7669
- Py_DECREF(result);
7662
+ Py_DECREF_IMMORTAL(result);
7670
7663
  }
7671
7664
 
7672
7665
  int c;
@@ -7754,7 +7747,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7754
7747
 
7755
7748
  bool r = c != 0;
7756
7749
  PyObject *result = BOOL_FROM(r);
7757
- Py_INCREF(result);
7750
+ Py_INCREF_IMMORTAL(result);
7758
7751
  return result;
7759
7752
  #else
7760
7753
  bool checked_reverse_op = false;
@@ -7774,11 +7767,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7774
7767
  return result;
7775
7768
  }
7776
7769
 
7777
- Py_DECREF(result);
7770
+ Py_DECREF_IMMORTAL(result);
7778
7771
  }
7779
7772
  }
7780
7773
 
7781
- f = RICHCOMPARE(type1);
7774
+ f = TP_RICHCOMPARE(type1);
7782
7775
 
7783
7776
  if (f != NULL) {
7784
7777
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -7789,7 +7782,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7789
7782
  return result;
7790
7783
  }
7791
7784
 
7792
- Py_DECREF(result);
7785
+ Py_DECREF_IMMORTAL(result);
7793
7786
  }
7794
7787
 
7795
7788
  if (checked_reverse_op == false) {
@@ -7804,7 +7797,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7804
7797
  return result;
7805
7798
  }
7806
7799
 
7807
- Py_DECREF(result);
7800
+ Py_DECREF_IMMORTAL(result);
7808
7801
  }
7809
7802
  }
7810
7803
 
@@ -7816,13 +7809,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *oper
7816
7809
  case Py_EQ: {
7817
7810
  bool r = operand1 == operand2;
7818
7811
  PyObject *result = BOOL_FROM(r);
7819
- Py_INCREF(result);
7812
+ Py_INCREF_IMMORTAL(result);
7820
7813
  return result;
7821
7814
  }
7822
7815
  case Py_NE: {
7823
7816
  bool r = operand1 != operand2;
7824
7817
  PyObject *result = BOOL_FROM(r);
7825
- Py_INCREF(result);
7818
+ Py_INCREF_IMMORTAL(result);
7826
7819
  return result;
7827
7820
  }
7828
7821
  default:
@@ -7870,7 +7863,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7870
7863
  return result;
7871
7864
  }
7872
7865
 
7873
- Py_DECREF(result);
7866
+ Py_DECREF_IMMORTAL(result);
7874
7867
  }
7875
7868
 
7876
7869
  // No rich comparison worked, but maybe compare works.
@@ -7911,7 +7904,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7911
7904
 
7912
7905
  bool r = c != 0;
7913
7906
  PyObject *result = BOOL_FROM(r);
7914
- Py_INCREF(result);
7907
+ Py_INCREF_IMMORTAL(result);
7915
7908
  return result;
7916
7909
  }
7917
7910
  }
@@ -7920,7 +7913,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7920
7913
  richcmpfunc f;
7921
7914
 
7922
7915
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
7923
- f = RICHCOMPARE(type2);
7916
+ f = TP_RICHCOMPARE(type2);
7924
7917
 
7925
7918
  if (f != NULL) {
7926
7919
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -7931,7 +7924,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7931
7924
  return result;
7932
7925
  }
7933
7926
 
7934
- Py_DECREF(result);
7927
+ Py_DECREF_IMMORTAL(result);
7935
7928
  }
7936
7929
  }
7937
7930
 
@@ -7945,10 +7938,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7945
7938
  return result;
7946
7939
  }
7947
7940
 
7948
- Py_DECREF(result);
7941
+ Py_DECREF_IMMORTAL(result);
7949
7942
  }
7950
7943
 
7951
- f = RICHCOMPARE(type2);
7944
+ f = TP_RICHCOMPARE(type2);
7952
7945
  if (f != NULL) {
7953
7946
  PyObject *result = (*f)(operand2, operand1, Py_GT);
7954
7947
 
@@ -7958,7 +7951,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
7958
7951
  return result;
7959
7952
  }
7960
7953
 
7961
- Py_DECREF(result);
7954
+ Py_DECREF_IMMORTAL(result);
7962
7955
  }
7963
7956
 
7964
7957
  int c;
@@ -8046,14 +8039,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8046
8039
 
8047
8040
  bool r = c != 0;
8048
8041
  PyObject *result = BOOL_FROM(r);
8049
- Py_INCREF(result);
8042
+ Py_INCREF_IMMORTAL(result);
8050
8043
  return result;
8051
8044
  #else
8052
8045
  bool checked_reverse_op = false;
8053
8046
  richcmpfunc f;
8054
8047
 
8055
8048
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8056
- f = RICHCOMPARE(type2);
8049
+ f = TP_RICHCOMPARE(type2);
8057
8050
 
8058
8051
  if (f != NULL) {
8059
8052
  checked_reverse_op = true;
@@ -8066,7 +8059,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8066
8059
  return result;
8067
8060
  }
8068
8061
 
8069
- Py_DECREF(result);
8062
+ Py_DECREF_IMMORTAL(result);
8070
8063
  }
8071
8064
  }
8072
8065
 
@@ -8081,11 +8074,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8081
8074
  return result;
8082
8075
  }
8083
8076
 
8084
- Py_DECREF(result);
8077
+ Py_DECREF_IMMORTAL(result);
8085
8078
  }
8086
8079
 
8087
8080
  if (checked_reverse_op == false) {
8088
- f = RICHCOMPARE(type2);
8081
+ f = TP_RICHCOMPARE(type2);
8089
8082
 
8090
8083
  if (f != NULL) {
8091
8084
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -8096,7 +8089,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8096
8089
  return result;
8097
8090
  }
8098
8091
 
8099
- Py_DECREF(result);
8092
+ Py_DECREF_IMMORTAL(result);
8100
8093
  }
8101
8094
  }
8102
8095
 
@@ -8108,13 +8101,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *oper
8108
8101
  case Py_EQ: {
8109
8102
  bool r = operand1 == operand2;
8110
8103
  PyObject *result = BOOL_FROM(r);
8111
- Py_INCREF(result);
8104
+ Py_INCREF_IMMORTAL(result);
8112
8105
  return result;
8113
8106
  }
8114
8107
  case Py_NE: {
8115
8108
  bool r = operand1 != operand2;
8116
8109
  PyObject *result = BOOL_FROM(r);
8117
- Py_INCREF(result);
8110
+ Py_INCREF_IMMORTAL(result);
8118
8111
  return result;
8119
8112
  }
8120
8113
  default:
@@ -8198,7 +8191,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8198
8191
  }
8199
8192
  }
8200
8193
 
8201
- Py_DECREF(result);
8194
+ Py_DECREF_IMMORTAL(result);
8202
8195
  }
8203
8196
 
8204
8197
  // No rich comparison worked, but maybe compare works.
@@ -8267,11 +8260,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8267
8260
  }
8268
8261
  }
8269
8262
 
8270
- Py_DECREF(result);
8263
+ Py_DECREF_IMMORTAL(result);
8271
8264
  }
8272
8265
  }
8273
8266
 
8274
- f = RICHCOMPARE(type1);
8267
+ f = TP_RICHCOMPARE(type1);
8275
8268
  if (f != NULL) {
8276
8269
  PyObject *result = (*f)(operand1, operand2, Py_LT);
8277
8270
 
@@ -8289,7 +8282,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8289
8282
  }
8290
8283
  }
8291
8284
 
8292
- Py_DECREF(result);
8285
+ Py_DECREF_IMMORTAL(result);
8293
8286
  }
8294
8287
 
8295
8288
  f = PyFloat_Type.tp_richcompare;
@@ -8310,7 +8303,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8310
8303
  }
8311
8304
  }
8312
8305
 
8313
- Py_DECREF(result);
8306
+ Py_DECREF_IMMORTAL(result);
8314
8307
  }
8315
8308
 
8316
8309
  int c;
@@ -8426,11 +8419,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8426
8419
  }
8427
8420
  }
8428
8421
 
8429
- Py_DECREF(result);
8422
+ Py_DECREF_IMMORTAL(result);
8430
8423
  }
8431
8424
  }
8432
8425
 
8433
- f = RICHCOMPARE(type1);
8426
+ f = TP_RICHCOMPARE(type1);
8434
8427
 
8435
8428
  if (f != NULL) {
8436
8429
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -8449,7 +8442,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8449
8442
  }
8450
8443
  }
8451
8444
 
8452
- Py_DECREF(result);
8445
+ Py_DECREF_IMMORTAL(result);
8453
8446
  }
8454
8447
 
8455
8448
  if (checked_reverse_op == false) {
@@ -8472,7 +8465,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *ope
8472
8465
  }
8473
8466
  }
8474
8467
 
8475
- Py_DECREF(result);
8468
+ Py_DECREF_IMMORTAL(result);
8476
8469
  }
8477
8470
  }
8478
8471
 
@@ -8546,7 +8539,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8546
8539
  }
8547
8540
  }
8548
8541
 
8549
- Py_DECREF(result);
8542
+ Py_DECREF_IMMORTAL(result);
8550
8543
  }
8551
8544
 
8552
8545
  // No rich comparison worked, but maybe compare works.
@@ -8596,7 +8589,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8596
8589
  richcmpfunc f;
8597
8590
 
8598
8591
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8599
- f = RICHCOMPARE(type2);
8592
+ f = TP_RICHCOMPARE(type2);
8600
8593
 
8601
8594
  if (f != NULL) {
8602
8595
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -8615,7 +8608,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8615
8608
  }
8616
8609
  }
8617
8610
 
8618
- Py_DECREF(result);
8611
+ Py_DECREF_IMMORTAL(result);
8619
8612
  }
8620
8613
  }
8621
8614
 
@@ -8637,10 +8630,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8637
8630
  }
8638
8631
  }
8639
8632
 
8640
- Py_DECREF(result);
8633
+ Py_DECREF_IMMORTAL(result);
8641
8634
  }
8642
8635
 
8643
- f = RICHCOMPARE(type2);
8636
+ f = TP_RICHCOMPARE(type2);
8644
8637
  if (f != NULL) {
8645
8638
  PyObject *result = (*f)(operand2, operand1, Py_GT);
8646
8639
 
@@ -8658,7 +8651,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8658
8651
  }
8659
8652
  }
8660
8653
 
8661
- Py_DECREF(result);
8654
+ Py_DECREF_IMMORTAL(result);
8662
8655
  }
8663
8656
 
8664
8657
  int c;
@@ -8753,7 +8746,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8753
8746
  richcmpfunc f;
8754
8747
 
8755
8748
  if (&PyFloat_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
8756
- f = RICHCOMPARE(type2);
8749
+ f = TP_RICHCOMPARE(type2);
8757
8750
 
8758
8751
  if (f != NULL) {
8759
8752
  checked_reverse_op = true;
@@ -8774,7 +8767,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8774
8767
  }
8775
8768
  }
8776
8769
 
8777
- Py_DECREF(result);
8770
+ Py_DECREF_IMMORTAL(result);
8778
8771
  }
8779
8772
  }
8780
8773
 
@@ -8797,11 +8790,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8797
8790
  }
8798
8791
  }
8799
8792
 
8800
- Py_DECREF(result);
8793
+ Py_DECREF_IMMORTAL(result);
8801
8794
  }
8802
8795
 
8803
8796
  if (checked_reverse_op == false) {
8804
- f = RICHCOMPARE(type2);
8797
+ f = TP_RICHCOMPARE(type2);
8805
8798
 
8806
8799
  if (f != NULL) {
8807
8800
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -8820,7 +8813,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *ope
8820
8813
  }
8821
8814
  }
8822
8815
 
8823
- Py_DECREF(result);
8816
+ Py_DECREF_IMMORTAL(result);
8824
8817
  }
8825
8818
  }
8826
8819
 
@@ -8893,7 +8886,7 @@ static PyObject *COMPARE_LT_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *ope
8893
8886
 
8894
8887
  // Convert to target type.
8895
8888
  PyObject *result = BOOL_FROM(r);
8896
- Py_INCREF(result);
8889
+ Py_INCREF_IMMORTAL(result);
8897
8890
  return result;
8898
8891
  }
8899
8892
 
@@ -8933,7 +8926,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8933
8926
  return result;
8934
8927
  }
8935
8928
 
8936
- Py_DECREF(result);
8929
+ Py_DECREF_IMMORTAL(result);
8937
8930
  }
8938
8931
 
8939
8932
  // No rich comparison worked, but maybe compare works.
@@ -8974,7 +8967,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8974
8967
 
8975
8968
  bool r = c != 0;
8976
8969
  PyObject *result = BOOL_FROM(r);
8977
- Py_INCREF(result);
8970
+ Py_INCREF_IMMORTAL(result);
8978
8971
  return result;
8979
8972
  }
8980
8973
  }
@@ -8994,11 +8987,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
8994
8987
  return result;
8995
8988
  }
8996
8989
 
8997
- Py_DECREF(result);
8990
+ Py_DECREF_IMMORTAL(result);
8998
8991
  }
8999
8992
  }
9000
8993
 
9001
- f = RICHCOMPARE(type1);
8994
+ f = TP_RICHCOMPARE(type1);
9002
8995
  if (f != NULL) {
9003
8996
  PyObject *result = (*f)(operand1, operand2, Py_LT);
9004
8997
 
@@ -9008,7 +9001,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9008
9001
  return result;
9009
9002
  }
9010
9003
 
9011
- Py_DECREF(result);
9004
+ Py_DECREF_IMMORTAL(result);
9012
9005
  }
9013
9006
 
9014
9007
  f = PyTuple_Type.tp_richcompare;
@@ -9021,7 +9014,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9021
9014
  return result;
9022
9015
  }
9023
9016
 
9024
- Py_DECREF(result);
9017
+ Py_DECREF_IMMORTAL(result);
9025
9018
  }
9026
9019
 
9027
9020
  int c;
@@ -9109,7 +9102,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9109
9102
 
9110
9103
  bool r = c != 0;
9111
9104
  PyObject *result = BOOL_FROM(r);
9112
- Py_INCREF(result);
9105
+ Py_INCREF_IMMORTAL(result);
9113
9106
  return result;
9114
9107
  #else
9115
9108
  bool checked_reverse_op = false;
@@ -9129,11 +9122,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9129
9122
  return result;
9130
9123
  }
9131
9124
 
9132
- Py_DECREF(result);
9125
+ Py_DECREF_IMMORTAL(result);
9133
9126
  }
9134
9127
  }
9135
9128
 
9136
- f = RICHCOMPARE(type1);
9129
+ f = TP_RICHCOMPARE(type1);
9137
9130
 
9138
9131
  if (f != NULL) {
9139
9132
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -9144,7 +9137,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9144
9137
  return result;
9145
9138
  }
9146
9139
 
9147
- Py_DECREF(result);
9140
+ Py_DECREF_IMMORTAL(result);
9148
9141
  }
9149
9142
 
9150
9143
  if (checked_reverse_op == false) {
@@ -9159,7 +9152,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9159
9152
  return result;
9160
9153
  }
9161
9154
 
9162
- Py_DECREF(result);
9155
+ Py_DECREF_IMMORTAL(result);
9163
9156
  }
9164
9157
  }
9165
9158
 
@@ -9171,13 +9164,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *oper
9171
9164
  case Py_EQ: {
9172
9165
  bool r = operand1 == operand2;
9173
9166
  PyObject *result = BOOL_FROM(r);
9174
- Py_INCREF(result);
9167
+ Py_INCREF_IMMORTAL(result);
9175
9168
  return result;
9176
9169
  }
9177
9170
  case Py_NE: {
9178
9171
  bool r = operand1 != operand2;
9179
9172
  PyObject *result = BOOL_FROM(r);
9180
- Py_INCREF(result);
9173
+ Py_INCREF_IMMORTAL(result);
9181
9174
  return result;
9182
9175
  }
9183
9176
  default:
@@ -9225,7 +9218,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9225
9218
  return result;
9226
9219
  }
9227
9220
 
9228
- Py_DECREF(result);
9221
+ Py_DECREF_IMMORTAL(result);
9229
9222
  }
9230
9223
 
9231
9224
  // No rich comparison worked, but maybe compare works.
@@ -9266,7 +9259,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9266
9259
 
9267
9260
  bool r = c != 0;
9268
9261
  PyObject *result = BOOL_FROM(r);
9269
- Py_INCREF(result);
9262
+ Py_INCREF_IMMORTAL(result);
9270
9263
  return result;
9271
9264
  }
9272
9265
  }
@@ -9275,7 +9268,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9275
9268
  richcmpfunc f;
9276
9269
 
9277
9270
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9278
- f = RICHCOMPARE(type2);
9271
+ f = TP_RICHCOMPARE(type2);
9279
9272
 
9280
9273
  if (f != NULL) {
9281
9274
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -9286,7 +9279,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9286
9279
  return result;
9287
9280
  }
9288
9281
 
9289
- Py_DECREF(result);
9282
+ Py_DECREF_IMMORTAL(result);
9290
9283
  }
9291
9284
  }
9292
9285
 
@@ -9300,10 +9293,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9300
9293
  return result;
9301
9294
  }
9302
9295
 
9303
- Py_DECREF(result);
9296
+ Py_DECREF_IMMORTAL(result);
9304
9297
  }
9305
9298
 
9306
- f = RICHCOMPARE(type2);
9299
+ f = TP_RICHCOMPARE(type2);
9307
9300
  if (f != NULL) {
9308
9301
  PyObject *result = (*f)(operand2, operand1, Py_GT);
9309
9302
 
@@ -9313,7 +9306,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9313
9306
  return result;
9314
9307
  }
9315
9308
 
9316
- Py_DECREF(result);
9309
+ Py_DECREF_IMMORTAL(result);
9317
9310
  }
9318
9311
 
9319
9312
  int c;
@@ -9401,14 +9394,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9401
9394
 
9402
9395
  bool r = c != 0;
9403
9396
  PyObject *result = BOOL_FROM(r);
9404
- Py_INCREF(result);
9397
+ Py_INCREF_IMMORTAL(result);
9405
9398
  return result;
9406
9399
  #else
9407
9400
  bool checked_reverse_op = false;
9408
9401
  richcmpfunc f;
9409
9402
 
9410
9403
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9411
- f = RICHCOMPARE(type2);
9404
+ f = TP_RICHCOMPARE(type2);
9412
9405
 
9413
9406
  if (f != NULL) {
9414
9407
  checked_reverse_op = true;
@@ -9421,7 +9414,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9421
9414
  return result;
9422
9415
  }
9423
9416
 
9424
- Py_DECREF(result);
9417
+ Py_DECREF_IMMORTAL(result);
9425
9418
  }
9426
9419
  }
9427
9420
 
@@ -9436,11 +9429,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9436
9429
  return result;
9437
9430
  }
9438
9431
 
9439
- Py_DECREF(result);
9432
+ Py_DECREF_IMMORTAL(result);
9440
9433
  }
9441
9434
 
9442
9435
  if (checked_reverse_op == false) {
9443
- f = RICHCOMPARE(type2);
9436
+ f = TP_RICHCOMPARE(type2);
9444
9437
 
9445
9438
  if (f != NULL) {
9446
9439
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -9451,7 +9444,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9451
9444
  return result;
9452
9445
  }
9453
9446
 
9454
- Py_DECREF(result);
9447
+ Py_DECREF_IMMORTAL(result);
9455
9448
  }
9456
9449
  }
9457
9450
 
@@ -9463,13 +9456,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *oper
9463
9456
  case Py_EQ: {
9464
9457
  bool r = operand1 == operand2;
9465
9458
  PyObject *result = BOOL_FROM(r);
9466
- Py_INCREF(result);
9459
+ Py_INCREF_IMMORTAL(result);
9467
9460
  return result;
9468
9461
  }
9469
9462
  case Py_NE: {
9470
9463
  bool r = operand1 != operand2;
9471
9464
  PyObject *result = BOOL_FROM(r);
9472
- Py_INCREF(result);
9465
+ Py_INCREF_IMMORTAL(result);
9473
9466
  return result;
9474
9467
  }
9475
9468
  default:
@@ -9578,7 +9571,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9578
9571
  }
9579
9572
  }
9580
9573
 
9581
- Py_DECREF(result);
9574
+ Py_DECREF_IMMORTAL(result);
9582
9575
  }
9583
9576
 
9584
9577
  // No rich comparison worked, but maybe compare works.
@@ -9647,11 +9640,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9647
9640
  }
9648
9641
  }
9649
9642
 
9650
- Py_DECREF(result);
9643
+ Py_DECREF_IMMORTAL(result);
9651
9644
  }
9652
9645
  }
9653
9646
 
9654
- f = RICHCOMPARE(type1);
9647
+ f = TP_RICHCOMPARE(type1);
9655
9648
  if (f != NULL) {
9656
9649
  PyObject *result = (*f)(operand1, operand2, Py_LT);
9657
9650
 
@@ -9669,7 +9662,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9669
9662
  }
9670
9663
  }
9671
9664
 
9672
- Py_DECREF(result);
9665
+ Py_DECREF_IMMORTAL(result);
9673
9666
  }
9674
9667
 
9675
9668
  f = PyTuple_Type.tp_richcompare;
@@ -9690,7 +9683,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9690
9683
  }
9691
9684
  }
9692
9685
 
9693
- Py_DECREF(result);
9686
+ Py_DECREF_IMMORTAL(result);
9694
9687
  }
9695
9688
 
9696
9689
  int c;
@@ -9806,11 +9799,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9806
9799
  }
9807
9800
  }
9808
9801
 
9809
- Py_DECREF(result);
9802
+ Py_DECREF_IMMORTAL(result);
9810
9803
  }
9811
9804
  }
9812
9805
 
9813
- f = RICHCOMPARE(type1);
9806
+ f = TP_RICHCOMPARE(type1);
9814
9807
 
9815
9808
  if (f != NULL) {
9816
9809
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -9829,7 +9822,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9829
9822
  }
9830
9823
  }
9831
9824
 
9832
- Py_DECREF(result);
9825
+ Py_DECREF_IMMORTAL(result);
9833
9826
  }
9834
9827
 
9835
9828
  if (checked_reverse_op == false) {
@@ -9852,7 +9845,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_TUPLE(PyObject *operand1, PyObject *ope
9852
9845
  }
9853
9846
  }
9854
9847
 
9855
- Py_DECREF(result);
9848
+ Py_DECREF_IMMORTAL(result);
9856
9849
  }
9857
9850
  }
9858
9851
 
@@ -9926,7 +9919,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9926
9919
  }
9927
9920
  }
9928
9921
 
9929
- Py_DECREF(result);
9922
+ Py_DECREF_IMMORTAL(result);
9930
9923
  }
9931
9924
 
9932
9925
  // No rich comparison worked, but maybe compare works.
@@ -9976,7 +9969,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9976
9969
  richcmpfunc f;
9977
9970
 
9978
9971
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
9979
- f = RICHCOMPARE(type2);
9972
+ f = TP_RICHCOMPARE(type2);
9980
9973
 
9981
9974
  if (f != NULL) {
9982
9975
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -9995,7 +9988,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
9995
9988
  }
9996
9989
  }
9997
9990
 
9998
- Py_DECREF(result);
9991
+ Py_DECREF_IMMORTAL(result);
9999
9992
  }
10000
9993
  }
10001
9994
 
@@ -10017,10 +10010,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10017
10010
  }
10018
10011
  }
10019
10012
 
10020
- Py_DECREF(result);
10013
+ Py_DECREF_IMMORTAL(result);
10021
10014
  }
10022
10015
 
10023
- f = RICHCOMPARE(type2);
10016
+ f = TP_RICHCOMPARE(type2);
10024
10017
  if (f != NULL) {
10025
10018
  PyObject *result = (*f)(operand2, operand1, Py_GT);
10026
10019
 
@@ -10038,7 +10031,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10038
10031
  }
10039
10032
  }
10040
10033
 
10041
- Py_DECREF(result);
10034
+ Py_DECREF_IMMORTAL(result);
10042
10035
  }
10043
10036
 
10044
10037
  int c;
@@ -10133,7 +10126,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10133
10126
  richcmpfunc f;
10134
10127
 
10135
10128
  if (&PyTuple_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyTuple_Type)) {
10136
- f = RICHCOMPARE(type2);
10129
+ f = TP_RICHCOMPARE(type2);
10137
10130
 
10138
10131
  if (f != NULL) {
10139
10132
  checked_reverse_op = true;
@@ -10154,7 +10147,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10154
10147
  }
10155
10148
  }
10156
10149
 
10157
- Py_DECREF(result);
10150
+ Py_DECREF_IMMORTAL(result);
10158
10151
  }
10159
10152
  }
10160
10153
 
@@ -10177,11 +10170,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10177
10170
  }
10178
10171
  }
10179
10172
 
10180
- Py_DECREF(result);
10173
+ Py_DECREF_IMMORTAL(result);
10181
10174
  }
10182
10175
 
10183
10176
  if (checked_reverse_op == false) {
10184
- f = RICHCOMPARE(type2);
10177
+ f = TP_RICHCOMPARE(type2);
10185
10178
 
10186
10179
  if (f != NULL) {
10187
10180
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -10200,7 +10193,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_TUPLE_OBJECT(PyObject *operand1, PyObject *ope
10200
10193
  }
10201
10194
  }
10202
10195
 
10203
- Py_DECREF(result);
10196
+ Py_DECREF_IMMORTAL(result);
10204
10197
  }
10205
10198
  }
10206
10199
 
@@ -10247,14 +10240,11 @@ static PyObject *COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10247
10240
  PyListObject *a = (PyListObject *)operand1;
10248
10241
  PyListObject *b = (PyListObject *)operand2;
10249
10242
 
10250
- Py_ssize_t len_a = Py_SIZE(a);
10251
- Py_ssize_t len_b = Py_SIZE(b);
10252
-
10253
10243
  bool found = false;
10254
10244
  nuitka_bool res = NUITKA_BOOL_TRUE;
10255
10245
 
10256
10246
  Py_ssize_t i;
10257
- for (i = 0; i < len_a && i < len_b; i++) {
10247
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10258
10248
  PyObject *aa = a->ob_item[i];
10259
10249
  PyObject *bb = b->ob_item[i];
10260
10250
 
@@ -10262,7 +10252,11 @@ static PyObject *COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10262
10252
  continue;
10263
10253
  }
10264
10254
 
10255
+ Py_INCREF(aa);
10256
+ Py_INCREF(bb);
10265
10257
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10258
+ Py_DECREF(aa);
10259
+ Py_DECREF(bb);
10266
10260
 
10267
10261
  if (res == NUITKA_BOOL_EXCEPTION) {
10268
10262
  return NULL;
@@ -10275,11 +10269,11 @@ static PyObject *COMPARE_LT_OBJECT_LIST_LIST(PyObject *operand1, PyObject *opera
10275
10269
  }
10276
10270
 
10277
10271
  if (found == false) {
10278
- bool r = len_a < len_b;
10272
+ bool r = Py_SIZE(a) < Py_SIZE(b);
10279
10273
 
10280
10274
  // Convert to target type.
10281
10275
  PyObject *result = BOOL_FROM(r);
10282
- Py_INCREF(result);
10276
+ Py_INCREF_IMMORTAL(result);
10283
10277
  return result;
10284
10278
  }
10285
10279
 
@@ -10319,7 +10313,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10319
10313
  return result;
10320
10314
  }
10321
10315
 
10322
- Py_DECREF(result);
10316
+ Py_DECREF_IMMORTAL(result);
10323
10317
  }
10324
10318
 
10325
10319
  // No rich comparison worked, but maybe compare works.
@@ -10360,7 +10354,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10360
10354
 
10361
10355
  bool r = c != 0;
10362
10356
  PyObject *result = BOOL_FROM(r);
10363
- Py_INCREF(result);
10357
+ Py_INCREF_IMMORTAL(result);
10364
10358
  return result;
10365
10359
  }
10366
10360
  }
@@ -10380,11 +10374,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10380
10374
  return result;
10381
10375
  }
10382
10376
 
10383
- Py_DECREF(result);
10377
+ Py_DECREF_IMMORTAL(result);
10384
10378
  }
10385
10379
  }
10386
10380
 
10387
- f = RICHCOMPARE(type1);
10381
+ f = TP_RICHCOMPARE(type1);
10388
10382
  if (f != NULL) {
10389
10383
  PyObject *result = (*f)(operand1, operand2, Py_LT);
10390
10384
 
@@ -10394,7 +10388,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10394
10388
  return result;
10395
10389
  }
10396
10390
 
10397
- Py_DECREF(result);
10391
+ Py_DECREF_IMMORTAL(result);
10398
10392
  }
10399
10393
 
10400
10394
  f = PyList_Type.tp_richcompare;
@@ -10407,7 +10401,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10407
10401
  return result;
10408
10402
  }
10409
10403
 
10410
- Py_DECREF(result);
10404
+ Py_DECREF_IMMORTAL(result);
10411
10405
  }
10412
10406
 
10413
10407
  int c;
@@ -10495,7 +10489,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10495
10489
 
10496
10490
  bool r = c != 0;
10497
10491
  PyObject *result = BOOL_FROM(r);
10498
- Py_INCREF(result);
10492
+ Py_INCREF_IMMORTAL(result);
10499
10493
  return result;
10500
10494
  #else
10501
10495
  bool checked_reverse_op = false;
@@ -10515,11 +10509,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10515
10509
  return result;
10516
10510
  }
10517
10511
 
10518
- Py_DECREF(result);
10512
+ Py_DECREF_IMMORTAL(result);
10519
10513
  }
10520
10514
  }
10521
10515
 
10522
- f = RICHCOMPARE(type1);
10516
+ f = TP_RICHCOMPARE(type1);
10523
10517
 
10524
10518
  if (f != NULL) {
10525
10519
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -10530,7 +10524,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10530
10524
  return result;
10531
10525
  }
10532
10526
 
10533
- Py_DECREF(result);
10527
+ Py_DECREF_IMMORTAL(result);
10534
10528
  }
10535
10529
 
10536
10530
  if (checked_reverse_op == false) {
@@ -10545,7 +10539,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10545
10539
  return result;
10546
10540
  }
10547
10541
 
10548
- Py_DECREF(result);
10542
+ Py_DECREF_IMMORTAL(result);
10549
10543
  }
10550
10544
  }
10551
10545
 
@@ -10557,13 +10551,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *opera
10557
10551
  case Py_EQ: {
10558
10552
  bool r = operand1 == operand2;
10559
10553
  PyObject *result = BOOL_FROM(r);
10560
- Py_INCREF(result);
10554
+ Py_INCREF_IMMORTAL(result);
10561
10555
  return result;
10562
10556
  }
10563
10557
  case Py_NE: {
10564
10558
  bool r = operand1 != operand2;
10565
10559
  PyObject *result = BOOL_FROM(r);
10566
- Py_INCREF(result);
10560
+ Py_INCREF_IMMORTAL(result);
10567
10561
  return result;
10568
10562
  }
10569
10563
  default:
@@ -10611,7 +10605,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10611
10605
  return result;
10612
10606
  }
10613
10607
 
10614
- Py_DECREF(result);
10608
+ Py_DECREF_IMMORTAL(result);
10615
10609
  }
10616
10610
 
10617
10611
  // No rich comparison worked, but maybe compare works.
@@ -10652,7 +10646,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10652
10646
 
10653
10647
  bool r = c != 0;
10654
10648
  PyObject *result = BOOL_FROM(r);
10655
- Py_INCREF(result);
10649
+ Py_INCREF_IMMORTAL(result);
10656
10650
  return result;
10657
10651
  }
10658
10652
  }
@@ -10661,7 +10655,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10661
10655
  richcmpfunc f;
10662
10656
 
10663
10657
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10664
- f = RICHCOMPARE(type2);
10658
+ f = TP_RICHCOMPARE(type2);
10665
10659
 
10666
10660
  if (f != NULL) {
10667
10661
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -10672,7 +10666,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10672
10666
  return result;
10673
10667
  }
10674
10668
 
10675
- Py_DECREF(result);
10669
+ Py_DECREF_IMMORTAL(result);
10676
10670
  }
10677
10671
  }
10678
10672
 
@@ -10686,10 +10680,10 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10686
10680
  return result;
10687
10681
  }
10688
10682
 
10689
- Py_DECREF(result);
10683
+ Py_DECREF_IMMORTAL(result);
10690
10684
  }
10691
10685
 
10692
- f = RICHCOMPARE(type2);
10686
+ f = TP_RICHCOMPARE(type2);
10693
10687
  if (f != NULL) {
10694
10688
  PyObject *result = (*f)(operand2, operand1, Py_GT);
10695
10689
 
@@ -10699,7 +10693,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10699
10693
  return result;
10700
10694
  }
10701
10695
 
10702
- Py_DECREF(result);
10696
+ Py_DECREF_IMMORTAL(result);
10703
10697
  }
10704
10698
 
10705
10699
  int c;
@@ -10787,14 +10781,14 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10787
10781
 
10788
10782
  bool r = c != 0;
10789
10783
  PyObject *result = BOOL_FROM(r);
10790
- Py_INCREF(result);
10784
+ Py_INCREF_IMMORTAL(result);
10791
10785
  return result;
10792
10786
  #else
10793
10787
  bool checked_reverse_op = false;
10794
10788
  richcmpfunc f;
10795
10789
 
10796
10790
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
10797
- f = RICHCOMPARE(type2);
10791
+ f = TP_RICHCOMPARE(type2);
10798
10792
 
10799
10793
  if (f != NULL) {
10800
10794
  checked_reverse_op = true;
@@ -10807,7 +10801,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10807
10801
  return result;
10808
10802
  }
10809
10803
 
10810
- Py_DECREF(result);
10804
+ Py_DECREF_IMMORTAL(result);
10811
10805
  }
10812
10806
  }
10813
10807
 
@@ -10822,11 +10816,11 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10822
10816
  return result;
10823
10817
  }
10824
10818
 
10825
- Py_DECREF(result);
10819
+ Py_DECREF_IMMORTAL(result);
10826
10820
  }
10827
10821
 
10828
10822
  if (checked_reverse_op == false) {
10829
- f = RICHCOMPARE(type2);
10823
+ f = TP_RICHCOMPARE(type2);
10830
10824
 
10831
10825
  if (f != NULL) {
10832
10826
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -10837,7 +10831,7 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10837
10831
  return result;
10838
10832
  }
10839
10833
 
10840
- Py_DECREF(result);
10834
+ Py_DECREF_IMMORTAL(result);
10841
10835
  }
10842
10836
  }
10843
10837
 
@@ -10849,13 +10843,13 @@ PyObject *RICH_COMPARE_LT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *opera
10849
10843
  case Py_EQ: {
10850
10844
  bool r = operand1 == operand2;
10851
10845
  PyObject *result = BOOL_FROM(r);
10852
- Py_INCREF(result);
10846
+ Py_INCREF_IMMORTAL(result);
10853
10847
  return result;
10854
10848
  }
10855
10849
  case Py_NE: {
10856
10850
  bool r = operand1 != operand2;
10857
10851
  PyObject *result = BOOL_FROM(r);
10858
- Py_INCREF(result);
10852
+ Py_INCREF_IMMORTAL(result);
10859
10853
  return result;
10860
10854
  }
10861
10855
  default:
@@ -10884,14 +10878,11 @@ static nuitka_bool COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10884
10878
  PyListObject *a = (PyListObject *)operand1;
10885
10879
  PyListObject *b = (PyListObject *)operand2;
10886
10880
 
10887
- Py_ssize_t len_a = Py_SIZE(a);
10888
- Py_ssize_t len_b = Py_SIZE(b);
10889
-
10890
10881
  bool found = false;
10891
10882
  nuitka_bool res = NUITKA_BOOL_TRUE;
10892
10883
 
10893
10884
  Py_ssize_t i;
10894
- for (i = 0; i < len_a && i < len_b; i++) {
10885
+ for (i = 0; i < Py_SIZE(a) && i < Py_SIZE(b); i++) {
10895
10886
  PyObject *aa = a->ob_item[i];
10896
10887
  PyObject *bb = b->ob_item[i];
10897
10888
 
@@ -10899,7 +10890,11 @@ static nuitka_bool COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10899
10890
  continue;
10900
10891
  }
10901
10892
 
10893
+ Py_INCREF(aa);
10894
+ Py_INCREF(bb);
10902
10895
  res = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(aa, bb);
10896
+ Py_DECREF(aa);
10897
+ Py_DECREF(bb);
10903
10898
 
10904
10899
  if (res == NUITKA_BOOL_EXCEPTION) {
10905
10900
  return NUITKA_BOOL_EXCEPTION;
@@ -10912,7 +10907,7 @@ static nuitka_bool COMPARE_LT_NBOOL_LIST_LIST(PyObject *operand1, PyObject *oper
10912
10907
  }
10913
10908
 
10914
10909
  if (found == false) {
10915
- bool r = len_a < len_b;
10910
+ bool r = Py_SIZE(a) < Py_SIZE(b);
10916
10911
 
10917
10912
  // Convert to target type.
10918
10913
  nuitka_bool result = r ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
@@ -10964,7 +10959,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
10964
10959
  }
10965
10960
  }
10966
10961
 
10967
- Py_DECREF(result);
10962
+ Py_DECREF_IMMORTAL(result);
10968
10963
  }
10969
10964
 
10970
10965
  // No rich comparison worked, but maybe compare works.
@@ -11033,11 +11028,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11033
11028
  }
11034
11029
  }
11035
11030
 
11036
- Py_DECREF(result);
11031
+ Py_DECREF_IMMORTAL(result);
11037
11032
  }
11038
11033
  }
11039
11034
 
11040
- f = RICHCOMPARE(type1);
11035
+ f = TP_RICHCOMPARE(type1);
11041
11036
  if (f != NULL) {
11042
11037
  PyObject *result = (*f)(operand1, operand2, Py_LT);
11043
11038
 
@@ -11055,7 +11050,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11055
11050
  }
11056
11051
  }
11057
11052
 
11058
- Py_DECREF(result);
11053
+ Py_DECREF_IMMORTAL(result);
11059
11054
  }
11060
11055
 
11061
11056
  f = PyList_Type.tp_richcompare;
@@ -11076,7 +11071,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11076
11071
  }
11077
11072
  }
11078
11073
 
11079
- Py_DECREF(result);
11074
+ Py_DECREF_IMMORTAL(result);
11080
11075
  }
11081
11076
 
11082
11077
  int c;
@@ -11192,11 +11187,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11192
11187
  }
11193
11188
  }
11194
11189
 
11195
- Py_DECREF(result);
11190
+ Py_DECREF_IMMORTAL(result);
11196
11191
  }
11197
11192
  }
11198
11193
 
11199
- f = RICHCOMPARE(type1);
11194
+ f = TP_RICHCOMPARE(type1);
11200
11195
 
11201
11196
  if (f != NULL) {
11202
11197
  PyObject *result = (*f)(operand1, operand2, Py_LT);
@@ -11215,7 +11210,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11215
11210
  }
11216
11211
  }
11217
11212
 
11218
- Py_DECREF(result);
11213
+ Py_DECREF_IMMORTAL(result);
11219
11214
  }
11220
11215
 
11221
11216
  if (checked_reverse_op == false) {
@@ -11238,7 +11233,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *oper
11238
11233
  }
11239
11234
  }
11240
11235
 
11241
- Py_DECREF(result);
11236
+ Py_DECREF_IMMORTAL(result);
11242
11237
  }
11243
11238
  }
11244
11239
 
@@ -11312,7 +11307,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11312
11307
  }
11313
11308
  }
11314
11309
 
11315
- Py_DECREF(result);
11310
+ Py_DECREF_IMMORTAL(result);
11316
11311
  }
11317
11312
 
11318
11313
  // No rich comparison worked, but maybe compare works.
@@ -11362,7 +11357,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11362
11357
  richcmpfunc f;
11363
11358
 
11364
11359
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11365
- f = RICHCOMPARE(type2);
11360
+ f = TP_RICHCOMPARE(type2);
11366
11361
 
11367
11362
  if (f != NULL) {
11368
11363
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -11381,7 +11376,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11381
11376
  }
11382
11377
  }
11383
11378
 
11384
- Py_DECREF(result);
11379
+ Py_DECREF_IMMORTAL(result);
11385
11380
  }
11386
11381
  }
11387
11382
 
@@ -11403,10 +11398,10 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11403
11398
  }
11404
11399
  }
11405
11400
 
11406
- Py_DECREF(result);
11401
+ Py_DECREF_IMMORTAL(result);
11407
11402
  }
11408
11403
 
11409
- f = RICHCOMPARE(type2);
11404
+ f = TP_RICHCOMPARE(type2);
11410
11405
  if (f != NULL) {
11411
11406
  PyObject *result = (*f)(operand2, operand1, Py_GT);
11412
11407
 
@@ -11424,7 +11419,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11424
11419
  }
11425
11420
  }
11426
11421
 
11427
- Py_DECREF(result);
11422
+ Py_DECREF_IMMORTAL(result);
11428
11423
  }
11429
11424
 
11430
11425
  int c;
@@ -11519,7 +11514,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11519
11514
  richcmpfunc f;
11520
11515
 
11521
11516
  if (&PyList_Type != type2 && Nuitka_Type_IsSubtype(type2, &PyList_Type)) {
11522
- f = RICHCOMPARE(type2);
11517
+ f = TP_RICHCOMPARE(type2);
11523
11518
 
11524
11519
  if (f != NULL) {
11525
11520
  checked_reverse_op = true;
@@ -11540,7 +11535,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11540
11535
  }
11541
11536
  }
11542
11537
 
11543
- Py_DECREF(result);
11538
+ Py_DECREF_IMMORTAL(result);
11544
11539
  }
11545
11540
  }
11546
11541
 
@@ -11563,11 +11558,11 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11563
11558
  }
11564
11559
  }
11565
11560
 
11566
- Py_DECREF(result);
11561
+ Py_DECREF_IMMORTAL(result);
11567
11562
  }
11568
11563
 
11569
11564
  if (checked_reverse_op == false) {
11570
- f = RICHCOMPARE(type2);
11565
+ f = TP_RICHCOMPARE(type2);
11571
11566
 
11572
11567
  if (f != NULL) {
11573
11568
  PyObject *result = (*f)(operand2, operand1, Py_GT);
@@ -11586,7 +11581,7 @@ nuitka_bool RICH_COMPARE_LT_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *oper
11586
11581
  }
11587
11582
  }
11588
11583
 
11589
- Py_DECREF(result);
11584
+ Py_DECREF_IMMORTAL(result);
11590
11585
  }
11591
11586
  }
11592
11587
 
@@ -11643,7 +11638,7 @@ static PyObject *COMPARE_LT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11643
11638
  }
11644
11639
 
11645
11640
  Py_ssize_t operand2_digit_count = 0;
11646
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11641
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11647
11642
  {
11648
11643
  unsigned long t = operand2_abs_ival;
11649
11644
 
@@ -11660,15 +11655,15 @@ static PyObject *COMPARE_LT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11660
11655
 
11661
11656
  bool r;
11662
11657
 
11663
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11664
- r = Py_SIZE(operand1_long_object) - operand2_size < 0;
11658
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11659
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size < 0;
11665
11660
  } else {
11666
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11661
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11667
11662
  r = false;
11668
11663
  while (--i >= 0) {
11669
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11670
- r = operand1_long_object->ob_digit[i] < operand2_digits[i];
11671
- if (Py_SIZE(operand1_long_object) < 0) {
11664
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11665
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];
11666
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11672
11667
  r = !r;
11673
11668
  }
11674
11669
  break;
@@ -11678,7 +11673,7 @@ static PyObject *COMPARE_LT_OBJECT_LONG_CLONG(PyObject *operand1, long operand2)
11678
11673
 
11679
11674
  // Convert to target type.
11680
11675
  PyObject *result = BOOL_FROM(r);
11681
- Py_INCREF(result);
11676
+ Py_INCREF_IMMORTAL(result);
11682
11677
  return result;
11683
11678
  }
11684
11679
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
@@ -11707,7 +11702,7 @@ static bool COMPARE_LT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11707
11702
  }
11708
11703
 
11709
11704
  Py_ssize_t operand2_digit_count = 0;
11710
- digit operand2_digits[5]; // Could be more minimal and depend on sizeof(digit)
11705
+ digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
11711
11706
  {
11712
11707
  unsigned long t = operand2_abs_ival;
11713
11708
 
@@ -11724,15 +11719,15 @@ static bool COMPARE_LT_CBOOL_LONG_CLONG(PyObject *operand1, long operand2) {
11724
11719
 
11725
11720
  bool r;
11726
11721
 
11727
- if (Py_SIZE(operand1_long_object) != operand2_size) {
11728
- r = Py_SIZE(operand1_long_object) - operand2_size < 0;
11722
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) != operand2_size) {
11723
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) - operand2_size < 0;
11729
11724
  } else {
11730
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11725
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11731
11726
  r = false;
11732
11727
  while (--i >= 0) {
11733
- if (operand1_long_object->ob_digit[i] != operand2_digits[i]) {
11734
- r = operand1_long_object->ob_digit[i] < operand2_digits[i];
11735
- if (Py_SIZE(operand1_long_object) < 0) {
11728
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != operand2_digits[i]) {
11729
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < operand2_digits[i];
11730
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11736
11731
  r = !r;
11737
11732
  }
11738
11733
  break;
@@ -11764,7 +11759,7 @@ static PyObject *COMPARE_LT_OBJECT_INT_CLONG(PyObject *operand1, long operand2)
11764
11759
 
11765
11760
  // Convert to target type.
11766
11761
  PyObject *result = BOOL_FROM(r);
11767
- Py_INCREF(result);
11762
+ Py_INCREF_IMMORTAL(result);
11768
11763
  return result;
11769
11764
  }
11770
11765
  /* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
@@ -11805,15 +11800,18 @@ static PyObject *COMPARE_LT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11805
11800
 
11806
11801
  bool r;
11807
11802
 
11808
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11809
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;
11803
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11804
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11805
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11806
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) <
11807
+ 0;
11810
11808
  } else {
11811
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11809
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11812
11810
  r = false;
11813
11811
  while (--i >= 0) {
11814
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11815
- r = operand1_long_object->ob_digit[i] < (digit)Py_ABS(operand2);
11816
- if (Py_SIZE(operand1_long_object) < 0) {
11812
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11813
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);
11814
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11817
11815
  r = !r;
11818
11816
  }
11819
11817
  break;
@@ -11823,7 +11821,7 @@ static PyObject *COMPARE_LT_OBJECT_LONG_DIGIT(PyObject *operand1, long operand2)
11823
11821
 
11824
11822
  // Convert to target type.
11825
11823
  PyObject *result = BOOL_FROM(r);
11826
- Py_INCREF(result);
11824
+ Py_INCREF_IMMORTAL(result);
11827
11825
  return result;
11828
11826
  }
11829
11827
  /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "DIGIT" to C platform digit value for long
@@ -11842,15 +11840,18 @@ static bool COMPARE_LT_CBOOL_LONG_DIGIT(PyObject *operand1, long operand2) {
11842
11840
 
11843
11841
  bool r;
11844
11842
 
11845
- if (Py_SIZE(operand1_long_object) != (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11846
- r = Py_SIZE(operand1_long_object) - (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) < 0;
11843
+ if (Nuitka_LongGetSignedDigitSize(operand1_long_object) !=
11844
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1))) {
11845
+ r = Nuitka_LongGetSignedDigitSize(operand1_long_object) -
11846
+ (Py_ssize_t)((operand2 == 0) ? 0 : ((operand2 < 0) ? -1 : 1)) <
11847
+ 0;
11847
11848
  } else {
11848
- Py_ssize_t i = Py_ABS(Py_SIZE(operand1_long_object));
11849
+ Py_ssize_t i = Nuitka_LongGetDigitSize(operand1_long_object);
11849
11850
  r = false;
11850
11851
  while (--i >= 0) {
11851
- if (operand1_long_object->ob_digit[i] != (digit)Py_ABS(operand2)) {
11852
- r = operand1_long_object->ob_digit[i] < (digit)Py_ABS(operand2);
11853
- if (Py_SIZE(operand1_long_object) < 0) {
11852
+ if (Nuitka_LongGetDigitPointer(operand1_long_object)[i] != (digit)Py_ABS(operand2)) {
11853
+ r = Nuitka_LongGetDigitPointer(operand1_long_object)[i] < (digit)Py_ABS(operand2);
11854
+ if (Nuitka_LongIsNegative(operand1_long_object)) {
11854
11855
  r = !r;
11855
11856
  }
11856
11857
  break;
@@ -11881,7 +11882,7 @@ static PyObject *COMPARE_LT_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double opera
11881
11882
 
11882
11883
  // Convert to target type.
11883
11884
  PyObject *result = BOOL_FROM(r);
11884
- Py_INCREF(result);
11885
+ Py_INCREF_IMMORTAL(result);
11885
11886
  return result;
11886
11887
  }
11887
11888
  /* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
@@ -11909,3 +11910,18 @@ bool RICH_COMPARE_LT_CBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
11909
11910
 
11910
11911
  return COMPARE_LT_CBOOL_FLOAT_CFLOAT(operand1, operand2);
11911
11912
  }
11913
+
11914
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
11915
+ // integrates with CPython, but also works on its own.
11916
+ //
11917
+ // Licensed under the Apache License, Version 2.0 (the "License");
11918
+ // you may not use this file except in compliance with the License.
11919
+ // You may obtain a copy of the License at
11920
+ //
11921
+ // http://www.apache.org/licenses/LICENSE-2.0
11922
+ //
11923
+ // Unless required by applicable law or agreed to in writing, software
11924
+ // distributed under the License is distributed on an "AS IS" BASIS,
11925
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11926
+ // See the License for the specific language governing permissions and
11927
+ // limitations under the License.