Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__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.
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +31 -0
- nuitka/HardImportRegistry.py +8 -0
- nuitka/MainControl.py +9 -4
- nuitka/OptionParsing.py +108 -54
- nuitka/Options.py +69 -13
- nuitka/OutputDirectories.py +7 -2
- nuitka/PostProcessing.py +69 -38
- nuitka/Progress.py +16 -1
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +4 -2
- nuitka/Tracing.py +69 -1
- nuitka/Version.py +2 -2
- nuitka/build/Backend.scons +45 -5
- nuitka/build/CCompilerVersion.scons +6 -0
- nuitka/build/Onefile.scons +6 -0
- nuitka/build/SconsCaching.py +4 -0
- nuitka/build/SconsCompilerSettings.py +14 -3
- nuitka/build/SconsInterface.py +3 -0
- nuitka/build/SconsUtils.py +5 -0
- nuitka/build/include/nuitka/allocator.h +124 -1
- nuitka/build/include/nuitka/calling.h +6 -6
- nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
- nuitka/build/include/nuitka/compiled_frame.h +2 -1
- nuitka/build/include/nuitka/constants.h +8 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/exceptions.h +264 -121
- nuitka/build/include/nuitka/helper/attributes.h +0 -4
- nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
- nuitka/build/include/nuitka/helper/ints.h +86 -37
- nuitka/build/include/nuitka/helper/iterators.h +82 -34
- nuitka/build/include/nuitka/helper/operations.h +3 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
- nuitka/build/include/nuitka/helper/raising.h +47 -28
- nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
- nuitka/build/include/nuitka/helper/tuples.h +12 -0
- nuitka/build/include/nuitka/helpers.h +12 -2
- nuitka/build/include/nuitka/prelude.h +36 -25
- nuitka/build/include/nuitka/printing.h +9 -7
- nuitka/build/include/nuitka/threading.h +15 -1
- nuitka/build/include/nuitka/type_aliases.h +3 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
- nuitka/build/static_src/CompiledCellType.c +6 -4
- nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
- nuitka/build/static_src/CompiledCoroutineType.c +41 -31
- nuitka/build/static_src/CompiledFrameType.c +110 -79
- nuitka/build/static_src/CompiledFunctionType.c +173 -151
- nuitka/build/static_src/CompiledGeneratorType.c +51 -49
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
- nuitka/build/static_src/CompiledMethodType.c +6 -12
- nuitka/build/static_src/HelpersAllocator.c +266 -28
- nuitka/build/static_src/HelpersAttributes.c +0 -21
- nuitka/build/static_src/HelpersBuiltin.c +23 -14
- nuitka/build/static_src/HelpersCalling.c +7 -7
- nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +18 -4
- nuitka/build/static_src/HelpersComparisonGe.c +18 -4
- nuitka/build/static_src/HelpersComparisonGt.c +18 -4
- nuitka/build/static_src/HelpersComparisonLe.c +18 -4
- nuitka/build/static_src/HelpersComparisonLt.c +18 -4
- nuitka/build/static_src/HelpersComparisonNe.c +18 -4
- nuitka/build/static_src/HelpersConsole.c +34 -8
- nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
- nuitka/build/static_src/HelpersDeepcopy.c +1 -0
- nuitka/build/static_src/HelpersDictionaries.c +195 -36
- nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
- nuitka/build/static_src/HelpersExceptions.c +24 -50
- nuitka/build/static_src/HelpersFiles.c +79 -5
- nuitka/build/static_src/HelpersImport.c +13 -9
- nuitka/build/static_src/HelpersImportHard.c +23 -46
- nuitka/build/static_src/HelpersLists.c +98 -9
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
- nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
- nuitka/build/static_src/HelpersProfiling.c +1 -1
- nuitka/build/static_src/HelpersRaising.c +255 -310
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +2 -2
- nuitka/build/static_src/HelpersTypes.c +98 -2
- nuitka/build/static_src/MainProgram.c +132 -28
- nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
- nuitka/build/static_src/OnefileBootstrap.c +6 -1
- nuitka/code_generation/AsyncgenCodes.py +2 -6
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
- nuitka/code_generation/BuiltinCodes.py +9 -1
- nuitka/code_generation/CallCodes.py +16 -16
- nuitka/code_generation/CodeGeneration.py +14 -2
- nuitka/code_generation/CodeHelperSelection.py +1 -1
- nuitka/code_generation/CodeHelpers.py +4 -1
- nuitka/code_generation/CodeObjectCodes.py +2 -2
- nuitka/code_generation/ComparisonCodes.py +13 -2
- nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
- nuitka/code_generation/Contexts.py +28 -16
- nuitka/code_generation/CoroutineCodes.py +2 -6
- nuitka/code_generation/DictCodes.py +3 -3
- nuitka/code_generation/ErrorCodes.py +34 -50
- nuitka/code_generation/ExceptionCodes.py +165 -96
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
- nuitka/code_generation/FrameCodes.py +4 -11
- nuitka/code_generation/FunctionCodes.py +2 -6
- nuitka/code_generation/GeneratorCodes.py +2 -6
- nuitka/code_generation/GlobalConstants.py +8 -2
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/IteratorCodes.py +67 -54
- nuitka/code_generation/LineNumberCodes.py +1 -3
- nuitka/code_generation/ModuleCodes.py +28 -4
- nuitka/code_generation/OperationCodes.py +51 -20
- nuitka/code_generation/PackageResourceCodes.py +37 -0
- nuitka/code_generation/RaisingCodes.py +164 -90
- nuitka/code_generation/Reports.py +13 -5
- nuitka/code_generation/ReturnCodes.py +2 -16
- nuitka/code_generation/TryCodes.py +12 -24
- nuitka/code_generation/TypeAliasCodes.py +48 -0
- nuitka/code_generation/VariableCodes.py +99 -40
- nuitka/code_generation/VariableDeclarations.py +8 -8
- nuitka/code_generation/YieldCodes.py +1 -1
- nuitka/code_generation/c_types/CTypeBases.py +10 -2
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
- nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
- nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
- nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
- nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
- nuitka/containers/Namedtuples.py +6 -0
- nuitka/containers/OrderedSets.py +105 -5
- nuitka/distutils/Build.py +14 -0
- nuitka/distutils/DistutilCommands.py +50 -10
- nuitka/finalizations/Finalization.py +3 -3
- nuitka/finalizations/FinalizeMarkups.py +10 -14
- nuitka/freezer/DependsExe.py +5 -2
- nuitka/freezer/DllDependenciesMacOS.py +18 -1
- nuitka/freezer/DllDependenciesWin32.py +26 -12
- nuitka/freezer/ImportDetection.py +6 -0
- nuitka/freezer/IncludedDataFiles.py +37 -6
- nuitka/freezer/Onefile.py +1 -0
- nuitka/freezer/Standalone.py +72 -18
- nuitka/importing/Importing.py +33 -6
- nuitka/importing/Recursion.py +5 -2
- nuitka/importing/StandardLibrary.py +57 -59
- nuitka/nodes/AsyncgenNodes.py +3 -6
- nuitka/nodes/BuiltinIteratorNodes.py +2 -2
- nuitka/nodes/BuiltinRefNodes.py +14 -30
- nuitka/nodes/ChildrenHavingMixins.py +439 -46
- nuitka/nodes/ConditionalNodes.py +3 -2
- nuitka/nodes/CoroutineNodes.py +3 -6
- nuitka/nodes/DictionaryNodes.py +1 -1
- nuitka/nodes/ExceptionNodes.py +102 -26
- nuitka/nodes/ExpressionBasesGenerated.py +288 -4
- nuitka/nodes/FrameNodes.py +22 -11
- nuitka/nodes/FunctionNodes.py +3 -3
- nuitka/nodes/GeneratorNodes.py +3 -6
- nuitka/nodes/HardImportNodesGenerated.py +182 -0
- nuitka/nodes/ImportNodes.py +2 -2
- nuitka/nodes/NodeBases.py +28 -1
- nuitka/nodes/NodeMakingHelpers.py +71 -50
- nuitka/nodes/OperatorNodesUnary.py +128 -3
- nuitka/nodes/OsSysNodes.py +37 -6
- nuitka/nodes/OutlineNodes.py +2 -2
- nuitka/nodes/StatementBasesGenerated.py +0 -2
- nuitka/nodes/StatementNodes.py +8 -7
- nuitka/nodes/SubscriptNodes.py +1 -1
- nuitka/nodes/TypeNodes.py +28 -1
- nuitka/nodes/VariableAssignNodes.py +2 -1
- nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +18 -0
- nuitka/nodes/shapes/StandardShapes.py +47 -44
- nuitka/optimizations/BytecodeDemotion.py +2 -1
- nuitka/plugins/PluginBase.py +64 -22
- nuitka/plugins/Plugins.py +16 -3
- nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
- nuitka/plugins/standard/DllFilesPlugin.py +78 -2
- nuitka/plugins/standard/ImplicitImports.py +5 -15
- nuitka/plugins/standard/KivyPlugin.py +3 -12
- nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
- nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
- nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
- nuitka/plugins/standard/TkinterPlugin.py +23 -3
- nuitka/plugins/standard/TransformersPlugin.py +70 -275
- nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
- nuitka/reports/CompilationReportReader.py +12 -0
- nuitka/reports/Reports.py +11 -0
- nuitka/specs/BuiltinParameterSpecs.py +5 -1
- nuitka/specs/HardImportSpecs.py +7 -0
- nuitka/specs/ParameterSpecs.py +4 -4
- nuitka/tools/environments/Virtualenv.py +13 -5
- nuitka/tools/general/dll_report/__main__.py +10 -1
- nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
- nuitka/tools/podman/__main__.py +4 -2
- nuitka/tools/specialize/CTypeDescriptions.py +158 -9
- nuitka/tools/specialize/SpecializeC.py +218 -56
- nuitka/tools/testing/Common.py +69 -62
- nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
- nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
- nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
- nuitka/tools/watch/AutoStage.py +1 -0
- nuitka/tree/Building.py +10 -37
- nuitka/tree/ComplexCallHelperFunctions.py +4 -0
- nuitka/tree/ReformulationAssertStatements.py +31 -14
- nuitka/tree/ReformulationAssignmentStatements.py +5 -1
- nuitka/tree/ReformulationClasses3.py +94 -19
- nuitka/tree/ReformulationDictionaryCreation.py +1 -0
- nuitka/tree/ReformulationFunctionStatements.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationYieldExpressions.py +23 -5
- nuitka/utils/CommandLineOptions.py +27 -3
- nuitka/utils/Download.py +2 -2
- nuitka/utils/Execution.py +36 -31
- nuitka/utils/FileOperations.py +18 -39
- nuitka/utils/Hashing.py +5 -1
- nuitka/utils/Importing.py +2 -14
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +9 -4
- nuitka/utils/Json.py +2 -2
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/SharedLibraries.py +24 -0
- nuitka/utils/Signing.py +9 -1
- nuitka/utils/Utils.py +1 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.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,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
|
88
|
+
def isCommutativeOperation(op_code):
|
|
87
89
|
return op_code in ("ADD", "MULT", "BITOR", "BITAND", "BITXOR")
|
|
88
90
|
|
|
89
91
|
|
|
90
|
-
def
|
|
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,
|
|
112
|
-
|
|
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
|
|
119
|
-
for type_name2 in
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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
|
-
|
|
144
|
-
|
|
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_%
|
|
139
|
+
yield "BINARY_OPERATION_%s_%s_%s_%s" % (
|
|
153
140
|
op_code,
|
|
154
|
-
|
|
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
|
-
|
|
180
|
-
|
|
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(
|
|
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,
|
|
184
|
+
def _makeNumberOps(op_code, result_types):
|
|
195
185
|
return buildOrderedSet(
|
|
196
|
-
_makeTypeOps(op_code, "INT",
|
|
197
|
-
_makeTypeOps(op_code, "LONG",
|
|
198
|
-
_makeTypeOps(op_code, "FLOAT",
|
|
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(
|
|
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(
|
|
196
|
+
_makeFriendOps(
|
|
197
|
+
op_code, friend_type_names=("INT", "CLONG"), result_types=result_types
|
|
198
|
+
),
|
|
203
199
|
(
|
|
204
|
-
_makeFriendOps(
|
|
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
|
-
|
|
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",
|
|
215
|
-
_makeTypeOps("ADD", "STR",
|
|
216
|
-
_makeTypeOps("ADD", "UNICODE",
|
|
217
|
-
_makeTypeOps("ADD", "BYTES",
|
|
218
|
-
_makeTypeOps("ADD", "TUPLE",
|
|
219
|
-
_makeTypeOps(
|
|
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(
|
|
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(
|
|
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(
|
|
263
|
+
def makeSubOps(result_types):
|
|
238
264
|
return buildOrderedSet(
|
|
239
|
-
_makeNumberOps("SUB",
|
|
240
|
-
_makeDefaultOps("SUB",
|
|
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(
|
|
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",
|
|
249
|
-
_makeTypeOps("SUB", "UNICODE",
|
|
250
|
-
_makeTypeOps("SUB", "BYTES",
|
|
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(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
_makeFriendOps(
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
_makeFriendOps(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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(
|
|
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,
|
|
352
|
+
def _makeDivOps(op_code, result_types):
|
|
283
353
|
return buildOrderedSet(
|
|
284
|
-
_makeNumberOps(op_code,
|
|
285
|
-
_makeDefaultOps(op_code,
|
|
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",
|
|
359
|
+
specialized_truediv_helpers_set = _makeDivOps("TRUEDIV", result_types=("OBJECT",))
|
|
290
360
|
|
|
291
361
|
nonspecialized_truediv_helpers_set = buildOrderedSet(
|
|
292
|
-
_makeTypeOps("TRUEDIV", "UNICODE",
|
|
293
|
-
_makeTypeOps("TRUEDIV", "STR",
|
|
294
|
-
_makeTypeOps("TRUEDIV", "BYTES",
|
|
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",
|
|
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",
|
|
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",
|
|
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(
|
|
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(
|
|
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(
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
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",
|
|
495
|
+
_makeTypeOps("BITOR", "FLOAT", result_types=standard_result_types),
|
|
406
496
|
_makeNonContainerMathOps("BITOR"),
|
|
407
|
-
_makeTypeOps("BITOR", "UNICODE",
|
|
408
|
-
_makeTypeOps("BITOR", "STR",
|
|
409
|
-
_makeTypeOps("BITOR", "BYTES",
|
|
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(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
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",
|
|
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",
|
|
448
|
-
_makeTypeOps("POW", "LONG",
|
|
449
|
-
_makeTypeOps("POW", "INT",
|
|
450
|
-
_makeFriendOps(
|
|
451
|
-
|
|
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",
|
|
461
|
-
_makeTypeOps("POW", "UNICODE",
|
|
462
|
-
_makeTypeOps("POW", "BYTES",
|
|
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",
|
|
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",
|
|
474
|
-
_makeTypeOps("DIVMOD", "STR",
|
|
475
|
-
_makeTypeOps("DIVMOD", "BYTES",
|
|
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",
|
|
481
|
-
_makeTypeOps("MATMULT", "FLOAT",
|
|
482
|
-
_makeDefaultOps("MATMULT",
|
|
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",
|
|
489
|
-
_makeTypeOps("MATMULT", "LIST",
|
|
490
|
-
_makeTypeOps("MATMULT", "DICT",
|
|
491
|
-
_makeTypeOps("MATMULT", "BYTES",
|
|
492
|
-
_makeTypeOps("MATMULT", "UNICODE",
|
|
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(
|
|
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",
|
|
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",
|
|
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",
|
|
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
|