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
|
@@ -76,11 +76,12 @@ static long Nuitka_Function_tp_hash(struct Nuitka_FunctionObject *function) {
|
|
|
76
76
|
return function->m_counter;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
static PyObject *Nuitka_Function_get_name(
|
|
80
|
-
CHECK_OBJECT(
|
|
81
|
-
assert(Nuitka_Function_Check(
|
|
82
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
79
|
+
static PyObject *Nuitka_Function_get_name(PyObject *self, void *data) {
|
|
80
|
+
CHECK_OBJECT(self);
|
|
81
|
+
assert(Nuitka_Function_Check(self));
|
|
82
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
83
83
|
|
|
84
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
84
85
|
PyObject *result = function->m_name;
|
|
85
86
|
CHECK_OBJECT(result);
|
|
86
87
|
|
|
@@ -88,10 +89,10 @@ static PyObject *Nuitka_Function_get_name(struct Nuitka_FunctionObject *function
|
|
|
88
89
|
return result;
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
static int Nuitka_Function_set_name(
|
|
92
|
-
CHECK_OBJECT(
|
|
93
|
-
assert(Nuitka_Function_Check(
|
|
94
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
92
|
+
static int Nuitka_Function_set_name(PyObject *self, PyObject *value, void *data) {
|
|
93
|
+
CHECK_OBJECT(self);
|
|
94
|
+
assert(Nuitka_Function_Check(self));
|
|
95
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
95
96
|
CHECK_OBJECT_X(value);
|
|
96
97
|
|
|
97
98
|
#if PYTHON_VERSION < 0x300
|
|
@@ -106,6 +107,7 @@ static int Nuitka_Function_set_name(struct Nuitka_FunctionObject *function, PyOb
|
|
|
106
107
|
return -1;
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
109
111
|
PyObject *old = function->m_name;
|
|
110
112
|
CHECK_OBJECT(old);
|
|
111
113
|
|
|
@@ -117,11 +119,12 @@ static int Nuitka_Function_set_name(struct Nuitka_FunctionObject *function, PyOb
|
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
#if PYTHON_VERSION >= 0x300
|
|
120
|
-
static PyObject *Nuitka_Function_get_qualname(
|
|
121
|
-
CHECK_OBJECT(
|
|
122
|
-
assert(Nuitka_Function_Check(
|
|
123
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
122
|
+
static PyObject *Nuitka_Function_get_qualname(PyObject *self, void *data) {
|
|
123
|
+
CHECK_OBJECT(self);
|
|
124
|
+
assert(Nuitka_Function_Check(self));
|
|
125
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
124
126
|
|
|
127
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
125
128
|
PyObject *result = function->m_qualname;
|
|
126
129
|
CHECK_OBJECT(result);
|
|
127
130
|
|
|
@@ -129,10 +132,10 @@ static PyObject *Nuitka_Function_get_qualname(struct Nuitka_FunctionObject *func
|
|
|
129
132
|
return result;
|
|
130
133
|
}
|
|
131
134
|
|
|
132
|
-
static int Nuitka_Function_set_qualname(
|
|
133
|
-
CHECK_OBJECT(
|
|
134
|
-
assert(Nuitka_Function_Check(
|
|
135
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
135
|
+
static int Nuitka_Function_set_qualname(PyObject *self, PyObject *value, void *data) {
|
|
136
|
+
CHECK_OBJECT(self);
|
|
137
|
+
assert(Nuitka_Function_Check(self));
|
|
138
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
136
139
|
CHECK_OBJECT_X(value);
|
|
137
140
|
|
|
138
141
|
if (unlikely(value == NULL || PyUnicode_Check(value) == 0)) {
|
|
@@ -142,6 +145,7 @@ static int Nuitka_Function_set_qualname(struct Nuitka_FunctionObject *function,
|
|
|
142
145
|
return -1;
|
|
143
146
|
}
|
|
144
147
|
|
|
148
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
145
149
|
PyObject *old = function->m_qualname;
|
|
146
150
|
Py_INCREF(value);
|
|
147
151
|
function->m_qualname = value;
|
|
@@ -151,11 +155,12 @@ static int Nuitka_Function_set_qualname(struct Nuitka_FunctionObject *function,
|
|
|
151
155
|
}
|
|
152
156
|
#endif
|
|
153
157
|
|
|
154
|
-
static PyObject *Nuitka_Function_get_doc(
|
|
155
|
-
CHECK_OBJECT(
|
|
156
|
-
assert(Nuitka_Function_Check(
|
|
157
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
158
|
+
static PyObject *Nuitka_Function_get_doc(PyObject *self, void *data) {
|
|
159
|
+
CHECK_OBJECT(self);
|
|
160
|
+
assert(Nuitka_Function_Check(self));
|
|
161
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
158
162
|
|
|
163
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
159
164
|
PyObject *result = function->m_doc;
|
|
160
165
|
|
|
161
166
|
if (result == NULL) {
|
|
@@ -168,12 +173,13 @@ static PyObject *Nuitka_Function_get_doc(struct Nuitka_FunctionObject *function)
|
|
|
168
173
|
return result;
|
|
169
174
|
}
|
|
170
175
|
|
|
171
|
-
static int Nuitka_Function_set_doc(
|
|
172
|
-
CHECK_OBJECT(
|
|
173
|
-
assert(Nuitka_Function_Check(
|
|
174
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
176
|
+
static int Nuitka_Function_set_doc(PyObject *self, PyObject *value, void *data) {
|
|
177
|
+
CHECK_OBJECT(self);
|
|
178
|
+
assert(Nuitka_Function_Check(self));
|
|
179
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
175
180
|
CHECK_OBJECT_X(value);
|
|
176
181
|
|
|
182
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
177
183
|
PyObject *old = function->m_doc;
|
|
178
184
|
|
|
179
185
|
function->m_doc = value;
|
|
@@ -184,11 +190,12 @@ static int Nuitka_Function_set_doc(struct Nuitka_FunctionObject *function, PyObj
|
|
|
184
190
|
return 0;
|
|
185
191
|
}
|
|
186
192
|
|
|
187
|
-
static PyObject *Nuitka_Function_get_dict(
|
|
188
|
-
CHECK_OBJECT(
|
|
189
|
-
assert(Nuitka_Function_Check(
|
|
190
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
193
|
+
static PyObject *Nuitka_Function_get_dict(PyObject *self, void *data) {
|
|
194
|
+
CHECK_OBJECT(self);
|
|
195
|
+
assert(Nuitka_Function_Check(self));
|
|
196
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
191
197
|
|
|
198
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
192
199
|
if (function->m_dict == NULL) {
|
|
193
200
|
NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
|
|
194
201
|
|
|
@@ -201,10 +208,10 @@ static PyObject *Nuitka_Function_get_dict(struct Nuitka_FunctionObject *function
|
|
|
201
208
|
return function->m_dict;
|
|
202
209
|
}
|
|
203
210
|
|
|
204
|
-
static int Nuitka_Function_set_dict(
|
|
205
|
-
CHECK_OBJECT(
|
|
206
|
-
assert(Nuitka_Function_Check(
|
|
207
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
211
|
+
static int Nuitka_Function_set_dict(PyObject *self, PyObject *value, void *data) {
|
|
212
|
+
CHECK_OBJECT(self);
|
|
213
|
+
assert(Nuitka_Function_Check(self));
|
|
214
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
208
215
|
CHECK_OBJECT_X(value);
|
|
209
216
|
|
|
210
217
|
if (unlikely(value == NULL)) {
|
|
@@ -215,6 +222,7 @@ static int Nuitka_Function_set_dict(struct Nuitka_FunctionObject *function, PyOb
|
|
|
215
222
|
}
|
|
216
223
|
|
|
217
224
|
if (likely(PyDict_Check(value))) {
|
|
225
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
218
226
|
PyObject *old = function->m_dict;
|
|
219
227
|
CHECK_OBJECT_X(old);
|
|
220
228
|
|
|
@@ -231,30 +239,31 @@ static int Nuitka_Function_set_dict(struct Nuitka_FunctionObject *function, PyOb
|
|
|
231
239
|
}
|
|
232
240
|
}
|
|
233
241
|
|
|
234
|
-
static PyObject *Nuitka_Function_get_code(
|
|
235
|
-
CHECK_OBJECT(
|
|
236
|
-
assert(Nuitka_Function_Check(
|
|
237
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
242
|
+
static PyObject *Nuitka_Function_get_code(PyObject *self, void *data) {
|
|
243
|
+
CHECK_OBJECT(self);
|
|
244
|
+
assert(Nuitka_Function_Check(self));
|
|
245
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
238
246
|
|
|
247
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
239
248
|
PyObject *result = (PyObject *)function->m_code_object;
|
|
240
249
|
Py_INCREF(result);
|
|
241
250
|
return result;
|
|
242
251
|
}
|
|
243
252
|
|
|
244
|
-
static int Nuitka_Function_set_code(
|
|
245
|
-
CHECK_OBJECT(
|
|
246
|
-
assert(Nuitka_Function_Check(
|
|
247
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
253
|
+
static int Nuitka_Function_set_code(PyObject *self, PyObject *value, void *data) {
|
|
254
|
+
CHECK_OBJECT(self);
|
|
255
|
+
assert(Nuitka_Function_Check(self));
|
|
256
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
248
257
|
|
|
249
258
|
PyThreadState *tstate = PyThreadState_GET();
|
|
250
259
|
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, "__code__ is not writable in Nuitka");
|
|
251
260
|
return -1;
|
|
252
261
|
}
|
|
253
262
|
|
|
254
|
-
static PyObject *Nuitka_Function_get_compiled(
|
|
255
|
-
CHECK_OBJECT(
|
|
256
|
-
assert(Nuitka_Function_Check(
|
|
257
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
263
|
+
static PyObject *Nuitka_Function_get_compiled(PyObject *self, void *data) {
|
|
264
|
+
CHECK_OBJECT(self);
|
|
265
|
+
assert(Nuitka_Function_Check(self));
|
|
266
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
258
267
|
|
|
259
268
|
PyObject *result = Nuitka_dunder_compiled_value;
|
|
260
269
|
CHECK_OBJECT(result);
|
|
@@ -263,21 +272,22 @@ static PyObject *Nuitka_Function_get_compiled(struct Nuitka_FunctionObject *func
|
|
|
263
272
|
return result;
|
|
264
273
|
}
|
|
265
274
|
|
|
266
|
-
static int Nuitka_Function_set_compiled(
|
|
267
|
-
CHECK_OBJECT(
|
|
268
|
-
assert(Nuitka_Function_Check(
|
|
269
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
275
|
+
static int Nuitka_Function_set_compiled(PyObject *self, PyObject *value, void *data) {
|
|
276
|
+
CHECK_OBJECT(self);
|
|
277
|
+
assert(Nuitka_Function_Check(self));
|
|
278
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
270
279
|
|
|
271
280
|
PyThreadState *tstate = PyThreadState_GET();
|
|
272
281
|
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, "__compiled__ is not writable");
|
|
273
282
|
return -1;
|
|
274
283
|
}
|
|
275
284
|
|
|
276
|
-
static PyObject *Nuitka_Function_get_compiled_constant(
|
|
277
|
-
CHECK_OBJECT(
|
|
278
|
-
assert(Nuitka_Function_Check(
|
|
279
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
285
|
+
static PyObject *Nuitka_Function_get_compiled_constant(PyObject *self, void *data) {
|
|
286
|
+
CHECK_OBJECT(self);
|
|
287
|
+
assert(Nuitka_Function_Check(self));
|
|
288
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
280
289
|
|
|
290
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
281
291
|
PyObject *result = function->m_constant_return_value;
|
|
282
292
|
|
|
283
293
|
if (result == NULL) {
|
|
@@ -292,10 +302,10 @@ static PyObject *Nuitka_Function_get_compiled_constant(struct Nuitka_FunctionObj
|
|
|
292
302
|
return result;
|
|
293
303
|
}
|
|
294
304
|
|
|
295
|
-
static int Nuitka_Function_set_compiled_constant(
|
|
296
|
-
CHECK_OBJECT(
|
|
297
|
-
assert(Nuitka_Function_Check(
|
|
298
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
305
|
+
static int Nuitka_Function_set_compiled_constant(PyObject *self, PyObject *value, void *data) {
|
|
306
|
+
CHECK_OBJECT(self);
|
|
307
|
+
assert(Nuitka_Function_Check(self));
|
|
308
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
299
309
|
|
|
300
310
|
PyThreadState *tstate = PyThreadState_GET();
|
|
301
311
|
|
|
@@ -303,11 +313,12 @@ static int Nuitka_Function_set_compiled_constant(struct Nuitka_FunctionObject *f
|
|
|
303
313
|
return -1;
|
|
304
314
|
}
|
|
305
315
|
|
|
306
|
-
static PyObject *Nuitka_Function_get_closure(
|
|
307
|
-
CHECK_OBJECT(
|
|
308
|
-
assert(Nuitka_Function_Check(
|
|
309
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
316
|
+
static PyObject *Nuitka_Function_get_closure(PyObject *self, void *data) {
|
|
317
|
+
CHECK_OBJECT(self);
|
|
318
|
+
assert(Nuitka_Function_Check(self));
|
|
319
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
310
320
|
|
|
321
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
311
322
|
if (function->m_closure_given > 0) {
|
|
312
323
|
NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
|
|
313
324
|
return MAKE_TUPLE(tstate, (PyObject *const *)function->m_closure, function->m_closure_given);
|
|
@@ -317,10 +328,10 @@ static PyObject *Nuitka_Function_get_closure(struct Nuitka_FunctionObject *funct
|
|
|
317
328
|
}
|
|
318
329
|
}
|
|
319
330
|
|
|
320
|
-
static int Nuitka_Function_set_closure(
|
|
321
|
-
CHECK_OBJECT(
|
|
322
|
-
assert(Nuitka_Function_Check(
|
|
323
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
331
|
+
static int Nuitka_Function_set_closure(PyObject *self, PyObject *value, void *data) {
|
|
332
|
+
CHECK_OBJECT(self);
|
|
333
|
+
assert(Nuitka_Function_Check(self));
|
|
334
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
324
335
|
|
|
325
336
|
PyThreadState *tstate = PyThreadState_GET();
|
|
326
337
|
|
|
@@ -335,11 +346,12 @@ static int Nuitka_Function_set_closure(struct Nuitka_FunctionObject *function, P
|
|
|
335
346
|
return -1;
|
|
336
347
|
}
|
|
337
348
|
|
|
338
|
-
static PyObject *Nuitka_Function_get_defaults(
|
|
339
|
-
CHECK_OBJECT(
|
|
340
|
-
assert(Nuitka_Function_Check(
|
|
341
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
349
|
+
static PyObject *Nuitka_Function_get_defaults(PyObject *self, void *data) {
|
|
350
|
+
CHECK_OBJECT(self);
|
|
351
|
+
assert(Nuitka_Function_Check(self));
|
|
352
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
342
353
|
|
|
354
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
343
355
|
PyObject *result = (PyObject *)function->m_defaults;
|
|
344
356
|
CHECK_OBJECT(result);
|
|
345
357
|
|
|
@@ -358,10 +370,10 @@ static void _onUpdatedCompiledFunctionDefaultsValue(struct Nuitka_FunctionObject
|
|
|
358
370
|
}
|
|
359
371
|
}
|
|
360
372
|
|
|
361
|
-
static int Nuitka_Function_set_defaults(
|
|
362
|
-
CHECK_OBJECT(
|
|
363
|
-
assert(Nuitka_Function_Check(
|
|
364
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
373
|
+
static int Nuitka_Function_set_defaults(PyObject *self, PyObject *value, void *data) {
|
|
374
|
+
CHECK_OBJECT(self);
|
|
375
|
+
assert(Nuitka_Function_Check(self));
|
|
376
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
365
377
|
CHECK_OBJECT_X(value);
|
|
366
378
|
|
|
367
379
|
if (value == NULL) {
|
|
@@ -375,6 +387,7 @@ static int Nuitka_Function_set_defaults(struct Nuitka_FunctionObject *function,
|
|
|
375
387
|
return -1;
|
|
376
388
|
}
|
|
377
389
|
|
|
390
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
378
391
|
PyObject *old = function->m_defaults;
|
|
379
392
|
CHECK_OBJECT(old);
|
|
380
393
|
|
|
@@ -388,11 +401,12 @@ static int Nuitka_Function_set_defaults(struct Nuitka_FunctionObject *function,
|
|
|
388
401
|
}
|
|
389
402
|
|
|
390
403
|
#if PYTHON_VERSION >= 0x300
|
|
391
|
-
static PyObject *Nuitka_Function_get_kwdefaults(
|
|
392
|
-
CHECK_OBJECT(
|
|
393
|
-
assert(Nuitka_Function_Check(
|
|
394
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
404
|
+
static PyObject *Nuitka_Function_get_kwdefaults(PyObject *self, void *data) {
|
|
405
|
+
CHECK_OBJECT(self);
|
|
406
|
+
assert(Nuitka_Function_Check(self));
|
|
407
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
395
408
|
|
|
409
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
396
410
|
PyObject *result = function->m_kwdefaults;
|
|
397
411
|
CHECK_OBJECT_X(result);
|
|
398
412
|
|
|
@@ -404,10 +418,10 @@ static PyObject *Nuitka_Function_get_kwdefaults(struct Nuitka_FunctionObject *fu
|
|
|
404
418
|
return result;
|
|
405
419
|
}
|
|
406
420
|
|
|
407
|
-
static int Nuitka_Function_set_kwdefaults(
|
|
408
|
-
CHECK_OBJECT(
|
|
409
|
-
assert(Nuitka_Function_Check(
|
|
410
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
421
|
+
static int Nuitka_Function_set_kwdefaults(PyObject *self, PyObject *value, void *data) {
|
|
422
|
+
CHECK_OBJECT(self);
|
|
423
|
+
assert(Nuitka_Function_Check(self));
|
|
424
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
411
425
|
CHECK_OBJECT_X(value);
|
|
412
426
|
|
|
413
427
|
if (value == NULL) {
|
|
@@ -425,6 +439,7 @@ static int Nuitka_Function_set_kwdefaults(struct Nuitka_FunctionObject *function
|
|
|
425
439
|
value = NULL;
|
|
426
440
|
}
|
|
427
441
|
|
|
442
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
428
443
|
PyObject *old = function->m_kwdefaults;
|
|
429
444
|
CHECK_OBJECT_X(old);
|
|
430
445
|
|
|
@@ -435,11 +450,12 @@ static int Nuitka_Function_set_kwdefaults(struct Nuitka_FunctionObject *function
|
|
|
435
450
|
return 0;
|
|
436
451
|
}
|
|
437
452
|
|
|
438
|
-
static PyObject *Nuitka_Function_get_annotations(
|
|
439
|
-
CHECK_OBJECT(
|
|
440
|
-
assert(Nuitka_Function_Check(
|
|
441
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
453
|
+
static PyObject *Nuitka_Function_get_annotations(PyObject *self, void *data) {
|
|
454
|
+
CHECK_OBJECT(self);
|
|
455
|
+
assert(Nuitka_Function_Check(self));
|
|
456
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
442
457
|
|
|
458
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
443
459
|
if (function->m_annotations == NULL) {
|
|
444
460
|
NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
|
|
445
461
|
|
|
@@ -451,10 +467,10 @@ static PyObject *Nuitka_Function_get_annotations(struct Nuitka_FunctionObject *f
|
|
|
451
467
|
return function->m_annotations;
|
|
452
468
|
}
|
|
453
469
|
|
|
454
|
-
static int Nuitka_Function_set_annotations(
|
|
455
|
-
CHECK_OBJECT(
|
|
456
|
-
assert(Nuitka_Function_Check(
|
|
457
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
470
|
+
static int Nuitka_Function_set_annotations(PyObject *self, PyObject *value, void *data) {
|
|
471
|
+
CHECK_OBJECT(self);
|
|
472
|
+
assert(Nuitka_Function_Check(self));
|
|
473
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
458
474
|
|
|
459
475
|
if (unlikely(value != NULL && PyDict_Check(value) == false)) {
|
|
460
476
|
PyThreadState *tstate = PyThreadState_GET();
|
|
@@ -463,6 +479,7 @@ static int Nuitka_Function_set_annotations(struct Nuitka_FunctionObject *functio
|
|
|
463
479
|
return -1;
|
|
464
480
|
}
|
|
465
481
|
|
|
482
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
466
483
|
PyObject *old = function->m_annotations;
|
|
467
484
|
CHECK_OBJECT_X(old);
|
|
468
485
|
|
|
@@ -475,10 +492,10 @@ static int Nuitka_Function_set_annotations(struct Nuitka_FunctionObject *functio
|
|
|
475
492
|
|
|
476
493
|
#endif
|
|
477
494
|
|
|
478
|
-
static int Nuitka_Function_set_globals(
|
|
479
|
-
CHECK_OBJECT(
|
|
480
|
-
assert(Nuitka_Function_Check(
|
|
481
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
495
|
+
static int Nuitka_Function_set_globals(PyObject *self, PyObject *value, void *data) {
|
|
496
|
+
CHECK_OBJECT(self);
|
|
497
|
+
assert(Nuitka_Function_Check(self));
|
|
498
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
482
499
|
|
|
483
500
|
PyThreadState *tstate = PyThreadState_GET();
|
|
484
501
|
|
|
@@ -486,11 +503,12 @@ static int Nuitka_Function_set_globals(struct Nuitka_FunctionObject *function, P
|
|
|
486
503
|
return -1;
|
|
487
504
|
}
|
|
488
505
|
|
|
489
|
-
static PyObject *Nuitka_Function_get_globals(
|
|
490
|
-
CHECK_OBJECT(
|
|
491
|
-
assert(Nuitka_Function_Check(
|
|
492
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
506
|
+
static PyObject *Nuitka_Function_get_globals(PyObject *self, void *data) {
|
|
507
|
+
CHECK_OBJECT(self);
|
|
508
|
+
assert(Nuitka_Function_Check(self));
|
|
509
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
493
510
|
|
|
511
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
494
512
|
PyObject *result = PyModule_GetDict(function->m_module);
|
|
495
513
|
CHECK_OBJECT(result);
|
|
496
514
|
|
|
@@ -499,10 +517,10 @@ static PyObject *Nuitka_Function_get_globals(struct Nuitka_FunctionObject *funct
|
|
|
499
517
|
}
|
|
500
518
|
|
|
501
519
|
#if PYTHON_VERSION >= 0x3a0
|
|
502
|
-
static int Nuitka_Function_set_builtins(
|
|
503
|
-
CHECK_OBJECT(
|
|
504
|
-
assert(Nuitka_Function_Check(
|
|
505
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
520
|
+
static int Nuitka_Function_set_builtins(PyObject *self, PyObject *value, void *data) {
|
|
521
|
+
CHECK_OBJECT(self);
|
|
522
|
+
assert(Nuitka_Function_Check(self));
|
|
523
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
506
524
|
|
|
507
525
|
PyThreadState *tstate = PyThreadState_GET();
|
|
508
526
|
|
|
@@ -510,22 +528,23 @@ static int Nuitka_Function_set_builtins(struct Nuitka_FunctionObject *function,
|
|
|
510
528
|
return -1;
|
|
511
529
|
}
|
|
512
530
|
|
|
513
|
-
static PyObject *Nuitka_Function_get_builtins(
|
|
514
|
-
CHECK_OBJECT(
|
|
515
|
-
assert(Nuitka_Function_Check(
|
|
516
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
531
|
+
static PyObject *Nuitka_Function_get_builtins(PyObject *self, void *data) {
|
|
532
|
+
CHECK_OBJECT(self);
|
|
533
|
+
assert(Nuitka_Function_Check(self));
|
|
534
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
517
535
|
|
|
518
536
|
PyThreadState *tstate = PyThreadState_GET();
|
|
537
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
519
538
|
return LOOKUP_SUBSCRIPT(tstate, PyModule_GetDict(function->m_module), const_str_plain___builtins__);
|
|
520
539
|
}
|
|
521
540
|
#endif
|
|
522
541
|
|
|
523
542
|
#if PYTHON_VERSION >= 0x3c0
|
|
524
|
-
static int Nuitka_Function_set_type_params(
|
|
525
|
-
CHECK_OBJECT(
|
|
526
|
-
CHECK_OBJECT_X(
|
|
527
|
-
assert(Nuitka_Function_Check(
|
|
528
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
543
|
+
static int Nuitka_Function_set_type_params(PyObject *self, PyObject *value, void *data) {
|
|
544
|
+
CHECK_OBJECT(self);
|
|
545
|
+
CHECK_OBJECT_X(self);
|
|
546
|
+
assert(Nuitka_Function_Check(self));
|
|
547
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
529
548
|
|
|
530
549
|
if (unlikely(value == NULL || !PyTuple_Check(value))) {
|
|
531
550
|
PyThreadState *tstate = PyThreadState_GET();
|
|
@@ -534,14 +553,15 @@ static int Nuitka_Function_set_type_params(struct Nuitka_FunctionObject *functio
|
|
|
534
553
|
return -1;
|
|
535
554
|
}
|
|
536
555
|
|
|
556
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
537
557
|
Py_SETREF(function->m_type_params, Py_NewRef(value));
|
|
538
558
|
return 0;
|
|
539
559
|
}
|
|
540
560
|
|
|
541
|
-
static PyObject *Nuitka_Function_get_type_params(
|
|
542
|
-
CHECK_OBJECT(
|
|
543
|
-
assert(Nuitka_Function_Check(
|
|
544
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
561
|
+
static PyObject *Nuitka_Function_get_type_params(PyObject *self, void *data) {
|
|
562
|
+
CHECK_OBJECT(self);
|
|
563
|
+
assert(Nuitka_Function_Check(self));
|
|
564
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
545
565
|
|
|
546
566
|
// TODO: Probably not needed anymore?
|
|
547
567
|
Py_INCREF(const_tuple_empty);
|
|
@@ -549,12 +569,13 @@ static PyObject *Nuitka_Function_get_type_params(struct Nuitka_FunctionObject *f
|
|
|
549
569
|
}
|
|
550
570
|
#endif
|
|
551
571
|
|
|
552
|
-
static int Nuitka_Function_set_module(
|
|
553
|
-
CHECK_OBJECT(
|
|
554
|
-
assert(Nuitka_Function_Check(
|
|
555
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
572
|
+
static int Nuitka_Function_set_module(PyObject *self, PyObject *value, void *data) {
|
|
573
|
+
CHECK_OBJECT(self);
|
|
574
|
+
assert(Nuitka_Function_Check(self));
|
|
575
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
556
576
|
CHECK_OBJECT_X(value);
|
|
557
577
|
|
|
578
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
558
579
|
if (function->m_dict == NULL) {
|
|
559
580
|
NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
|
|
560
581
|
|
|
@@ -568,16 +589,17 @@ static int Nuitka_Function_set_module(struct Nuitka_FunctionObject *function, Py
|
|
|
568
589
|
return DICT_SET_ITEM(function->m_dict, const_str_plain___module__, value) ? 0 : -1;
|
|
569
590
|
}
|
|
570
591
|
|
|
571
|
-
static PyObject *Nuitka_Function_get_module(
|
|
572
|
-
CHECK_OBJECT(
|
|
573
|
-
assert(Nuitka_Function_Check(
|
|
574
|
-
assert(_PyObject_GC_IS_TRACKED(
|
|
592
|
+
static PyObject *Nuitka_Function_get_module(PyObject *self, void *data) {
|
|
593
|
+
CHECK_OBJECT(self);
|
|
594
|
+
assert(Nuitka_Function_Check(self));
|
|
595
|
+
assert(_PyObject_GC_IS_TRACKED(self));
|
|
575
596
|
|
|
576
597
|
PyObject *result;
|
|
577
598
|
|
|
578
599
|
PyThreadState *tstate = PyThreadState_GET();
|
|
579
600
|
|
|
580
601
|
// The __dict__ might overrule this.
|
|
602
|
+
struct Nuitka_FunctionObject *function = (struct Nuitka_FunctionObject *)self;
|
|
581
603
|
if (function->m_dict) {
|
|
582
604
|
result = DICT_GET_ITEM1(tstate, function->m_dict, const_str_plain___module__);
|
|
583
605
|
|
|
@@ -592,53 +614,53 @@ static PyObject *Nuitka_Function_get_module(struct Nuitka_FunctionObject *functi
|
|
|
592
614
|
|
|
593
615
|
static PyGetSetDef Nuitka_Function_getset[] = {
|
|
594
616
|
#if PYTHON_VERSION >= 0x300
|
|
595
|
-
{(char *)"__qualname__",
|
|
617
|
+
{(char *)"__qualname__", Nuitka_Function_get_qualname, Nuitka_Function_set_qualname, NULL},
|
|
596
618
|
#endif
|
|
597
619
|
#if PYTHON_VERSION < 0x300
|
|
598
|
-
{(char *)"func_name",
|
|
620
|
+
{(char *)"func_name", Nuitka_Function_get_name, Nuitka_Function_set_name, NULL},
|
|
599
621
|
#endif
|
|
600
|
-
{(char *)"__name__",
|
|
622
|
+
{(char *)"__name__", Nuitka_Function_get_name, Nuitka_Function_set_name, NULL},
|
|
601
623
|
#if PYTHON_VERSION < 0x300
|
|
602
|
-
{(char *)"func_doc",
|
|
624
|
+
{(char *)"func_doc", Nuitka_Function_get_doc, Nuitka_Function_set_doc, NULL},
|
|
603
625
|
#endif
|
|
604
|
-
{(char *)"__doc__",
|
|
626
|
+
{(char *)"__doc__", Nuitka_Function_get_doc, Nuitka_Function_set_doc, NULL},
|
|
605
627
|
#if PYTHON_VERSION < 0x300
|
|
606
|
-
{(char *)"func_dict",
|
|
628
|
+
{(char *)"func_dict", Nuitka_Function_get_dict, Nuitka_Function_set_dict, NULL},
|
|
607
629
|
#endif
|
|
608
|
-
{(char *)"__dict__",
|
|
630
|
+
{(char *)"__dict__", Nuitka_Function_get_dict, Nuitka_Function_set_dict, NULL},
|
|
609
631
|
#if PYTHON_VERSION < 0x300
|
|
610
|
-
{(char *)"func_code",
|
|
632
|
+
{(char *)"func_code", Nuitka_Function_get_code, Nuitka_Function_set_code, NULL},
|
|
611
633
|
#endif
|
|
612
|
-
{(char *)"__code__",
|
|
634
|
+
{(char *)"__code__", Nuitka_Function_get_code, Nuitka_Function_set_code, NULL},
|
|
613
635
|
#if PYTHON_VERSION < 0x300
|
|
614
|
-
{(char *)"func_defaults",
|
|
636
|
+
{(char *)"func_defaults", Nuitka_Function_get_defaults, Nuitka_Function_set_defaults, NULL},
|
|
615
637
|
#endif
|
|
616
|
-
{(char *)"__defaults__",
|
|
638
|
+
{(char *)"__defaults__", Nuitka_Function_get_defaults, Nuitka_Function_set_defaults, NULL},
|
|
617
639
|
#if PYTHON_VERSION < 0x300
|
|
618
|
-
{(char *)"func_globals",
|
|
640
|
+
{(char *)"func_globals", Nuitka_Function_get_globals, Nuitka_Function_set_globals, NULL},
|
|
619
641
|
#endif
|
|
620
|
-
{(char *)"__closure__",
|
|
642
|
+
{(char *)"__closure__", Nuitka_Function_get_closure, Nuitka_Function_set_closure, NULL},
|
|
621
643
|
#if PYTHON_VERSION < 0x300
|
|
622
|
-
{(char *)"func_closure",
|
|
644
|
+
{(char *)"func_closure", Nuitka_Function_get_closure, Nuitka_Function_set_closure, NULL},
|
|
623
645
|
#endif
|
|
624
|
-
{(char *)"__globals__",
|
|
625
|
-
{(char *)"__module__",
|
|
646
|
+
{(char *)"__globals__", Nuitka_Function_get_globals, Nuitka_Function_set_globals, NULL},
|
|
647
|
+
{(char *)"__module__", Nuitka_Function_get_module, Nuitka_Function_set_module, NULL},
|
|
626
648
|
#if PYTHON_VERSION >= 0x300
|
|
627
|
-
{(char *)"__kwdefaults__",
|
|
628
|
-
{(char *)"__annotations__",
|
|
649
|
+
{(char *)"__kwdefaults__", Nuitka_Function_get_kwdefaults, Nuitka_Function_set_kwdefaults, NULL},
|
|
650
|
+
{(char *)"__annotations__", Nuitka_Function_get_annotations, Nuitka_Function_set_annotations, NULL},
|
|
629
651
|
#endif
|
|
630
652
|
#if PYTHON_VERSION >= 0x3a0
|
|
631
|
-
{(char *)"__builtins__",
|
|
653
|
+
{(char *)"__builtins__", Nuitka_Function_get_builtins, Nuitka_Function_set_builtins, NULL},
|
|
632
654
|
#endif
|
|
633
655
|
#if PYTHON_VERSION >= 0x3c0
|
|
634
|
-
{(char *)"__type_params__",
|
|
656
|
+
{(char *)"__type_params__", Nuitka_Function_get_type_params, Nuitka_Function_set_type_params, NULL},
|
|
635
657
|
#endif
|
|
636
|
-
{(char *)"__compiled__",
|
|
637
|
-
{(char *)"__compiled_constant__",
|
|
638
|
-
|
|
658
|
+
{(char *)"__compiled__", Nuitka_Function_get_compiled, Nuitka_Function_set_compiled, NULL},
|
|
659
|
+
{(char *)"__compiled_constant__", Nuitka_Function_get_compiled_constant, Nuitka_Function_set_compiled_constant,
|
|
660
|
+
NULL},
|
|
639
661
|
{NULL}};
|
|
640
662
|
|
|
641
|
-
static PyObject *Nuitka_Function_reduce(struct Nuitka_FunctionObject *function) {
|
|
663
|
+
static PyObject *Nuitka_Function_reduce(struct Nuitka_FunctionObject *function, PyObject *unused) {
|
|
642
664
|
CHECK_OBJECT((PyObject *)function);
|
|
643
665
|
assert(Nuitka_Function_Check((PyObject *)function));
|
|
644
666
|
assert(_PyObject_GC_IS_TRACKED(function));
|
|
@@ -655,7 +677,7 @@ static PyObject *Nuitka_Function_reduce(struct Nuitka_FunctionObject *function)
|
|
|
655
677
|
return result;
|
|
656
678
|
}
|
|
657
679
|
|
|
658
|
-
static PyObject *Nuitka_Function_clone(struct Nuitka_FunctionObject *function) {
|
|
680
|
+
static PyObject *Nuitka_Function_clone(struct Nuitka_FunctionObject *function, PyObject *unused) {
|
|
659
681
|
CHECK_OBJECT((PyObject *)function);
|
|
660
682
|
assert(Nuitka_Function_Check((PyObject *)function));
|
|
661
683
|
assert(_PyObject_GC_IS_TRACKED(function));
|
|
@@ -1222,26 +1244,26 @@ PyObject *Nuitka_Function_ExtractCodeObjectDescription(PyThreadState *tstate, st
|
|
|
1222
1244
|
|
|
1223
1245
|
PyTuple_SET_ITEM0(code_object_desc, 0, function->m_code_object->co_filename);
|
|
1224
1246
|
PyTuple_SET_ITEM0(code_object_desc, 1, function->m_code_object->co_name);
|
|
1225
|
-
PyTuple_SET_ITEM(code_object_desc, 2,
|
|
1247
|
+
PyTuple_SET_ITEM(code_object_desc, 2, Nuitka_PyLong_FromLong(function->m_code_object->co_firstlineno));
|
|
1226
1248
|
#if PYTHON_VERSION < 0x3b0
|
|
1227
1249
|
PyTuple_SET_ITEM0(code_object_desc, 3, function->m_code_object->co_varnames);
|
|
1228
1250
|
#else
|
|
1229
1251
|
// spell-checker: ignore PyCode_GetVarnames
|
|
1230
1252
|
PyTuple_SET_ITEM(code_object_desc, 3, PyCode_GetVarnames(function->m_code_object));
|
|
1231
1253
|
#endif
|
|
1232
|
-
PyTuple_SET_ITEM(code_object_desc, 4,
|
|
1233
|
-
PyTuple_SET_ITEM(code_object_desc, 5,
|
|
1254
|
+
PyTuple_SET_ITEM(code_object_desc, 4, Nuitka_PyLong_FromLong(function->m_code_object->co_argcount));
|
|
1255
|
+
PyTuple_SET_ITEM(code_object_desc, 5, Nuitka_PyLong_FromLong(function->m_code_object->co_flags));
|
|
1234
1256
|
|
|
1235
1257
|
#if PYTHON_VERSION < 0x380
|
|
1236
1258
|
PyTuple_SET_ITEM(code_object_desc, 6, const_int_0);
|
|
1237
1259
|
#else
|
|
1238
|
-
PyTuple_SET_ITEM(code_object_desc, 6,
|
|
1260
|
+
PyTuple_SET_ITEM(code_object_desc, 6, Nuitka_PyLong_FromLong(function->m_code_object->co_posonlyargcount));
|
|
1239
1261
|
#endif
|
|
1240
1262
|
|
|
1241
1263
|
#if PYTHON_VERSION < 0x3b0
|
|
1242
1264
|
PyTuple_SET_ITEM(code_object_desc, 7, const_int_0);
|
|
1243
1265
|
#else
|
|
1244
|
-
PyTuple_SET_ITEM(code_object_desc, 7,
|
|
1266
|
+
PyTuple_SET_ITEM(code_object_desc, 7, Nuitka_PyLong_FromLong(function->m_code_object->co_kwonlyargcount));
|
|
1245
1267
|
#endif
|
|
1246
1268
|
|
|
1247
1269
|
CHECK_OBJECT_DEEP(code_object_desc);
|