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

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

Potentially problematic release.


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

Files changed (294) hide show
  1. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/METADATA +2 -1
  2. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/RECORD +294 -271
  3. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/WHEEL +1 -1
  4. nuitka/Builtins.py +31 -0
  5. nuitka/HardImportRegistry.py +8 -0
  6. nuitka/MainControl.py +9 -4
  7. nuitka/OptionParsing.py +105 -52
  8. nuitka/Options.py +73 -16
  9. nuitka/OutputDirectories.py +7 -2
  10. nuitka/PostProcessing.py +69 -38
  11. nuitka/Progress.py +16 -1
  12. nuitka/PythonVersions.py +2 -1
  13. nuitka/Serialization.py +4 -2
  14. nuitka/Tracing.py +69 -1
  15. nuitka/Version.py +2 -2
  16. nuitka/build/Backend.scons +45 -5
  17. nuitka/build/CCompilerVersion.scons +6 -0
  18. nuitka/build/Onefile.scons +6 -0
  19. nuitka/build/SconsCaching.py +12 -2
  20. nuitka/build/SconsCompilerSettings.py +17 -6
  21. nuitka/build/SconsInterface.py +1 -0
  22. nuitka/build/SconsUtils.py +5 -0
  23. nuitka/build/include/nuitka/allocator.h +124 -1
  24. nuitka/build/include/nuitka/calling.h +6 -6
  25. nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
  26. nuitka/build/include/nuitka/compiled_frame.h +2 -1
  27. nuitka/build/include/nuitka/constants.h +6 -0
  28. nuitka/build/include/nuitka/debug_settings.h +60 -0
  29. nuitka/build/include/nuitka/exceptions.h +264 -121
  30. nuitka/build/include/nuitka/helper/attributes.h +0 -4
  31. nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
  32. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  33. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  34. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  35. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  36. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  37. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  38. nuitka/build/include/nuitka/helper/dictionaries.h +65 -29
  39. nuitka/build/include/nuitka/helper/ints.h +86 -37
  40. nuitka/build/include/nuitka/helper/iterators.h +82 -34
  41. nuitka/build/include/nuitka/helper/operations.h +3 -0
  42. nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
  43. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  44. nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
  45. nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
  46. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
  47. nuitka/build/include/nuitka/helper/raising.h +47 -28
  48. nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
  49. nuitka/build/include/nuitka/helpers.h +12 -2
  50. nuitka/build/include/nuitka/prelude.h +35 -25
  51. nuitka/build/include/nuitka/printing.h +9 -7
  52. nuitka/build/include/nuitka/threading.h +15 -1
  53. nuitka/build/include/nuitka/type_aliases.h +3 -0
  54. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  55. nuitka/build/inline_copy/stubgen/six.py +998 -0
  56. nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
  57. nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
  58. nuitka/build/static_src/CompiledCellType.c +6 -4
  59. nuitka/build/static_src/CompiledCodeHelpers.c +104 -40
  60. nuitka/build/static_src/CompiledCoroutineType.c +40 -30
  61. nuitka/build/static_src/CompiledFrameType.c +110 -79
  62. nuitka/build/static_src/CompiledFunctionType.c +173 -151
  63. nuitka/build/static_src/CompiledGeneratorType.c +51 -49
  64. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +424 -46
  65. nuitka/build/static_src/CompiledMethodType.c +10 -13
  66. nuitka/build/static_src/HelpersAllocator.c +270 -32
  67. nuitka/build/static_src/HelpersAttributes.c +0 -21
  68. nuitka/build/static_src/HelpersBuiltin.c +22 -13
  69. nuitka/build/static_src/HelpersCalling.c +7 -7
  70. nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
  71. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  72. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  73. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  74. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  75. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  76. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  77. nuitka/build/static_src/HelpersComparisonEq.c +18 -4
  78. nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -0
  79. nuitka/build/static_src/HelpersComparisonGe.c +18 -4
  80. nuitka/build/static_src/HelpersComparisonGt.c +18 -4
  81. nuitka/build/static_src/HelpersComparisonLe.c +18 -4
  82. nuitka/build/static_src/HelpersComparisonLt.c +18 -4
  83. nuitka/build/static_src/HelpersComparisonNe.c +18 -4
  84. nuitka/build/static_src/HelpersConsole.c +34 -8
  85. nuitka/build/static_src/HelpersConstantsBlob.c +10 -4
  86. nuitka/build/static_src/HelpersDictionaries.c +181 -34
  87. nuitka/build/static_src/HelpersDictionariesGenerated.c +0 -106
  88. nuitka/build/static_src/HelpersExceptions.c +24 -50
  89. nuitka/build/static_src/HelpersFiles.c +79 -5
  90. nuitka/build/static_src/HelpersImport.c +13 -9
  91. nuitka/build/static_src/HelpersImportHard.c +23 -46
  92. nuitka/build/static_src/HelpersLists.c +98 -9
  93. nuitka/build/static_src/HelpersMatching.c +1 -1
  94. nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
  95. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
  96. nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
  97. nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
  98. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
  99. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
  100. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  101. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
  102. nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
  103. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
  104. nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
  105. nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
  106. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
  107. nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
  108. nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
  109. nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
  110. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
  111. nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
  112. nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
  113. nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
  114. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
  115. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
  116. nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
  117. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
  118. nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
  119. nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
  120. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
  121. nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
  122. nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
  123. nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
  124. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
  125. nuitka/build/static_src/HelpersProfiling.c +1 -1
  126. nuitka/build/static_src/HelpersRaising.c +255 -310
  127. nuitka/build/static_src/HelpersStrings.c +1 -1
  128. nuitka/build/static_src/HelpersTuples.c +1 -1
  129. nuitka/build/static_src/HelpersTypes.c +98 -2
  130. nuitka/build/static_src/MainProgram.c +117 -29
  131. nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
  132. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
  133. nuitka/build/static_src/OnefileBootstrap.c +6 -1
  134. nuitka/code_generation/AsyncgenCodes.py +2 -6
  135. nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
  136. nuitka/code_generation/BuiltinCodes.py +9 -1
  137. nuitka/code_generation/CallCodes.py +16 -16
  138. nuitka/code_generation/CodeGeneration.py +14 -2
  139. nuitka/code_generation/CodeHelperSelection.py +1 -1
  140. nuitka/code_generation/CodeHelpers.py +4 -1
  141. nuitka/code_generation/CodeObjectCodes.py +2 -2
  142. nuitka/code_generation/ComparisonCodes.py +13 -2
  143. nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
  144. nuitka/code_generation/Contexts.py +28 -16
  145. nuitka/code_generation/CoroutineCodes.py +2 -6
  146. nuitka/code_generation/DictCodes.py +3 -3
  147. nuitka/code_generation/ErrorCodes.py +34 -50
  148. nuitka/code_generation/ExceptionCodes.py +165 -96
  149. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
  150. nuitka/code_generation/FrameCodes.py +4 -11
  151. nuitka/code_generation/FunctionCodes.py +2 -6
  152. nuitka/code_generation/GeneratorCodes.py +2 -6
  153. nuitka/code_generation/GlobalConstants.py +8 -2
  154. nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
  155. nuitka/code_generation/IteratorCodes.py +67 -54
  156. nuitka/code_generation/LineNumberCodes.py +1 -3
  157. nuitka/code_generation/ModuleCodes.py +28 -4
  158. nuitka/code_generation/OperationCodes.py +51 -20
  159. nuitka/code_generation/PackageResourceCodes.py +37 -0
  160. nuitka/code_generation/RaisingCodes.py +164 -90
  161. nuitka/code_generation/Reports.py +13 -5
  162. nuitka/code_generation/ReturnCodes.py +2 -16
  163. nuitka/code_generation/TryCodes.py +12 -24
  164. nuitka/code_generation/TypeAliasCodes.py +48 -0
  165. nuitka/code_generation/VariableCodes.py +99 -40
  166. nuitka/code_generation/VariableDeclarations.py +8 -8
  167. nuitka/code_generation/YieldCodes.py +1 -1
  168. nuitka/code_generation/c_types/CTypeBases.py +10 -2
  169. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
  170. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
  171. nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
  172. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
  173. nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
  174. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
  175. nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
  176. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
  177. nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
  178. nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
  179. nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
  180. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
  181. nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
  182. nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
  183. nuitka/code_generation/templates/CodeTemplatesVariables.py +73 -0
  184. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
  185. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
  186. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +0 -105
  187. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
  188. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
  189. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  190. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
  191. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  192. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
  193. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
  194. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
  195. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
  196. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
  197. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
  198. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
  199. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
  200. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
  201. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
  202. nuitka/containers/Namedtuples.py +6 -0
  203. nuitka/containers/OrderedSets.py +105 -5
  204. nuitka/distutils/Build.py +14 -0
  205. nuitka/distutils/DistutilCommands.py +50 -10
  206. nuitka/finalizations/Finalization.py +3 -3
  207. nuitka/finalizations/FinalizeMarkups.py +10 -14
  208. nuitka/freezer/DependsExe.py +13 -3
  209. nuitka/freezer/DllDependenciesMacOS.py +18 -1
  210. nuitka/freezer/DllDependenciesWin32.py +26 -12
  211. nuitka/freezer/ImportDetection.py +3 -0
  212. nuitka/freezer/IncludedDataFiles.py +31 -8
  213. nuitka/freezer/IncludedEntryPoints.py +3 -2
  214. nuitka/freezer/Standalone.py +76 -18
  215. nuitka/importing/Importing.py +33 -6
  216. nuitka/importing/Recursion.py +12 -1
  217. nuitka/importing/StandardLibrary.py +57 -59
  218. nuitka/nodes/AsyncgenNodes.py +3 -6
  219. nuitka/nodes/BuiltinIteratorNodes.py +1 -1
  220. nuitka/nodes/BuiltinRefNodes.py +14 -30
  221. nuitka/nodes/ChildrenHavingMixins.py +439 -46
  222. nuitka/nodes/ConditionalNodes.py +3 -2
  223. nuitka/nodes/CoroutineNodes.py +3 -6
  224. nuitka/nodes/ExceptionNodes.py +102 -26
  225. nuitka/nodes/ExpressionBasesGenerated.py +288 -4
  226. nuitka/nodes/FrameNodes.py +22 -11
  227. nuitka/nodes/FunctionNodes.py +3 -3
  228. nuitka/nodes/GeneratorNodes.py +3 -6
  229. nuitka/nodes/HardImportNodesGenerated.py +182 -0
  230. nuitka/nodes/ImportNodes.py +2 -2
  231. nuitka/nodes/NodeBases.py +28 -1
  232. nuitka/nodes/NodeMakingHelpers.py +71 -50
  233. nuitka/nodes/OperatorNodesUnary.py +128 -3
  234. nuitka/nodes/OsSysNodes.py +37 -6
  235. nuitka/nodes/OutlineNodes.py +2 -2
  236. nuitka/nodes/StatementBasesGenerated.py +0 -2
  237. nuitka/nodes/StatementNodes.py +8 -7
  238. nuitka/nodes/SubscriptNodes.py +1 -1
  239. nuitka/nodes/TypeNodes.py +28 -1
  240. nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
  241. nuitka/nodes/shapes/ShapeMixins.py +17 -0
  242. nuitka/nodes/shapes/StandardShapes.py +53 -1
  243. nuitka/optimizations/BytecodeDemotion.py +2 -1
  244. nuitka/plugins/PluginBase.py +64 -22
  245. nuitka/plugins/Plugins.py +6 -3
  246. nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
  247. nuitka/plugins/standard/ImplicitImports.py +1 -13
  248. nuitka/plugins/standard/KivyPlugin.py +3 -12
  249. nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
  250. nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
  251. nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
  252. nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
  253. nuitka/plugins/standard/TkinterPlugin.py +0 -56
  254. nuitka/plugins/standard/TransformersPlugin.py +70 -275
  255. nuitka/plugins/standard/standard.nuitka-package.config.yml +510 -28
  256. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
  257. nuitka/reports/CompilationReportReader.py +12 -0
  258. nuitka/reports/Reports.py +11 -0
  259. nuitka/specs/BuiltinParameterSpecs.py +5 -1
  260. nuitka/specs/HardImportSpecs.py +7 -0
  261. nuitka/specs/ParameterSpecs.py +4 -4
  262. nuitka/tools/general/dll_report/__main__.py +10 -1
  263. nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
  264. nuitka/tools/specialize/CTypeDescriptions.py +158 -9
  265. nuitka/tools/specialize/SpecializeC.py +218 -56
  266. nuitka/tools/testing/Common.py +70 -63
  267. nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
  268. nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
  269. nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
  270. nuitka/tools/watch/AutoStage.py +1 -0
  271. nuitka/tree/Building.py +10 -37
  272. nuitka/tree/ComplexCallHelperFunctions.py +4 -0
  273. nuitka/tree/ReformulationAssertStatements.py +31 -14
  274. nuitka/tree/ReformulationAssignmentStatements.py +5 -1
  275. nuitka/tree/ReformulationClasses3.py +94 -19
  276. nuitka/tree/ReformulationDictionaryCreation.py +1 -0
  277. nuitka/tree/ReformulationFunctionStatements.py +1 -1
  278. nuitka/tree/ReformulationMatchStatements.py +3 -1
  279. nuitka/tree/ReformulationYieldExpressions.py +23 -5
  280. nuitka/utils/CommandLineOptions.py +27 -3
  281. nuitka/utils/Download.py +2 -2
  282. nuitka/utils/Execution.py +36 -31
  283. nuitka/utils/FileOperations.py +39 -54
  284. nuitka/utils/Importing.py +2 -14
  285. nuitka/utils/InlineCopies.py +52 -0
  286. nuitka/utils/InstalledPythons.py +9 -4
  287. nuitka/utils/Json.py +2 -2
  288. nuitka/utils/PackageResources.py +44 -0
  289. nuitka/utils/Utils.py +17 -0
  290. {Nuitka_winsvc-2.4.8.data → Nuitka_winsvc-2.5.1.data}/scripts/nuitka-run.cmd +0 -0
  291. {Nuitka_winsvc-2.4.8.data → Nuitka_winsvc-2.5.1.data}/scripts/nuitka.cmd +0 -0
  292. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/LICENSE.txt +0 -0
  293. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/entry_points.txt +0 -0
  294. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/top_level.txt +0 -0
@@ -54,47 +54,50 @@ def deriveInplaceFromBinaryOperations(operations_set):
54
54
  )
55
55
 
56
56
 
57
- def _makeTypeSemiOps(op_code, type_name, in_place=False):
58
- if in_place:
59
- yield "INPLACE_OPERATION_%s_%s_OBJECT" % (op_code, type_name)
60
- else:
61
- yield "BINARY_OPERATION_%s_OBJECT_OBJECT_%s" % (op_code, type_name)
62
- yield "BINARY_OPERATION_%s_OBJECT_%s_OBJECT" % (op_code, type_name)
63
-
64
-
65
- def _makeTypeOps(op_code, type_name, include_nbool, in_place=False):
66
- if in_place:
57
+ def _makeTypeSemiOps(op_code, type_name, result_types):
58
+ for result_type in result_types or (None,):
59
+ if result_type is None:
60
+ yield "INPLACE_OPERATION_%s_%s_OBJECT" % (op_code, type_name)
61
+ else:
62
+ yield "BINARY_OPERATION_%s_%s_OBJECT_%s" % (op_code, result_type, type_name)
63
+ yield "BINARY_OPERATION_%s_%s_%s_OBJECT" % (op_code, result_type, type_name)
64
+
65
+
66
+ def _makeTypeOps(op_code, type_name, result_types):
67
+ if result_types is None:
68
+ # Inplace has no result type.
67
69
  yield "INPLACE_OPERATION_%s_%s_%s" % (op_code, type_name, type_name)
68
70
  yield "INPLACE_OPERATION_%s_OBJECT_%s" % (op_code, type_name)
69
71
  yield "INPLACE_OPERATION_%s_%s_OBJECT" % (op_code, type_name)
70
72
  else:
71
- yield "BINARY_OPERATION_%s_OBJECT_%s_%s" % (op_code, type_name, type_name)
72
- yield "BINARY_OPERATION_%s_OBJECT_OBJECT_%s" % (op_code, type_name)
73
- yield "BINARY_OPERATION_%s_OBJECT_%s_OBJECT" % (op_code, type_name)
74
-
75
- if include_nbool and not in_place:
76
- for helper in _makeTypeOpsNbool(op_code, type_name):
77
- yield helper
73
+ for result_type in result_types:
74
+ yield "BINARY_OPERATION_%s_%s_%s_%s" % (
75
+ op_code,
76
+ result_type,
77
+ type_name,
78
+ type_name,
79
+ )
80
+ yield "BINARY_OPERATION_%s_%s_OBJECT_%s" % (op_code, result_type, type_name)
81
+ yield "BINARY_OPERATION_%s_%s_%s_OBJECT" % (op_code, result_type, type_name)
78
82
 
79
83
 
80
84
  def _makeTypeOpsNbool(op_code, type_name):
81
- yield "BINARY_OPERATION_%s_NBOOL_%s_%s" % (op_code, type_name, type_name)
82
- yield "BINARY_OPERATION_%s_NBOOL_OBJECT_%s" % (op_code, type_name)
83
- yield "BINARY_OPERATION_%s_NBOOL_%s_OBJECT" % (op_code, type_name)
85
+ return _makeTypeOps(op_code=op_code, type_name=type_name, result_types=("NBOOL",))
84
86
 
85
87
 
86
- def _isCommutativeOperation(op_code):
88
+ def isCommutativeOperation(op_code):
87
89
  return op_code in ("ADD", "MULT", "BITOR", "BITAND", "BITXOR")
88
90
 
89
91
 
90
- def _isCommutativeType(type_name):
91
- return type_name in ("INT", "LONG", "FLOAT", "CLONG", "DIGIT", "CFLOAT")
92
+ def isCommutativeType(type_name):
93
+ return type_name in ("INT", "LONG", "FLOAT", "CLONG", "DIGIT", "CFLOAT", "NILONG")
92
94
 
93
95
 
94
96
  _type_order = (
95
97
  "CLONG",
96
98
  "INT",
97
99
  "DIGIT",
100
+ "NILONG",
98
101
  "CFLOAT",
99
102
  "LONG",
100
103
  "FLOAT",
@@ -108,76 +111,61 @@ _type_order = (
108
111
  _no_inplace_target_types = ("CLONG", "DIGIT", "CFLOAT")
109
112
 
110
113
 
111
- def _makeFriendOps(op_code, include_nbool, in_place, *type_names):
112
- assert len(type_names) == len(set(type_names)), type_names
113
-
114
- type_names = tuple(
115
- sorted(type_names, key=lambda type_name: -_type_order.index(type_name))
114
+ def _makeFriendOps(op_code, friend_type_names, result_types):
115
+ friend_type_names = tuple(
116
+ sorted(friend_type_names, key=lambda type_name: -_type_order.index(type_name))
116
117
  )
117
118
 
118
- for type_name1 in type_names:
119
- for type_name2 in type_names[type_names.index(type_name1) + 1 :]:
120
- # These should be used with reversed arguments, and only have the
121
- # dominant type as the first argument.
122
- arg_swap = (
123
- _isCommutativeOperation(op_code)
124
- and not in_place
125
- and _isCommutativeType(type_name1)
126
- and _isCommutativeType(type_name2)
127
- )
128
-
129
- if in_place:
130
- if type_name1 not in _no_inplace_target_types:
131
- yield "INPLACE_OPERATION_%s_%s_%s" % (
132
- op_code,
133
- type_name1,
134
- type_name2,
135
- )
136
- else:
137
- yield "BINARY_OPERATION_%s_OBJECT_%s_%s" % (
138
- op_code,
139
- type_name1,
140
- type_name2,
119
+ for type_name1 in friend_type_names:
120
+ for type_name2 in friend_type_names[friend_type_names.index(type_name1) + 1 :]:
121
+ for result_type in result_types or (None,):
122
+ # These should be used with reversed arguments, and only have the
123
+ # dominant type as the first argument.
124
+ arg_swap = (
125
+ isCommutativeOperation(op_code)
126
+ and result_type is not None
127
+ and isCommutativeType(type_name1)
128
+ and isCommutativeType(type_name2)
141
129
  )
142
130
 
143
- if not arg_swap:
144
- if in_place:
145
- if type_name2 not in _no_inplace_target_types:
131
+ if result_type is None:
132
+ if type_name1 not in _no_inplace_target_types:
146
133
  yield "INPLACE_OPERATION_%s_%s_%s" % (
147
134
  op_code,
148
- type_name2,
149
135
  type_name1,
136
+ type_name2,
150
137
  )
151
138
  else:
152
- yield "BINARY_OPERATION_%s_OBJECT_%s_%s" % (
139
+ yield "BINARY_OPERATION_%s_%s_%s_%s" % (
153
140
  op_code,
154
- type_name2,
141
+ result_type,
155
142
  type_name1,
156
- )
157
-
158
- if include_nbool and not in_place:
159
- yield "BINARY_OPERATION_%s_NBOOL_%s_%s" % (
160
- op_code,
161
- type_name1,
162
- type_name2,
163
- )
164
-
165
- if not arg_swap:
166
- yield "BINARY_OPERATION_%s_NBOOL_%s_%s" % (
167
- op_code,
168
143
  type_name2,
169
- type_name1,
170
144
  )
171
145
 
146
+ if not arg_swap:
147
+ if result_type is None:
148
+ if type_name2 not in _no_inplace_target_types:
149
+ yield "INPLACE_OPERATION_%s_%s_%s" % (
150
+ op_code,
151
+ type_name2,
152
+ type_name1,
153
+ )
154
+ else:
155
+ yield "BINARY_OPERATION_%s_%s_%s_%s" % (
156
+ op_code,
157
+ result_type,
158
+ type_name2,
159
+ type_name1,
160
+ )
172
161
 
173
- def _makeDefaultOps(op_code, include_nbool, in_place=False):
174
- if in_place:
175
- yield "INPLACE_OPERATION_%s_OBJECT_OBJECT" % op_code
176
- else:
177
- yield "BINARY_OPERATION_%s_OBJECT_OBJECT_OBJECT" % op_code
178
162
 
179
- if include_nbool and not in_place:
180
- yield "BINARY_OPERATION_%s_NBOOL_OBJECT_OBJECT" % op_code
163
+ def _makeDefaultOps(op_code, result_types):
164
+ for result_type in result_types or (None,):
165
+ if result_type is None:
166
+ yield "INPLACE_OPERATION_%s_OBJECT_OBJECT" % op_code
167
+ else:
168
+ yield "BINARY_OPERATION_%s_%s_OBJECT_OBJECT" % (op_code, result_type)
181
169
 
182
170
 
183
171
  def _makeNonContainerMathOps(op_code):
@@ -187,43 +175,81 @@ def _makeNonContainerMathOps(op_code):
187
175
  if "SUB" in op_code and type_name == "SET":
188
176
  continue
189
177
 
190
- for value in _makeTypeOps(op_code, type_name, include_nbool=True):
178
+ for value in _makeTypeOps(
179
+ op_code, type_name, result_types=standard_result_types
180
+ ):
191
181
  yield value
192
182
 
193
183
 
194
- def _makeNumberOps(op_code, include_nbool, in_place):
184
+ def _makeNumberOps(op_code, result_types):
195
185
  return buildOrderedSet(
196
- _makeTypeOps(op_code, "INT", include_nbool=include_nbool, in_place=in_place),
197
- _makeTypeOps(op_code, "LONG", include_nbool=include_nbool, in_place=in_place),
198
- _makeTypeOps(op_code, "FLOAT", include_nbool=include_nbool, in_place=in_place),
186
+ _makeTypeOps(op_code=op_code, type_name="INT", result_types=result_types),
187
+ _makeTypeOps(op_code=op_code, type_name="LONG", result_types=result_types),
188
+ _makeTypeOps(op_code=op_code, type_name="FLOAT", result_types=result_types),
199
189
  # These are friends naturally, they all add with another.
200
- _makeFriendOps(op_code, include_nbool, in_place, "INT", "LONG", "FLOAT"),
190
+ _makeFriendOps(
191
+ op_code=op_code,
192
+ friend_type_names=("INT", "LONG", "FLOAT"),
193
+ result_types=result_types,
194
+ ),
201
195
  # Special operations, currently used with constant values mostly.
202
- _makeFriendOps(op_code, include_nbool, in_place, "INT", "CLONG"),
196
+ _makeFriendOps(
197
+ op_code, friend_type_names=("INT", "CLONG"), result_types=result_types
198
+ ),
203
199
  (
204
- _makeFriendOps(op_code, include_nbool, in_place, "LONG", "DIGIT")
200
+ _makeFriendOps(
201
+ op_code, friend_type_names=("LONG", "DIGIT"), result_types=result_types
202
+ )
205
203
  if op_code in ("ADD", "SUB") # TODO: Add more
206
204
  else ()
207
205
  ),
208
- _makeFriendOps(op_code, include_nbool, in_place, "FLOAT", "CFLOAT"),
206
+ (
207
+ _makeFriendOps(
208
+ op_code, friend_type_names=("LONG", "CLONG"), result_types=result_types
209
+ )
210
+ if op_code in ("ADD", "SUB") # TODO: Add more
211
+ else ()
212
+ ),
213
+ _makeFriendOps(
214
+ op_code, friend_type_names=("FLOAT", "CFLOAT"), result_types=result_types
215
+ ),
216
+ (
217
+ _makeFriendOps(
218
+ op_code,
219
+ friend_type_names=("NILONG", "NILONG", "DIGIT"),
220
+ result_types=("NILONG",),
221
+ )
222
+ if op_code in ("ADD", "SUB") and result_types is not None
223
+ else ()
224
+ ),
209
225
  )
210
226
 
211
227
 
212
228
  def _makeAddOps(in_place):
213
229
  return buildOrderedSet(
214
- _makeNumberOps("ADD", include_nbool=True, in_place=in_place),
215
- _makeTypeOps("ADD", "STR", include_nbool=False, in_place=in_place),
216
- _makeTypeOps("ADD", "UNICODE", include_nbool=False, in_place=in_place),
217
- _makeTypeOps("ADD", "BYTES", include_nbool=False, in_place=in_place),
218
- _makeTypeOps("ADD", "TUPLE", include_nbool=False, in_place=in_place),
219
- _makeTypeOps("ADD", "LIST", include_nbool=True, in_place=in_place),
230
+ _makeNumberOps("ADD", result_types=None if in_place else standard_result_types),
231
+ _makeTypeOps("ADD", "STR", result_types=None if in_place else ("OBJECT",)),
232
+ _makeTypeOps("ADD", "UNICODE", result_types=None if in_place else ("OBJECT",)),
233
+ _makeTypeOps("ADD", "BYTES", result_types=None if in_place else ("OBJECT",)),
234
+ _makeTypeOps("ADD", "TUPLE", result_types=None if in_place else ("OBJECT",)),
235
+ _makeTypeOps(
236
+ "ADD", "LIST", result_types=None if in_place else standard_result_types
237
+ ),
220
238
  # These are friends too.
221
- _makeFriendOps("ADD", True, in_place, "STR", "UNICODE"),
239
+ _makeFriendOps(
240
+ "ADD",
241
+ friend_type_names=("STR", "UNICODE"),
242
+ result_types=None if in_place else standard_result_types,
243
+ ),
222
244
  # Default implementation.
223
- _makeDefaultOps("ADD", include_nbool=True, in_place=in_place),
245
+ _makeDefaultOps(
246
+ "ADD", result_types=None if in_place else standard_result_types
247
+ ),
224
248
  )
225
249
 
226
250
 
251
+ standard_result_types = ("OBJECT", "NBOOL")
252
+
227
253
  specialized_add_helpers_set = _makeAddOps(in_place=False)
228
254
 
229
255
  nonspecialized_add_helpers_set = buildOrderedSet(
@@ -234,42 +260,86 @@ nonspecialized_add_helpers_set = buildOrderedSet(
234
260
  )
235
261
 
236
262
 
237
- def makeSubOps(in_place):
263
+ def makeSubOps(result_types):
238
264
  return buildOrderedSet(
239
- _makeNumberOps("SUB", include_nbool=False, in_place=in_place),
240
- _makeDefaultOps("SUB", include_nbool=False, in_place=in_place),
265
+ _makeNumberOps("SUB", result_types=result_types),
266
+ _makeDefaultOps("SUB", result_types=result_types),
241
267
  )
242
268
 
243
269
 
244
- specialized_sub_helpers_set = makeSubOps(in_place=False)
270
+ specialized_sub_helpers_set = makeSubOps(result_types=("OBJECT",))
245
271
 
246
272
  # These made no sense to specialize for, nothing to gain.
247
273
  nonspecialized_sub_helpers_set = buildOrderedSet(
248
- _makeTypeOps("SUB", "STR", include_nbool=True),
249
- _makeTypeOps("SUB", "UNICODE", include_nbool=True),
250
- _makeTypeOps("SUB", "BYTES", include_nbool=True),
274
+ _makeTypeOps("SUB", "STR", result_types=standard_result_types),
275
+ _makeTypeOps("SUB", "UNICODE", result_types=standard_result_types),
276
+ _makeTypeOps("SUB", "BYTES", result_types=standard_result_types),
251
277
  _makeNonContainerMathOps("SUB"),
252
278
  )
253
279
 
254
280
 
255
281
  def _makeMultOps(in_place):
256
282
  return buildOrderedSet(
257
- _makeNumberOps("MULT", include_nbool=True, in_place=in_place),
258
- _makeFriendOps("MULT", False, in_place, "INT", "STR"),
259
- _makeFriendOps("MULT", False, in_place, "INT", "UNICODE"),
260
- _makeFriendOps("MULT", False, in_place, "INT", "TUPLE"),
261
- _makeFriendOps("MULT", False, in_place, "INT", "LIST"),
262
- _makeFriendOps("MULT", False, in_place, "LONG", "UNICODE"),
263
- _makeFriendOps("MULT", False, in_place, "LONG", "BYTES"),
264
- _makeFriendOps("MULT", False, in_place, "LONG", "TUPLE"),
265
- _makeFriendOps("MULT", False, in_place, "LONG", "LIST"),
266
- _makeTypeSemiOps("MULT", "STR", in_place=in_place),
267
- _makeTypeSemiOps("MULT", "UNICODE", in_place=in_place),
268
- _makeTypeSemiOps("MULT", "BYTES", in_place=in_place),
269
- _makeTypeSemiOps("MULT", "TUPLE", in_place=in_place),
270
- _makeTypeSemiOps("MULT", "LIST", in_place=in_place),
283
+ _makeNumberOps(
284
+ "MULT", result_types=None if in_place else standard_result_types
285
+ ),
286
+ _makeFriendOps(
287
+ "MULT",
288
+ friend_type_names=("INT", "STR"),
289
+ result_types=None if in_place else ("OBJECT",),
290
+ ),
291
+ _makeFriendOps(
292
+ "MULT",
293
+ friend_type_names=("INT", "UNICODE"),
294
+ result_types=None if in_place else ("OBJECT",),
295
+ ),
296
+ _makeFriendOps(
297
+ "MULT",
298
+ friend_type_names=("INT", "TUPLE"),
299
+ result_types=None if in_place else ("OBJECT",),
300
+ ),
301
+ _makeFriendOps(
302
+ "MULT",
303
+ friend_type_names=("INT", "LIST"),
304
+ result_types=None if in_place else ("OBJECT",),
305
+ ),
306
+ _makeFriendOps(
307
+ "MULT",
308
+ friend_type_names=("LONG", "UNICODE"),
309
+ result_types=None if in_place else ("OBJECT",),
310
+ ),
311
+ _makeFriendOps(
312
+ "MULT",
313
+ friend_type_names=("LONG", "BYTES"),
314
+ result_types=None if in_place else ("OBJECT",),
315
+ ),
316
+ _makeFriendOps(
317
+ "MULT",
318
+ friend_type_names=("LONG", "TUPLE"),
319
+ result_types=None if in_place else ("OBJECT",),
320
+ ),
321
+ _makeFriendOps(
322
+ "MULT",
323
+ friend_type_names=("LONG", "LIST"),
324
+ result_types=None if in_place else ("OBJECT",),
325
+ ),
326
+ _makeTypeSemiOps("MULT", "STR", result_types=None if in_place else ("OBJECT",)),
327
+ _makeTypeSemiOps(
328
+ "MULT", "UNICODE", result_types=None if in_place else ("OBJECT",)
329
+ ),
330
+ _makeTypeSemiOps(
331
+ "MULT", "BYTES", result_types=None if in_place else ("OBJECT",)
332
+ ),
333
+ _makeTypeSemiOps(
334
+ "MULT", "TUPLE", result_types=None if in_place else ("OBJECT",)
335
+ ),
336
+ _makeTypeSemiOps(
337
+ "MULT", "LIST", result_types=None if in_place else ("OBJECT",)
338
+ ),
271
339
  # These are friends naturally, they all mul with another
272
- _makeDefaultOps("MULT", include_nbool=True, in_place=in_place),
340
+ _makeDefaultOps(
341
+ "MULT", result_types=None if in_place else standard_result_types
342
+ ),
273
343
  )
274
344
 
275
345
 
@@ -279,29 +349,29 @@ specialized_mult_helpers_set = _makeMultOps(in_place=False)
279
349
  nonspecialized_mult_helpers_set = None
280
350
 
281
351
 
282
- def _makeDivOps(op_code, in_place):
352
+ def _makeDivOps(op_code, result_types):
283
353
  return buildOrderedSet(
284
- _makeNumberOps(op_code, include_nbool=False, in_place=in_place),
285
- _makeDefaultOps(op_code, include_nbool=False, in_place=in_place),
354
+ _makeNumberOps(op_code, result_types=result_types),
355
+ _makeDefaultOps(op_code, result_types=result_types),
286
356
  )
287
357
 
288
358
 
289
- specialized_truediv_helpers_set = _makeDivOps("TRUEDIV", in_place=False)
359
+ specialized_truediv_helpers_set = _makeDivOps("TRUEDIV", result_types=("OBJECT",))
290
360
 
291
361
  nonspecialized_truediv_helpers_set = buildOrderedSet(
292
- _makeTypeOps("TRUEDIV", "UNICODE", include_nbool=True),
293
- _makeTypeOps("TRUEDIV", "STR", include_nbool=True),
294
- _makeTypeOps("TRUEDIV", "BYTES", include_nbool=True),
362
+ _makeTypeOps("TRUEDIV", "UNICODE", result_types=standard_result_types),
363
+ _makeTypeOps("TRUEDIV", "STR", result_types=standard_result_types),
364
+ _makeTypeOps("TRUEDIV", "BYTES", result_types=standard_result_types),
295
365
  _makeNonContainerMathOps("TRUEDIV"),
296
366
  )
297
367
 
298
- specialized_olddiv_helpers_set = _makeDivOps("OLDDIV", in_place=False)
368
+ specialized_olddiv_helpers_set = _makeDivOps("OLDDIV", result_types=("OBJECT",))
299
369
 
300
370
  nonspecialized_olddiv_helpers_set = OrderedSet(
301
371
  helper.replace("TRUEDIV", "OLDDIV") for helper in nonspecialized_truediv_helpers_set
302
372
  )
303
373
 
304
- specialized_floordiv_helpers_set = _makeDivOps("FLOORDIV", in_place=False)
374
+ specialized_floordiv_helpers_set = _makeDivOps("FLOORDIV", result_types=("OBJECT",))
305
375
 
306
376
  nonspecialized_floordiv_helpers_set = OrderedSet(
307
377
  helper.replace("TRUEDIV", "FLOORDIV")
@@ -340,14 +410,20 @@ def _makeModOps(in_place):
340
410
  )
341
411
 
342
412
  return buildOrderedSet(
343
- _makeNumberOps("MOD", include_nbool=True, in_place=in_place),
413
+ _makeNumberOps("MOD", result_types=None if in_place else standard_result_types),
344
414
  # These are friends naturally, they mod with another
345
- _makeFriendOps("MOD", True, in_place, "INT", "LONG", "FLOAT"),
415
+ _makeFriendOps(
416
+ "MOD",
417
+ friend_type_names=("INT", "LONG", "FLOAT"),
418
+ result_types=None if in_place else standard_result_types,
419
+ ),
346
420
  # String interpolation:
347
421
  _makeFormatOps(str_type_name="STR"),
348
422
  _makeFormatOps(str_type_name="UNICODE"),
349
423
  _makeFormatOps(str_type_name="BYTES"),
350
- _makeDefaultOps("MOD", include_nbool=True, in_place=in_place),
424
+ _makeDefaultOps(
425
+ "MOD", result_types=None if in_place else standard_result_types
426
+ ),
351
427
  )
352
428
 
353
429
 
@@ -390,23 +466,37 @@ nonspecialized_imod_helpers_set = deriveInplaceFromBinaryOperations(
390
466
 
391
467
  def _makeBitOps(op_name, in_place):
392
468
  return buildOrderedSet(
393
- _makeTypeOps(op_name, "LONG", include_nbool=True, in_place=in_place),
394
- _makeTypeOps(op_name, "INT", include_nbool=True, in_place=in_place),
395
- _makeFriendOps(op_name, True, in_place, "INT", "CLONG"),
396
- _makeFriendOps(op_name, True, in_place, "INT", "LONG"),
397
- _makeTypeOps(op_name, "SET", include_nbool=False, in_place=in_place),
398
- _makeDefaultOps(op_name, include_nbool=True, in_place=in_place),
469
+ _makeTypeOps(
470
+ op_name, "LONG", result_types=None if in_place else standard_result_types
471
+ ),
472
+ _makeTypeOps(
473
+ op_name, "INT", result_types=None if in_place else standard_result_types
474
+ ),
475
+ _makeFriendOps(
476
+ op_name,
477
+ friend_type_names=("INT", "CLONG"),
478
+ result_types=None if in_place else standard_result_types,
479
+ ),
480
+ _makeFriendOps(
481
+ op_name,
482
+ friend_type_names=("INT", "LONG"),
483
+ result_types=None if in_place else standard_result_types,
484
+ ),
485
+ _makeTypeOps(op_name, "SET", result_types=None if in_place else ("OBJECT",)),
486
+ _makeDefaultOps(
487
+ op_name, result_types=None if in_place else standard_result_types
488
+ ),
399
489
  )
400
490
 
401
491
 
402
492
  specialized_bitor_helpers_set = _makeBitOps("BITOR", in_place=False)
403
493
 
404
494
  nonspecialized_bitor_helpers_set = buildOrderedSet(
405
- _makeTypeOps("BITOR", "FLOAT", include_nbool=True),
495
+ _makeTypeOps("BITOR", "FLOAT", result_types=standard_result_types),
406
496
  _makeNonContainerMathOps("BITOR"),
407
- _makeTypeOps("BITOR", "UNICODE", include_nbool=True),
408
- _makeTypeOps("BITOR", "STR", include_nbool=True),
409
- _makeTypeOps("BITOR", "BYTES", include_nbool=True),
497
+ _makeTypeOps("BITOR", "UNICODE", result_types=standard_result_types),
498
+ _makeTypeOps("BITOR", "STR", result_types=standard_result_types),
499
+ _makeTypeOps("BITOR", "BYTES", result_types=standard_result_types),
410
500
  )
411
501
 
412
502
  specialized_bitand_helpers_set = _makeBitOps("BITAND", in_place=False)
@@ -422,17 +512,27 @@ nonspecialized_bitxor_helpers_set = OrderedSet(
422
512
 
423
513
  def _makeShiftOps(op_name, in_place):
424
514
  return buildOrderedSet(
425
- _makeTypeOps(op_name, "LONG", include_nbool=True, in_place=in_place),
426
- _makeTypeOps(op_name, "INT", include_nbool=True, in_place=in_place),
427
- _makeFriendOps(op_name, True, in_place, "INT", "LONG"),
428
- _makeDefaultOps(op_name, include_nbool=True, in_place=in_place),
515
+ _makeTypeOps(
516
+ op_name, "LONG", result_types=None if in_place else standard_result_types
517
+ ),
518
+ _makeTypeOps(
519
+ op_name, "INT", result_types=None if in_place else standard_result_types
520
+ ),
521
+ _makeFriendOps(
522
+ op_name,
523
+ friend_type_names=("INT", "LONG"),
524
+ result_types=None if in_place else standard_result_types,
525
+ ),
526
+ _makeDefaultOps(
527
+ op_name, result_types=None if in_place else standard_result_types
528
+ ),
429
529
  )
430
530
 
431
531
 
432
532
  specialized_lshift_helpers_set = _makeShiftOps("LSHIFT", in_place=False)
433
533
 
434
534
  nonspecialized_lshift_helpers_set = buildOrderedSet(
435
- _makeTypeOps("LSHIFT", "FLOAT", include_nbool=True),
535
+ _makeTypeOps("LSHIFT", "FLOAT", result_types=standard_result_types),
436
536
  _makeNonContainerMathOps("LSHIFT"),
437
537
  )
438
538
  specialized_rshift_helpers_set = _makeShiftOps("RSHIFT", in_place=False)
@@ -444,11 +544,13 @@ nonspecialized_rshift_helpers_set = OrderedSet(
444
544
 
445
545
 
446
546
  specialized_pow_helpers_set = buildOrderedSet(
447
- _makeTypeOps("POW", "FLOAT", include_nbool=False),
448
- _makeTypeOps("POW", "LONG", include_nbool=False),
449
- _makeTypeOps("POW", "INT", include_nbool=False),
450
- _makeFriendOps("POW", False, False, "INT", "LONG", "FLOAT"),
451
- _makeDefaultOps("POW", include_nbool=True),
547
+ _makeTypeOps("POW", "FLOAT", result_types=("OBJECT",)),
548
+ _makeTypeOps("POW", "LONG", result_types=("OBJECT",)),
549
+ _makeTypeOps("POW", "INT", result_types=("OBJECT",)),
550
+ _makeFriendOps(
551
+ "POW", friend_type_names=("INT", "LONG", "FLOAT"), result_types=("OBJECT",)
552
+ ),
553
+ _makeDefaultOps("POW", result_types=standard_result_types),
452
554
  (
453
555
  # Float is used by other types for ** operations.
454
556
  # TODO: Enable these later.
@@ -457,39 +559,39 @@ specialized_pow_helpers_set = buildOrderedSet(
457
559
  ),
458
560
  )
459
561
  nonspecialized_pow_helpers_set = buildOrderedSet(
460
- _makeTypeOps("POW", "STR", include_nbool=True),
461
- _makeTypeOps("POW", "UNICODE", include_nbool=True),
462
- _makeTypeOps("POW", "BYTES", include_nbool=True),
562
+ _makeTypeOps("POW", "STR", result_types=standard_result_types),
563
+ _makeTypeOps("POW", "UNICODE", result_types=standard_result_types),
564
+ _makeTypeOps("POW", "BYTES", result_types=standard_result_types),
463
565
  _makeNonContainerMathOps("POW"),
464
566
  )
465
567
 
466
568
 
467
- specialized_divmod_helpers_set = _makeDivOps("DIVMOD", in_place=False)
569
+ specialized_divmod_helpers_set = _makeDivOps("DIVMOD", result_types=("OBJECT",))
468
570
 
469
571
  nonspecialized_divmod_helpers_set = buildOrderedSet(
470
572
  _makeTypeOpsNbool("DIVMOD", "INT"),
471
573
  _makeTypeOpsNbool("DIVMOD", "LONG"),
472
574
  _makeTypeOpsNbool("DIVMOD", "FLOAT"),
473
- _makeTypeOps("DIVMOD", "UNICODE", include_nbool=True),
474
- _makeTypeOps("DIVMOD", "STR", include_nbool=True),
475
- _makeTypeOps("DIVMOD", "BYTES", include_nbool=True),
575
+ _makeTypeOps("DIVMOD", "UNICODE", result_types=standard_result_types),
576
+ _makeTypeOps("DIVMOD", "STR", result_types=standard_result_types),
577
+ _makeTypeOps("DIVMOD", "BYTES", result_types=standard_result_types),
476
578
  _makeNonContainerMathOps("DIVMOD"),
477
579
  )
478
580
 
479
581
  specialized_matmult_helpers_set = buildOrderedSet(
480
- _makeTypeOps("MATMULT", "LONG", include_nbool=False),
481
- _makeTypeOps("MATMULT", "FLOAT", include_nbool=False),
482
- _makeDefaultOps("MATMULT", include_nbool=False),
582
+ _makeTypeOps("MATMULT", "LONG", result_types=("OBJECT",)),
583
+ _makeTypeOps("MATMULT", "FLOAT", result_types=("OBJECT",)),
584
+ _makeDefaultOps("MATMULT", result_types=("OBJECT",)),
483
585
  )
484
586
 
485
587
  nonspecialized_matmult_helpers_set = buildOrderedSet(
486
588
  _makeTypeOpsNbool("MATMULT", "LONG"),
487
589
  _makeTypeOpsNbool("MATMULT", "FLOAT"),
488
- _makeTypeOps("MATMULT", "TUPLE", include_nbool=True),
489
- _makeTypeOps("MATMULT", "LIST", include_nbool=True),
490
- _makeTypeOps("MATMULT", "DICT", include_nbool=True),
491
- _makeTypeOps("MATMULT", "BYTES", include_nbool=True),
492
- _makeTypeOps("MATMULT", "UNICODE", include_nbool=True),
590
+ _makeTypeOps("MATMULT", "TUPLE", result_types=standard_result_types),
591
+ _makeTypeOps("MATMULT", "LIST", result_types=standard_result_types),
592
+ _makeTypeOps("MATMULT", "DICT", result_types=standard_result_types),
593
+ _makeTypeOps("MATMULT", "BYTES", result_types=standard_result_types),
594
+ _makeTypeOps("MATMULT", "UNICODE", result_types=standard_result_types),
493
595
  )
494
596
 
495
597
  specialized_iadd_helpers_set = buildOrderedSet(
@@ -509,7 +611,7 @@ nonspecialized_iadd_helpers_set = buildOrderedSet(
509
611
  ),
510
612
  )
511
613
 
512
- specialized_isub_helpers_set = makeSubOps(in_place=True)
614
+ specialized_isub_helpers_set = makeSubOps(result_types=None)
513
615
 
514
616
  nonspecialized_isub_helpers_set = deriveInplaceFromBinaryOperations(
515
617
  nonspecialized_sub_helpers_set
@@ -555,19 +657,19 @@ nonspecialized_irshift_helpers_set = deriveInplaceFromBinaryOperations(
555
657
  nonspecialized_rshift_helpers_set
556
658
  )
557
659
 
558
- specialized_ifloordiv_helpers_set = _makeDivOps("FLOORDIV", in_place=True)
660
+ specialized_ifloordiv_helpers_set = _makeDivOps("FLOORDIV", result_types=None)
559
661
 
560
662
  nonspecialized_ifloordiv_helpers_set = deriveInplaceFromBinaryOperations(
561
663
  nonspecialized_floordiv_helpers_set
562
664
  )
563
665
 
564
- specialized_itruediv_helpers_set = _makeDivOps("TRUEDIV", in_place=True)
666
+ specialized_itruediv_helpers_set = _makeDivOps("TRUEDIV", result_types=None)
565
667
 
566
668
  nonspecialized_itruediv_helpers_set = deriveInplaceFromBinaryOperations(
567
669
  nonspecialized_truediv_helpers_set
568
670
  )
569
671
 
570
- specialized_iolddiv_helpers_set = _makeDivOps("OLDDIV", in_place=True)
672
+ specialized_iolddiv_helpers_set = _makeDivOps("OLDDIV", result_types=None)
571
673
 
572
674
  nonspecialized_iolddiv_helpers_set = deriveInplaceFromBinaryOperations(
573
675
  nonspecialized_olddiv_helpers_set