Nuitka-winsvc 2.7.7__cp313-cp313-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/Builtins.py +259 -0
- nuitka/BytecodeCaching.py +184 -0
- nuitka/Bytecodes.py +109 -0
- nuitka/CacheCleanup.py +54 -0
- nuitka/Constants.py +425 -0
- nuitka/Errors.py +93 -0
- nuitka/HardImportRegistry.py +408 -0
- nuitka/MainControl.py +1201 -0
- nuitka/ModuleRegistry.py +364 -0
- nuitka/OptionParsing.py +2473 -0
- nuitka/Options.py +2948 -0
- nuitka/OutputDirectories.py +201 -0
- nuitka/PostProcessing.py +551 -0
- nuitka/Progress.py +252 -0
- nuitka/PythonFlavors.py +426 -0
- nuitka/PythonOperators.py +146 -0
- nuitka/PythonVersions.py +513 -0
- nuitka/Serialization.py +291 -0
- nuitka/SourceCodeReferences.py +176 -0
- nuitka/Tracing.py +579 -0
- nuitka/TreeXML.py +141 -0
- nuitka/Variables.py +515 -0
- nuitka/Version.py +88 -0
- nuitka/__init__.py +19 -0
- nuitka/__main__.py +224 -0
- nuitka/__past__.py +217 -0
- nuitka/build/Backend.scons +1111 -0
- nuitka/build/CCompilerVersion.scons +281 -0
- nuitka/build/DataComposerInterface.py +116 -0
- nuitka/build/Offsets.scons +626 -0
- nuitka/build/Onefile.scons +564 -0
- nuitka/build/SconsCaching.py +451 -0
- nuitka/build/SconsCompilerSettings.py +1133 -0
- nuitka/build/SconsHacks.py +215 -0
- nuitka/build/SconsInterface.py +664 -0
- nuitka/build/SconsProgress.py +100 -0
- nuitka/build/SconsSpawn.py +436 -0
- nuitka/build/SconsUtils.py +939 -0
- nuitka/build/__init__.py +19 -0
- nuitka/build/include/nuitka/allocator.h +450 -0
- nuitka/build/include/nuitka/builtins.h +97 -0
- nuitka/build/include/nuitka/calling.h +123 -0
- nuitka/build/include/nuitka/checkers.h +39 -0
- nuitka/build/include/nuitka/checksum_tools.h +28 -0
- nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
- nuitka/build/include/nuitka/compiled_cell.h +64 -0
- nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
- nuitka/build/include/nuitka/compiled_frame.h +502 -0
- nuitka/build/include/nuitka/compiled_function.h +170 -0
- nuitka/build/include/nuitka/compiled_generator.h +287 -0
- nuitka/build/include/nuitka/compiled_method.h +54 -0
- nuitka/build/include/nuitka/constants.h +251 -0
- nuitka/build/include/nuitka/constants_blob.h +34 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/environment_variables.h +30 -0
- nuitka/build/include/nuitka/environment_variables_system.h +51 -0
- nuitka/build/include/nuitka/exception_groups.h +167 -0
- nuitka/build/include/nuitka/exceptions.h +1458 -0
- nuitka/build/include/nuitka/filesystem_paths.h +117 -0
- nuitka/build/include/nuitka/freelists.h +92 -0
- nuitka/build/include/nuitka/hedley.h +1774 -0
- nuitka/build/include/nuitka/helper/attributes.h +90 -0
- nuitka/build/include/nuitka/helper/boolean.h +86 -0
- nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
- nuitka/build/include/nuitka/helper/bytes.h +28 -0
- nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
- 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/comparisons_eq.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
- nuitka/build/include/nuitka/helper/complex.h +46 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
- nuitka/build/include/nuitka/helper/floats.h +32 -0
- nuitka/build/include/nuitka/helper/import_hard.h +121 -0
- nuitka/build/include/nuitka/helper/indexes.h +47 -0
- nuitka/build/include/nuitka/helper/ints.h +165 -0
- nuitka/build/include/nuitka/helper/iterators.h +376 -0
- nuitka/build/include/nuitka/helper/lists.h +94 -0
- nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
- nuitka/build/include/nuitka/helper/mappings.h +39 -0
- nuitka/build/include/nuitka/helper/operations.h +114 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
- nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
- nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
- nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
- nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
- nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
- nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
- nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
- nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
- nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
- nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
- nuitka/build/include/nuitka/helper/raising.h +114 -0
- nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
- nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
- nuitka/build/include/nuitka/helper/sequences.h +33 -0
- nuitka/build/include/nuitka/helper/sets.h +25 -0
- nuitka/build/include/nuitka/helper/slices.h +314 -0
- nuitka/build/include/nuitka/helper/strings.h +30 -0
- nuitka/build/include/nuitka/helper/subscripts.h +390 -0
- nuitka/build/include/nuitka/helper/tuples.h +187 -0
- nuitka/build/include/nuitka/helpers.h +417 -0
- nuitka/build/include/nuitka/importing.h +149 -0
- nuitka/build/include/nuitka/incbin.h +402 -0
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +626 -0
- nuitka/build/include/nuitka/printing.h +84 -0
- nuitka/build/include/nuitka/python_pgo.h +57 -0
- nuitka/build/include/nuitka/safe_string_ops.h +57 -0
- nuitka/build/include/nuitka/threading.h +142 -0
- nuitka/build/include/nuitka/tracing.h +82 -0
- nuitka/build/include/nuitka/type_aliases.h +30 -0
- nuitka/build/include/nuitka/unfreezing.h +91 -0
- nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
- nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
- nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
- nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
- nuitka/build/inline_copy/bin/scons.py +58 -0
- nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
- nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
- nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
- nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
- nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
- nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
- nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
- nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
- nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
- nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
- nuitka/build/inline_copy/glob2/LICENSE +27 -0
- nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
- nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
- nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
- nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
- nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
- nuitka/build/inline_copy/jinja2/README.rst +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
- nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
- nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
- nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
- nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
- nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
- nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
- nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
- nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
- nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
- nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
- nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
- nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
- nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
- nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
- nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
- nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
- nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
- nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
- nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
- nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
- nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
- nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
- nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
- nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
- nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
- nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
- nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
- nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
- nuitka/build/inline_copy/pefile/pefile.py +8034 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
- nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -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 +484 -0
- nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
- nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
- nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
- nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
- nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
- nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
- nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
- nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
- nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
- nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
- nuitka/build/inline_copy/yaml/LICENSE +20 -0
- nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
- nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
- nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
- nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
- nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
- nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
- nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
- nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
- nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
- nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
- nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
- nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
- nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
- nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
- nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
- nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
- nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
- nuitka/build/inline_copy/zlib/LICENSE +22 -0
- nuitka/build/inline_copy/zlib/crc32.c +1049 -0
- nuitka/build/inline_copy/zlib/crc32.h +9446 -0
- nuitka/build/inline_copy/zlib/zconf.h +551 -0
- nuitka/build/inline_copy/zlib/zlib.h +1938 -0
- nuitka/build/inline_copy/zlib/zutil.h +275 -0
- nuitka/build/inline_copy/zstd/LICENSE.txt +30 -0
- nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
- nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
- nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
- nuitka/build/inline_copy/zstd/common/debug.h +107 -0
- nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
- nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
- nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
- nuitka/build/inline_copy/zstd/common/fse.h +715 -0
- nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
- nuitka/build/inline_copy/zstd/common/huf.h +361 -0
- nuitka/build/inline_copy/zstd/common/mem.h +426 -0
- nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
- nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
- nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
- nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
- nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
- nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
- nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
- nuitka/build/inline_copy/zstd/zstd.h +2391 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
- nuitka/build/static_src/CompiledCellType.c +300 -0
- nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
- nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
- nuitka/build/static_src/CompiledFrameType.c +1337 -0
- nuitka/build/static_src/CompiledFunctionType.c +3320 -0
- nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
- nuitka/build/static_src/CompiledMethodType.c +614 -0
- nuitka/build/static_src/GenerateHeadersMain.c +30 -0
- nuitka/build/static_src/HelpersAllocator.c +939 -0
- nuitka/build/static_src/HelpersAttributes.c +1241 -0
- nuitka/build/static_src/HelpersBuiltin.c +901 -0
- nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
- nuitka/build/static_src/HelpersBytes.c +107 -0
- nuitka/build/static_src/HelpersCalling.c +397 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
- nuitka/build/static_src/HelpersChecksumTools.c +59 -0
- nuitka/build/static_src/HelpersClasses.c +91 -0
- 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 +12070 -0
- nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
- nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
- nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
- nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
- nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
- nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
- nuitka/build/static_src/HelpersConsole.c +124 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
- nuitka/build/static_src/HelpersDeepcopy.c +636 -0
- nuitka/build/static_src/HelpersDictionaries.c +1739 -0
- nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
- nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
- nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
- nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
- nuitka/build/static_src/HelpersExceptions.c +298 -0
- nuitka/build/static_src/HelpersFiles.c +353 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
- nuitka/build/static_src/HelpersFloats.c +92 -0
- nuitka/build/static_src/HelpersHeapStorage.c +68 -0
- nuitka/build/static_src/HelpersImport.c +506 -0
- nuitka/build/static_src/HelpersImportHard.c +526 -0
- nuitka/build/static_src/HelpersJitSources.c +48 -0
- nuitka/build/static_src/HelpersLists.c +899 -0
- nuitka/build/static_src/HelpersListsGenerated.c +564 -0
- nuitka/build/static_src/HelpersMappings.c +46 -0
- nuitka/build/static_src/HelpersMatching.c +192 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
- nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
- nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
- nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
- nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
- nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
- nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
- nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
- nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
- nuitka/build/static_src/HelpersProfiling.c +104 -0
- nuitka/build/static_src/HelpersPythonPgo.c +113 -0
- nuitka/build/static_src/HelpersRaising.c +447 -0
- nuitka/build/static_src/HelpersSafeStrings.c +185 -0
- nuitka/build/static_src/HelpersSequences.c +134 -0
- nuitka/build/static_src/HelpersSlices.c +73 -0
- nuitka/build/static_src/HelpersStrings.c +998 -0
- nuitka/build/static_src/HelpersTuples.c +148 -0
- nuitka/build/static_src/HelpersTypes.c +329 -0
- nuitka/build/static_src/InspectPatcher.c +439 -0
- nuitka/build/static_src/MainProgram.c +2060 -0
- nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
- nuitka/build/static_src/OnefileBootstrap.c +1580 -0
- nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
- nuitka/code_generation/AsyncgenCodes.py +186 -0
- nuitka/code_generation/AttributeCodes.py +357 -0
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
- nuitka/code_generation/BranchCodes.py +67 -0
- nuitka/code_generation/BuiltinCodes.py +529 -0
- nuitka/code_generation/CallCodes.py +1186 -0
- nuitka/code_generation/ClassCodes.py +156 -0
- nuitka/code_generation/CodeGeneration.py +1078 -0
- nuitka/code_generation/CodeHelperSelection.py +81 -0
- nuitka/code_generation/CodeHelpers.py +455 -0
- nuitka/code_generation/CodeObjectCodes.py +165 -0
- nuitka/code_generation/ComparisonCodes.py +569 -0
- nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
- nuitka/code_generation/ConditionalCodes.py +236 -0
- nuitka/code_generation/ConstantCodes.py +243 -0
- nuitka/code_generation/Contexts.py +1248 -0
- nuitka/code_generation/CoroutineCodes.py +253 -0
- nuitka/code_generation/CtypesCodes.py +46 -0
- nuitka/code_generation/DictCodes.py +918 -0
- nuitka/code_generation/Emission.py +75 -0
- nuitka/code_generation/ErrorCodes.py +281 -0
- nuitka/code_generation/EvalCodes.py +444 -0
- nuitka/code_generation/ExceptionCodes.py +337 -0
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
- nuitka/code_generation/ExpressionCodes.py +61 -0
- nuitka/code_generation/FrameCodes.py +518 -0
- nuitka/code_generation/FunctionCodes.py +858 -0
- nuitka/code_generation/GeneratorCodes.py +218 -0
- nuitka/code_generation/GlobalConstants.py +249 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
- nuitka/code_generation/IdCodes.py +53 -0
- nuitka/code_generation/ImportCodes.py +468 -0
- nuitka/code_generation/Indentation.py +45 -0
- nuitka/code_generation/IndexCodes.py +50 -0
- nuitka/code_generation/InjectCCodes.py +28 -0
- nuitka/code_generation/IntegerCodes.py +110 -0
- nuitka/code_generation/IteratorCodes.py +378 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/LabelCodes.py +68 -0
- nuitka/code_generation/LineNumberCodes.py +91 -0
- nuitka/code_generation/ListCodes.py +502 -0
- nuitka/code_generation/LoaderCodes.py +193 -0
- nuitka/code_generation/LocalsDictCodes.py +359 -0
- nuitka/code_generation/LoopCodes.py +88 -0
- nuitka/code_generation/MatchCodes.py +67 -0
- nuitka/code_generation/ModuleCodes.py +247 -0
- nuitka/code_generation/Namify.py +260 -0
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +398 -0
- nuitka/code_generation/PackageResourceCodes.py +986 -0
- nuitka/code_generation/PrintCodes.py +93 -0
- nuitka/code_generation/PythonAPICodes.py +215 -0
- nuitka/code_generation/RaisingCodes.py +481 -0
- nuitka/code_generation/Reports.py +115 -0
- nuitka/code_generation/ReturnCodes.py +143 -0
- nuitka/code_generation/SetCodes.py +196 -0
- nuitka/code_generation/SliceCodes.py +465 -0
- nuitka/code_generation/StringCodes.py +303 -0
- nuitka/code_generation/SubscriptCodes.py +263 -0
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TryCodes.py +326 -0
- nuitka/code_generation/TupleCodes.py +115 -0
- nuitka/code_generation/TypeAliasCodes.py +120 -0
- nuitka/code_generation/VariableCodes.py +519 -0
- nuitka/code_generation/VariableDeclarations.py +279 -0
- nuitka/code_generation/YieldCodes.py +253 -0
- nuitka/code_generation/__init__.py +19 -0
- nuitka/code_generation/c_types/CTypeBases.py +177 -0
- nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
- nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
- nuitka/code_generation/c_types/CTypeVoids.py +92 -0
- nuitka/code_generation/c_types/__init__.py +19 -0
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
- nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
- nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
- nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
- nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
- nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
- nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
- nuitka/code_generation/templates/__init__.py +19 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
- nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
- nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
- nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
- nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
- nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
- nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
- nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
- nuitka/containers/Namedtuples.py +51 -0
- nuitka/containers/OrderedDicts.py +191 -0
- nuitka/containers/OrderedSets.py +123 -0
- nuitka/containers/OrderedSetsFallback.py +139 -0
- nuitka/containers/__init__.py +19 -0
- nuitka/distutils/Build.py +76 -0
- nuitka/distutils/DistutilCommands.py +438 -0
- nuitka/distutils/__init__.py +19 -0
- nuitka/finalizations/Finalization.py +35 -0
- nuitka/finalizations/FinalizeMarkups.py +136 -0
- nuitka/finalizations/__init__.py +19 -0
- nuitka/freezer/DependsExe.py +257 -0
- nuitka/freezer/DllDependenciesCommon.py +97 -0
- nuitka/freezer/DllDependenciesMacOS.py +444 -0
- nuitka/freezer/DllDependenciesPosix.py +242 -0
- nuitka/freezer/DllDependenciesWin32.py +315 -0
- nuitka/freezer/ImportDetection.py +359 -0
- nuitka/freezer/IncludedDataFiles.py +689 -0
- nuitka/freezer/IncludedEntryPoints.py +376 -0
- nuitka/freezer/Onefile.py +296 -0
- nuitka/freezer/Standalone.py +520 -0
- nuitka/freezer/__init__.py +19 -0
- nuitka/importing/IgnoreListing.py +449 -0
- nuitka/importing/ImportCache.py +95 -0
- nuitka/importing/ImportResolving.py +186 -0
- nuitka/importing/Importing.py +1200 -0
- nuitka/importing/PreloadedPackages.py +164 -0
- nuitka/importing/Recursion.py +611 -0
- nuitka/importing/StandardLibrary.py +429 -0
- nuitka/importing/__init__.py +19 -0
- nuitka/nodes/AsyncgenNodes.py +107 -0
- nuitka/nodes/AttributeLookupNodes.py +124 -0
- nuitka/nodes/AttributeNodes.py +386 -0
- nuitka/nodes/AttributeNodesGenerated.py +10734 -0
- nuitka/nodes/BuiltinAllNodes.py +115 -0
- nuitka/nodes/BuiltinAnyNodes.py +124 -0
- nuitka/nodes/BuiltinComplexNodes.py +83 -0
- nuitka/nodes/BuiltinDecodingNodes.py +52 -0
- nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
- nuitka/nodes/BuiltinDictNodes.py +140 -0
- nuitka/nodes/BuiltinFormatNodes.py +159 -0
- nuitka/nodes/BuiltinHashNodes.py +63 -0
- nuitka/nodes/BuiltinInputNodes.py +39 -0
- nuitka/nodes/BuiltinIntegerNodes.py +170 -0
- nuitka/nodes/BuiltinIteratorNodes.py +391 -0
- nuitka/nodes/BuiltinLenNodes.py +61 -0
- nuitka/nodes/BuiltinNextNodes.py +111 -0
- nuitka/nodes/BuiltinOpenNodes.py +148 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
- nuitka/nodes/BuiltinRangeNodes.py +690 -0
- nuitka/nodes/BuiltinRefNodes.py +314 -0
- nuitka/nodes/BuiltinSumNodes.py +104 -0
- nuitka/nodes/BuiltinTypeNodes.py +454 -0
- nuitka/nodes/BuiltinVarsNodes.py +44 -0
- nuitka/nodes/BytesNodes.py +829 -0
- nuitka/nodes/CallNodes.py +217 -0
- nuitka/nodes/Checkers.py +55 -0
- nuitka/nodes/ChildrenHavingMixins.py +21576 -0
- nuitka/nodes/ClassNodes.py +286 -0
- nuitka/nodes/CodeObjectSpecs.py +230 -0
- nuitka/nodes/ComparisonNodes.py +687 -0
- nuitka/nodes/ConditionalNodes.py +884 -0
- nuitka/nodes/ConstantRefNodes.py +1717 -0
- nuitka/nodes/ContainerMakingNodes.py +408 -0
- nuitka/nodes/ContainerOperationNodes.py +87 -0
- nuitka/nodes/CoroutineNodes.py +144 -0
- nuitka/nodes/CtypesNodes.py +51 -0
- nuitka/nodes/DictionaryNodes.py +1513 -0
- nuitka/nodes/ExceptionNodes.py +393 -0
- nuitka/nodes/ExecEvalNodes.py +229 -0
- nuitka/nodes/ExpressionBases.py +1301 -0
- nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
- nuitka/nodes/ExpressionShapeMixins.py +886 -0
- nuitka/nodes/FrameNodes.py +413 -0
- nuitka/nodes/FunctionAttributeNodes.py +102 -0
- nuitka/nodes/FunctionNodes.py +1303 -0
- nuitka/nodes/FutureSpecs.py +224 -0
- nuitka/nodes/GeneratorNodes.py +201 -0
- nuitka/nodes/GlobalsLocalsNodes.py +209 -0
- nuitka/nodes/HardImportNodesGenerated.py +3599 -0
- nuitka/nodes/ImportHardNodes.py +185 -0
- nuitka/nodes/ImportNodes.py +1366 -0
- nuitka/nodes/IndicatorMixins.py +79 -0
- nuitka/nodes/InjectCNodes.py +51 -0
- nuitka/nodes/IterationHandles.py +407 -0
- nuitka/nodes/KeyValuePairNodes.py +378 -0
- nuitka/nodes/ListOperationNodes.py +525 -0
- nuitka/nodes/LocalsDictNodes.py +717 -0
- nuitka/nodes/LocalsScopes.py +505 -0
- nuitka/nodes/LoopNodes.py +445 -0
- nuitka/nodes/MatchNodes.py +60 -0
- nuitka/nodes/ModuleAttributeNodes.py +180 -0
- nuitka/nodes/ModuleNodes.py +1137 -0
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/NodeBases.py +890 -0
- nuitka/nodes/NodeMakingHelpers.py +481 -0
- nuitka/nodes/NodeMetaClasses.py +172 -0
- nuitka/nodes/OperatorNodes.py +944 -0
- nuitka/nodes/OperatorNodesUnary.py +403 -0
- nuitka/nodes/OsSysNodes.py +215 -0
- nuitka/nodes/OutlineNodes.py +372 -0
- nuitka/nodes/PackageMetadataNodes.py +982 -0
- nuitka/nodes/PackageResourceNodes.py +424 -0
- nuitka/nodes/PrintNodes.py +105 -0
- nuitka/nodes/ReturnNodes.py +255 -0
- nuitka/nodes/SideEffectNodes.py +139 -0
- nuitka/nodes/SliceNodes.py +386 -0
- nuitka/nodes/StatementBasesGenerated.py +3419 -0
- nuitka/nodes/StatementNodes.py +316 -0
- nuitka/nodes/StrNodes.py +919 -0
- nuitka/nodes/StringConcatenationNodes.py +103 -0
- nuitka/nodes/SubscriptNodes.py +245 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TryNodes.py +519 -0
- nuitka/nodes/TypeMatchNodes.py +65 -0
- nuitka/nodes/TypeNodes.py +390 -0
- nuitka/nodes/VariableAssignNodes.py +1177 -0
- nuitka/nodes/VariableDelNodes.py +320 -0
- nuitka/nodes/VariableNameNodes.py +153 -0
- nuitka/nodes/VariableRefNodes.py +895 -0
- nuitka/nodes/VariableReleaseNodes.py +153 -0
- nuitka/nodes/YieldNodes.py +121 -0
- nuitka/nodes/__init__.py +19 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
- nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +255 -0
- nuitka/nodes/shapes/StandardShapes.py +1384 -0
- nuitka/nodes/shapes/__init__.py +19 -0
- nuitka/optimizations/BytecodeDemotion.py +105 -0
- nuitka/optimizations/FunctionInlining.py +110 -0
- nuitka/optimizations/Graphs.py +70 -0
- nuitka/optimizations/Optimization.py +363 -0
- nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
- nuitka/optimizations/Tags.py +76 -0
- nuitka/optimizations/TraceCollections.py +1257 -0
- nuitka/optimizations/ValueTraces.py +980 -0
- nuitka/optimizations/__init__.py +19 -0
- nuitka/pgo/PGO.py +160 -0
- nuitka/pgo/__init__.py +19 -0
- nuitka/plugins/PluginBase.py +1924 -0
- nuitka/plugins/Plugins.py +2007 -0
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/__init__.py +19 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
- nuitka/plugins/standard/DataFilesPlugin.py +311 -0
- nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
- nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
- nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
- nuitka/plugins/standard/DillPlugin.py +137 -0
- nuitka/plugins/standard/DllFilesPlugin.py +527 -0
- nuitka/plugins/standard/EnumPlugin.py +64 -0
- nuitka/plugins/standard/EventletPlugin.py +57 -0
- nuitka/plugins/standard/GeventPlugin.py +64 -0
- nuitka/plugins/standard/GiPlugin.py +118 -0
- nuitka/plugins/standard/GlfwPlugin.py +138 -0
- nuitka/plugins/standard/ImplicitImports.py +845 -0
- nuitka/plugins/standard/KivyPlugin.py +141 -0
- nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
- nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
- nuitka/plugins/standard/NumpyPlugin.py +35 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
- nuitka/plugins/standard/PbrPlugin.py +62 -0
- nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
- nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
- nuitka/plugins/standard/PmwPlugin.py +248 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
- nuitka/plugins/standard/PywebViewPlugin.py +81 -0
- nuitka/plugins/standard/SpacyPlugin.py +137 -0
- nuitka/plugins/standard/TensorflowPlugin.py +35 -0
- nuitka/plugins/standard/TkinterPlugin.py +416 -0
- nuitka/plugins/standard/TorchPlugin.py +35 -0
- nuitka/plugins/standard/TransformersPlugin.py +121 -0
- nuitka/plugins/standard/TrioPlugin.py +33 -0
- nuitka/plugins/standard/UpxPlugin.py +174 -0
- nuitka/plugins/standard/__init__.py +19 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
- nuitka/reports/CompilationReportReader.py +83 -0
- nuitka/reports/LicenseReport.rst.j2 +41 -0
- nuitka/reports/Reports.py +961 -0
- nuitka/reports/__init__.py +19 -0
- nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
- nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
- nuitka/specs/BuiltinListOperationSpecs.py +80 -0
- nuitka/specs/BuiltinParameterSpecs.py +831 -0
- nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
- nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
- nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
- nuitka/specs/HardImportSpecs.py +236 -0
- nuitka/specs/ParameterSpecs.py +630 -0
- nuitka/specs/__init__.py +19 -0
- nuitka/tools/Basics.py +55 -0
- nuitka/tools/__init__.py +19 -0
- nuitka/tools/commercial/__init__.py +21 -0
- nuitka/tools/data_composer/DataComposer.py +593 -0
- nuitka/tools/data_composer/__init__.py +19 -0
- nuitka/tools/data_composer/__main__.py +41 -0
- nuitka/tools/environments/CreateEnvironment.py +69 -0
- nuitka/tools/environments/Virtualenv.py +158 -0
- nuitka/tools/environments/__init__.py +19 -0
- nuitka/tools/general/__init__.py +19 -0
- nuitka/tools/general/dll_report/__init__.py +19 -0
- nuitka/tools/general/dll_report/__main__.py +83 -0
- nuitka/tools/general/find_module/FindModuleCode.py +127 -0
- nuitka/tools/general/find_module/__init__.py +19 -0
- nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
- nuitka/tools/general/generate_header/__init__.py +19 -0
- nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
- nuitka/tools/onefile_compressor/__init__.py +19 -0
- nuitka/tools/onefile_compressor/__main__.py +41 -0
- nuitka/tools/podman/Podman.py +55 -0
- nuitka/tools/podman/__init__.py +19 -0
- nuitka/tools/podman/__main__.py +425 -0
- nuitka/tools/profiler/__init__.py +19 -0
- nuitka/tools/profiler/__main__.py +93 -0
- nuitka/tools/scanning/DisplayDistributions.py +39 -0
- nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
- nuitka/tools/scanning/DisplayPackageData.py +73 -0
- nuitka/tools/scanning/__init__.py +19 -0
- nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
- nuitka/tools/specialize/Common.py +380 -0
- nuitka/tools/specialize/SpecializeC.py +1483 -0
- nuitka/tools/specialize/SpecializePython.py +1151 -0
- nuitka/tools/specialize/__init__.py +19 -0
- nuitka/tools/testing/Common.py +2007 -0
- nuitka/tools/testing/Constructs.py +53 -0
- nuitka/tools/testing/DocTests.py +156 -0
- nuitka/tools/testing/OutputComparison.py +313 -0
- nuitka/tools/testing/Pythons.py +34 -0
- nuitka/tools/testing/RuntimeTracing.py +260 -0
- nuitka/tools/testing/SearchModes.py +208 -0
- nuitka/tools/testing/Valgrind.py +103 -0
- nuitka/tools/testing/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
- nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
- nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
- nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
- nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
- nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
- nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
- nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
- nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
- nuitka/tools/watch/AutoStage.py +145 -0
- nuitka/tools/watch/Common.py +55 -0
- nuitka/tools/watch/Conda.py +125 -0
- nuitka/tools/watch/GitHub.py +113 -0
- nuitka/tools/watch/Pacman.py +73 -0
- nuitka/tools/watch/Pipenv.py +145 -0
- nuitka/tools/watch/__init__.py +19 -0
- nuitka/tools/watch/__main__.py +615 -0
- nuitka/tree/Building.py +1459 -0
- nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
- nuitka/tree/Extractions.py +48 -0
- nuitka/tree/FutureSpecState.py +71 -0
- nuitka/tree/InternalModule.py +96 -0
- nuitka/tree/Operations.py +45 -0
- nuitka/tree/ReformulationAssertStatements.py +97 -0
- nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
- nuitka/tree/ReformulationBooleanExpressions.py +97 -0
- nuitka/tree/ReformulationCallExpressions.py +314 -0
- nuitka/tree/ReformulationClasses.py +407 -0
- nuitka/tree/ReformulationClasses3.py +1149 -0
- nuitka/tree/ReformulationComparisonExpressions.py +174 -0
- nuitka/tree/ReformulationContractionExpressions.py +676 -0
- nuitka/tree/ReformulationDictionaryCreation.py +304 -0
- nuitka/tree/ReformulationExecStatements.py +386 -0
- nuitka/tree/ReformulationForLoopStatements.py +215 -0
- nuitka/tree/ReformulationFunctionStatements.py +931 -0
- nuitka/tree/ReformulationImportStatements.py +333 -0
- nuitka/tree/ReformulationLambdaExpressions.py +185 -0
- nuitka/tree/ReformulationMatchStatements.py +797 -0
- nuitka/tree/ReformulationMultidist.py +80 -0
- nuitka/tree/ReformulationNamespacePackages.py +239 -0
- nuitka/tree/ReformulationPrintStatements.py +127 -0
- nuitka/tree/ReformulationSequenceCreation.py +438 -0
- nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
- nuitka/tree/ReformulationTryExceptStatements.py +418 -0
- nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
- nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
- nuitka/tree/ReformulationWithStatements.py +382 -0
- nuitka/tree/ReformulationYieldExpressions.py +133 -0
- nuitka/tree/SourceHandling.py +476 -0
- nuitka/tree/SyntaxErrors.py +143 -0
- nuitka/tree/TreeHelpers.py +720 -0
- nuitka/tree/VariableClosure.py +483 -0
- nuitka/tree/__init__.py +19 -0
- nuitka/utils/AppDirs.py +104 -0
- nuitka/utils/CStrings.py +208 -0
- nuitka/utils/CommandLineOptions.py +207 -0
- nuitka/utils/Distributions.py +728 -0
- nuitka/utils/Download.py +217 -0
- nuitka/utils/Execution.py +517 -0
- nuitka/utils/FileOperations.py +1587 -0
- nuitka/utils/Hashing.py +137 -0
- nuitka/utils/Images.py +79 -0
- nuitka/utils/Importing.py +335 -0
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +254 -0
- nuitka/utils/InstanceCounters.py +86 -0
- nuitka/utils/Jinja2.py +158 -0
- nuitka/utils/Json.py +40 -0
- nuitka/utils/MacOSApp.py +134 -0
- nuitka/utils/MemoryUsage.py +165 -0
- nuitka/utils/ModuleNames.py +317 -0
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/ReExecute.py +152 -0
- nuitka/utils/Rest.py +60 -0
- nuitka/utils/SharedLibraries.py +1014 -0
- nuitka/utils/Shebang.py +113 -0
- nuitka/utils/Signing.py +144 -0
- nuitka/utils/SlotMetaClasses.py +57 -0
- nuitka/utils/StaticLibraries.py +260 -0
- nuitka/utils/ThreadedExecutor.py +87 -0
- nuitka/utils/Timing.py +102 -0
- nuitka/utils/Utils.py +483 -0
- nuitka/utils/WindowsFileUsage.py +337 -0
- nuitka/utils/WindowsResources.py +652 -0
- nuitka/utils/Yaml.py +247 -0
- nuitka/utils/__init__.py +19 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
- nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
- nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
- nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
- nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
- nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
- nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1582 @@
|
|
|
1
|
+
# Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
""" Optimize calls to built-in references to specific built-in calls.
|
|
5
|
+
|
|
6
|
+
For built-in name references, we check if it's one of the supported built-in
|
|
7
|
+
types, and then specialize for the ones, where it makes sense.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from nuitka.__past__ import unicode, xrange
|
|
11
|
+
from nuitka.Errors import NuitkaAssumptionError
|
|
12
|
+
from nuitka.nodes.AttributeNodes import (
|
|
13
|
+
ExpressionBuiltinGetattr,
|
|
14
|
+
ExpressionBuiltinHasattr,
|
|
15
|
+
ExpressionBuiltinSetattr,
|
|
16
|
+
makeExpressionAttributeLookup,
|
|
17
|
+
)
|
|
18
|
+
from nuitka.nodes.BuiltinAllNodes import ExpressionBuiltinAll
|
|
19
|
+
from nuitka.nodes.BuiltinAnyNodes import ExpressionBuiltinAny
|
|
20
|
+
from nuitka.nodes.BuiltinComplexNodes import (
|
|
21
|
+
ExpressionBuiltinComplex1,
|
|
22
|
+
ExpressionBuiltinComplex2,
|
|
23
|
+
)
|
|
24
|
+
from nuitka.nodes.BuiltinDecodingNodes import (
|
|
25
|
+
ExpressionBuiltinChr,
|
|
26
|
+
ExpressionBuiltinOrd,
|
|
27
|
+
)
|
|
28
|
+
from nuitka.nodes.BuiltinDecoratorNodes import (
|
|
29
|
+
ExpressionBuiltinClassmethod,
|
|
30
|
+
ExpressionBuiltinStaticmethod,
|
|
31
|
+
)
|
|
32
|
+
from nuitka.nodes.BuiltinDictNodes import ExpressionBuiltinDict
|
|
33
|
+
from nuitka.nodes.BuiltinFormatNodes import (
|
|
34
|
+
ExpressionBuiltinAscii,
|
|
35
|
+
ExpressionBuiltinBin,
|
|
36
|
+
ExpressionBuiltinFormat,
|
|
37
|
+
ExpressionBuiltinHex,
|
|
38
|
+
ExpressionBuiltinId,
|
|
39
|
+
ExpressionBuiltinOct,
|
|
40
|
+
)
|
|
41
|
+
from nuitka.nodes.BuiltinHashNodes import ExpressionBuiltinHash
|
|
42
|
+
from nuitka.nodes.BuiltinInputNodes import ExpressionBuiltinInput
|
|
43
|
+
from nuitka.nodes.BuiltinIntegerNodes import (
|
|
44
|
+
ExpressionBuiltinInt1,
|
|
45
|
+
ExpressionBuiltinInt2,
|
|
46
|
+
)
|
|
47
|
+
from nuitka.nodes.BuiltinIteratorNodes import (
|
|
48
|
+
ExpressionBuiltinIter1,
|
|
49
|
+
ExpressionBuiltinIter2,
|
|
50
|
+
)
|
|
51
|
+
from nuitka.nodes.BuiltinLenNodes import ExpressionBuiltinLen
|
|
52
|
+
from nuitka.nodes.BuiltinNextNodes import (
|
|
53
|
+
ExpressionBuiltinNext1,
|
|
54
|
+
ExpressionBuiltinNext2,
|
|
55
|
+
)
|
|
56
|
+
from nuitka.nodes.BuiltinOpenNodes import (
|
|
57
|
+
ExpressionBuiltinOpenP2,
|
|
58
|
+
ExpressionBuiltinOpenP3,
|
|
59
|
+
)
|
|
60
|
+
from nuitka.nodes.BuiltinRangeNodes import (
|
|
61
|
+
ExpressionBuiltinRange1,
|
|
62
|
+
ExpressionBuiltinRange2,
|
|
63
|
+
ExpressionBuiltinRange3,
|
|
64
|
+
ExpressionBuiltinXrange1,
|
|
65
|
+
ExpressionBuiltinXrange2,
|
|
66
|
+
ExpressionBuiltinXrange3,
|
|
67
|
+
)
|
|
68
|
+
from nuitka.nodes.BuiltinRefNodes import (
|
|
69
|
+
ExpressionBuiltinAnonymousRef,
|
|
70
|
+
makeExpressionBuiltinTypeRef,
|
|
71
|
+
)
|
|
72
|
+
from nuitka.nodes.BuiltinSumNodes import (
|
|
73
|
+
ExpressionBuiltinSum1,
|
|
74
|
+
ExpressionBuiltinSum2,
|
|
75
|
+
)
|
|
76
|
+
from nuitka.nodes.BuiltinTypeNodes import (
|
|
77
|
+
ExpressionBuiltinBool,
|
|
78
|
+
ExpressionBuiltinBytearray1,
|
|
79
|
+
ExpressionBuiltinBytearray3,
|
|
80
|
+
ExpressionBuiltinFloat,
|
|
81
|
+
ExpressionBuiltinFrozenset,
|
|
82
|
+
ExpressionBuiltinList,
|
|
83
|
+
ExpressionBuiltinSet,
|
|
84
|
+
ExpressionBuiltinStrP2,
|
|
85
|
+
ExpressionBuiltinStrP3,
|
|
86
|
+
ExpressionBuiltinTuple,
|
|
87
|
+
ExpressionBuiltinUnicodeP2,
|
|
88
|
+
)
|
|
89
|
+
from nuitka.nodes.BuiltinVarsNodes import ExpressionBuiltinVars
|
|
90
|
+
from nuitka.nodes.CallNodes import makeExpressionCall
|
|
91
|
+
from nuitka.nodes.ClassNodes import ExpressionBuiltinType3
|
|
92
|
+
from nuitka.nodes.ComparisonNodes import ExpressionComparisonIs
|
|
93
|
+
from nuitka.nodes.ConditionalNodes import (
|
|
94
|
+
ExpressionConditional,
|
|
95
|
+
makeStatementConditional,
|
|
96
|
+
)
|
|
97
|
+
from nuitka.nodes.ConstantRefNodes import makeConstantRefNode
|
|
98
|
+
from nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTupleOrConstant
|
|
99
|
+
from nuitka.nodes.ExecEvalNodes import (
|
|
100
|
+
ExpressionBuiltinCompile,
|
|
101
|
+
ExpressionBuiltinEval,
|
|
102
|
+
)
|
|
103
|
+
from nuitka.nodes.GlobalsLocalsNodes import (
|
|
104
|
+
ExpressionBuiltinDir1,
|
|
105
|
+
ExpressionBuiltinGlobals,
|
|
106
|
+
)
|
|
107
|
+
from nuitka.nodes.ImportNodes import ExpressionBuiltinImport
|
|
108
|
+
from nuitka.nodes.KeyValuePairNodes import (
|
|
109
|
+
makeKeyValuePairExpressionsFromKwArgs,
|
|
110
|
+
)
|
|
111
|
+
from nuitka.nodes.NodeMakingHelpers import (
|
|
112
|
+
makeConstantReplacementNode,
|
|
113
|
+
makeExpressionBuiltinLocals,
|
|
114
|
+
makeRaiseExceptionReplacementExpression,
|
|
115
|
+
makeRaiseExceptionReplacementExpressionFromInstance,
|
|
116
|
+
)
|
|
117
|
+
from nuitka.nodes.OperatorNodes import ExpressionOperationBinaryDivmod
|
|
118
|
+
from nuitka.nodes.OperatorNodesUnary import (
|
|
119
|
+
ExpressionOperationNot,
|
|
120
|
+
ExpressionOperationUnaryAbs,
|
|
121
|
+
ExpressionOperationUnaryRepr,
|
|
122
|
+
)
|
|
123
|
+
from nuitka.nodes.OutlineNodes import ExpressionOutlineBody
|
|
124
|
+
from nuitka.nodes.ReturnNodes import makeStatementReturn
|
|
125
|
+
from nuitka.nodes.SliceNodes import makeExpressionBuiltinSlice
|
|
126
|
+
from nuitka.nodes.TypeNodes import (
|
|
127
|
+
ExpressionBuiltinIsinstance,
|
|
128
|
+
ExpressionBuiltinIssubclass,
|
|
129
|
+
ExpressionBuiltinSuper0,
|
|
130
|
+
ExpressionBuiltinSuper1,
|
|
131
|
+
ExpressionBuiltinSuper2,
|
|
132
|
+
ExpressionBuiltinType1,
|
|
133
|
+
)
|
|
134
|
+
from nuitka.nodes.VariableAssignNodes import (
|
|
135
|
+
makeStatementAssignmentVariable,
|
|
136
|
+
makeStatementDelVariable,
|
|
137
|
+
)
|
|
138
|
+
from nuitka.nodes.VariableRefNodes import (
|
|
139
|
+
ExpressionTempVariableRef,
|
|
140
|
+
ExpressionVariableRef,
|
|
141
|
+
)
|
|
142
|
+
from nuitka.PythonVersions import python_version
|
|
143
|
+
from nuitka.specs import BuiltinParameterSpecs
|
|
144
|
+
from nuitka.tree.ReformulationExecStatements import wrapEvalGlobalsAndLocals
|
|
145
|
+
from nuitka.tree.ReformulationTryFinallyStatements import (
|
|
146
|
+
makeTryFinallyStatement,
|
|
147
|
+
)
|
|
148
|
+
from nuitka.tree.TreeHelpers import (
|
|
149
|
+
makeCallNode,
|
|
150
|
+
makeStatementsSequence,
|
|
151
|
+
makeStatementsSequenceFromStatement,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def dir_extractor(node):
|
|
156
|
+
locals_scope = node.subnode_called.getLocalsScope()
|
|
157
|
+
|
|
158
|
+
def buildDirEmptyCase(source_ref):
|
|
159
|
+
source = makeExpressionBuiltinLocals(
|
|
160
|
+
locals_scope=locals_scope, source_ref=source_ref
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
result = makeCallNode(
|
|
164
|
+
makeExpressionAttributeLookup(
|
|
165
|
+
expression=source, attribute_name="keys", source_ref=source_ref
|
|
166
|
+
),
|
|
167
|
+
source_ref,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
# For Python3, keys doesn't really return values, but instead a handle
|
|
171
|
+
# only, but we want it to be a list.
|
|
172
|
+
if python_version >= 0x300:
|
|
173
|
+
result = ExpressionBuiltinList(value=result, source_ref=source_ref)
|
|
174
|
+
|
|
175
|
+
return result
|
|
176
|
+
|
|
177
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
178
|
+
node=node,
|
|
179
|
+
# TODO: Needs locals_scope attached.
|
|
180
|
+
builtin_class=ExpressionBuiltinDir1,
|
|
181
|
+
builtin_spec=BuiltinParameterSpecs.builtin_dir_spec,
|
|
182
|
+
empty_special_class=buildDirEmptyCase,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def vars_extractor(node):
|
|
187
|
+
locals_scope = node.subnode_called.getLocalsScope()
|
|
188
|
+
|
|
189
|
+
def selectVarsEmptyClass(source_ref):
|
|
190
|
+
return makeExpressionBuiltinLocals(
|
|
191
|
+
locals_scope=locals_scope, source_ref=source_ref
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
195
|
+
node=node,
|
|
196
|
+
# TODO: Needs locals_cope attached
|
|
197
|
+
builtin_class=ExpressionBuiltinVars,
|
|
198
|
+
builtin_spec=BuiltinParameterSpecs.builtin_vars_spec,
|
|
199
|
+
empty_special_class=selectVarsEmptyClass,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def import_extractor(node):
|
|
204
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
205
|
+
node=node,
|
|
206
|
+
builtin_class=ExpressionBuiltinImport,
|
|
207
|
+
builtin_spec=BuiltinParameterSpecs.builtin_import_spec,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def type_extractor(node):
|
|
212
|
+
args = node.subnode_args
|
|
213
|
+
|
|
214
|
+
if args is None:
|
|
215
|
+
iter_length = 0
|
|
216
|
+
else:
|
|
217
|
+
iter_length = args.getIterationLength()
|
|
218
|
+
|
|
219
|
+
if iter_length == 1:
|
|
220
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
221
|
+
node=node,
|
|
222
|
+
builtin_class=ExpressionBuiltinType1,
|
|
223
|
+
builtin_spec=BuiltinParameterSpecs.builtin_type1_spec,
|
|
224
|
+
)
|
|
225
|
+
elif iter_length == 3:
|
|
226
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
227
|
+
node=node,
|
|
228
|
+
builtin_class=ExpressionBuiltinType3,
|
|
229
|
+
builtin_spec=BuiltinParameterSpecs.builtin_type3_spec,
|
|
230
|
+
)
|
|
231
|
+
else:
|
|
232
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
233
|
+
expression=node, exception=TypeError("type() takes 1 or 3 arguments")
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def iter_extractor(node):
|
|
238
|
+
def wrapIterCreation(callable_arg, sentinel, source_ref):
|
|
239
|
+
if sentinel is None:
|
|
240
|
+
return ExpressionBuiltinIter1(value=callable_arg, source_ref=source_ref)
|
|
241
|
+
else:
|
|
242
|
+
return ExpressionBuiltinIter2(
|
|
243
|
+
callable_arg=callable_arg, sentinel=sentinel, source_ref=source_ref
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
247
|
+
node=node,
|
|
248
|
+
builtin_class=wrapIterCreation,
|
|
249
|
+
builtin_spec=BuiltinParameterSpecs.builtin_iter_spec,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
def next_extractor(node):
|
|
254
|
+
# Split up next with and without defaults, they are not going to behave
|
|
255
|
+
# really very similar.
|
|
256
|
+
def selectNextBuiltinClass(iterator, default, source_ref):
|
|
257
|
+
if default is None:
|
|
258
|
+
return ExpressionBuiltinNext1(value=iterator, source_ref=source_ref)
|
|
259
|
+
else:
|
|
260
|
+
return ExpressionBuiltinNext2(
|
|
261
|
+
iterator=iterator, default=default, source_ref=source_ref
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
265
|
+
node=node,
|
|
266
|
+
builtin_class=selectNextBuiltinClass,
|
|
267
|
+
builtin_spec=BuiltinParameterSpecs.builtin_next_spec,
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
def sum_extractor(node):
|
|
272
|
+
# Split up sumwith and without start value, one is much easier.
|
|
273
|
+
def selectSumBuiltinClass(sequence, start, source_ref):
|
|
274
|
+
if start is None:
|
|
275
|
+
return ExpressionBuiltinSum1(sequence=sequence, source_ref=source_ref)
|
|
276
|
+
else:
|
|
277
|
+
return ExpressionBuiltinSum2(
|
|
278
|
+
sequence=sequence, start=start, source_ref=source_ref
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
def makeSum0(source_ref):
|
|
282
|
+
# pylint: disable=unused-argument
|
|
283
|
+
|
|
284
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
285
|
+
expression=node,
|
|
286
|
+
exception=TypeError(
|
|
287
|
+
"sum expected at least 1 arguments, got 0"
|
|
288
|
+
if python_version < 0x380
|
|
289
|
+
else "sum() takes at least 1 positional argument (0 given)"
|
|
290
|
+
),
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
294
|
+
node=node,
|
|
295
|
+
builtin_class=selectSumBuiltinClass,
|
|
296
|
+
builtin_spec=BuiltinParameterSpecs.builtin_sum_spec,
|
|
297
|
+
empty_special_class=makeSum0,
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
def dict_extractor(node):
|
|
302
|
+
# The "dict" built-in is a bit strange in that it accepts a position
|
|
303
|
+
# parameter, or not, but won't have a default value.
|
|
304
|
+
def wrapExpressionBuiltinDictCreation(positional_args, dict_star_arg, source_ref):
|
|
305
|
+
if positional_args:
|
|
306
|
+
# Only one allowed, the spec converted too many into an exception.
|
|
307
|
+
(pos_arg,) = positional_args
|
|
308
|
+
else:
|
|
309
|
+
pos_arg = None
|
|
310
|
+
|
|
311
|
+
return ExpressionBuiltinDict(
|
|
312
|
+
pos_arg=pos_arg,
|
|
313
|
+
pairs=makeKeyValuePairExpressionsFromKwArgs(dict_star_arg),
|
|
314
|
+
source_ref=source_ref,
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
318
|
+
node=node,
|
|
319
|
+
builtin_class=wrapExpressionBuiltinDictCreation,
|
|
320
|
+
builtin_spec=BuiltinParameterSpecs.builtin_dict_spec,
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
def chr_extractor(node):
|
|
325
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
326
|
+
node=node,
|
|
327
|
+
builtin_class=ExpressionBuiltinChr,
|
|
328
|
+
builtin_spec=BuiltinParameterSpecs.builtin_chr_spec,
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
def ord_extractor(node):
|
|
333
|
+
def makeOrd0(source_ref):
|
|
334
|
+
# pylint: disable=unused-argument
|
|
335
|
+
|
|
336
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
337
|
+
expression=node,
|
|
338
|
+
exception=TypeError("ord() takes exactly one argument (0 given)"),
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
342
|
+
node=node,
|
|
343
|
+
builtin_class=ExpressionBuiltinOrd,
|
|
344
|
+
builtin_spec=BuiltinParameterSpecs.builtin_ord_spec,
|
|
345
|
+
empty_special_class=makeOrd0,
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
def bin_extractor(node):
|
|
350
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
351
|
+
node=node,
|
|
352
|
+
builtin_class=ExpressionBuiltinBin,
|
|
353
|
+
builtin_spec=BuiltinParameterSpecs.builtin_bin_spec,
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def oct_extractor(node):
|
|
358
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
359
|
+
node=node,
|
|
360
|
+
builtin_class=ExpressionBuiltinOct,
|
|
361
|
+
builtin_spec=BuiltinParameterSpecs.builtin_oct_spec,
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
def hex_extractor(node):
|
|
366
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
367
|
+
node=node,
|
|
368
|
+
builtin_class=ExpressionBuiltinHex,
|
|
369
|
+
builtin_spec=BuiltinParameterSpecs.builtin_hex_spec,
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
def id_extractor(node):
|
|
374
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
375
|
+
node=node,
|
|
376
|
+
builtin_class=ExpressionBuiltinId,
|
|
377
|
+
builtin_spec=BuiltinParameterSpecs.builtin_id_spec,
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
def repr_extractor(node):
|
|
382
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
383
|
+
node=node,
|
|
384
|
+
builtin_class=ExpressionOperationUnaryRepr,
|
|
385
|
+
builtin_spec=BuiltinParameterSpecs.builtin_repr_spec,
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
if python_version >= 0x300:
|
|
390
|
+
|
|
391
|
+
def ascii_extractor(node):
|
|
392
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
393
|
+
node=node,
|
|
394
|
+
builtin_class=ExpressionBuiltinAscii,
|
|
395
|
+
builtin_spec=BuiltinParameterSpecs.builtin_repr_spec,
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def range_extractor(node):
|
|
400
|
+
def selectRangeBuiltin(low, high, step, source_ref):
|
|
401
|
+
if high is None:
|
|
402
|
+
return ExpressionBuiltinRange1(low=low, source_ref=source_ref)
|
|
403
|
+
elif step is None:
|
|
404
|
+
return ExpressionBuiltinRange2(low=low, high=high, source_ref=source_ref)
|
|
405
|
+
else:
|
|
406
|
+
return ExpressionBuiltinRange3(
|
|
407
|
+
low=low, high=high, step=step, source_ref=source_ref
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
def makeRange0(source_ref):
|
|
411
|
+
# pylint: disable=unused-argument
|
|
412
|
+
try:
|
|
413
|
+
range()
|
|
414
|
+
except Exception as e: # We want to broad here, pylint: disable=broad-except
|
|
415
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
416
|
+
expression=node, exception=e
|
|
417
|
+
)
|
|
418
|
+
else:
|
|
419
|
+
raise NuitkaAssumptionError("range without argument is expected to raise")
|
|
420
|
+
|
|
421
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
422
|
+
node=node,
|
|
423
|
+
builtin_class=selectRangeBuiltin,
|
|
424
|
+
builtin_spec=BuiltinParameterSpecs.builtin_range_spec,
|
|
425
|
+
empty_special_class=makeRange0,
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
def xrange_extractor(node):
|
|
430
|
+
def selectXrangeBuiltin(low, high, step, source_ref):
|
|
431
|
+
if high is None:
|
|
432
|
+
return ExpressionBuiltinXrange1(low=low, source_ref=source_ref)
|
|
433
|
+
elif step is None:
|
|
434
|
+
return ExpressionBuiltinXrange2(low=low, high=high, source_ref=source_ref)
|
|
435
|
+
else:
|
|
436
|
+
return ExpressionBuiltinXrange3(
|
|
437
|
+
low=low, high=high, step=step, source_ref=source_ref
|
|
438
|
+
)
|
|
439
|
+
|
|
440
|
+
def makeXrange0(source_ref):
|
|
441
|
+
# pylint: disable=unused-argument
|
|
442
|
+
try:
|
|
443
|
+
xrange()
|
|
444
|
+
except Exception as e: # We want to broad here, pylint: disable=broad-except
|
|
445
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
446
|
+
expression=node, exception=e
|
|
447
|
+
)
|
|
448
|
+
else:
|
|
449
|
+
raise NuitkaAssumptionError("range without argument is expected to raise")
|
|
450
|
+
|
|
451
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
452
|
+
node=node,
|
|
453
|
+
builtin_class=selectXrangeBuiltin,
|
|
454
|
+
builtin_spec=BuiltinParameterSpecs.builtin_xrange_spec,
|
|
455
|
+
empty_special_class=makeXrange0,
|
|
456
|
+
)
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
def len_extractor(node):
|
|
460
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
461
|
+
node=node,
|
|
462
|
+
builtin_class=ExpressionBuiltinLen,
|
|
463
|
+
builtin_spec=BuiltinParameterSpecs.builtin_len_spec,
|
|
464
|
+
)
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def all_extractor(node):
|
|
468
|
+
# pylint: disable=unused-argument
|
|
469
|
+
def makeAll0(source_ref):
|
|
470
|
+
exception_message = "all() takes exactly one argument (0 given)"
|
|
471
|
+
|
|
472
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
473
|
+
expression=node, exception=TypeError(exception_message)
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
477
|
+
node=node,
|
|
478
|
+
builtin_class=ExpressionBuiltinAll,
|
|
479
|
+
builtin_spec=BuiltinParameterSpecs.builtin_all_spec,
|
|
480
|
+
empty_special_class=makeAll0,
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
def abs_extractor(node):
|
|
485
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
486
|
+
node=node,
|
|
487
|
+
builtin_class=ExpressionOperationUnaryAbs,
|
|
488
|
+
builtin_spec=BuiltinParameterSpecs.builtin_abs_spec,
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
def any_extractor(node):
|
|
493
|
+
# pylint: disable=unused-argument
|
|
494
|
+
def makeAny0(source_ref):
|
|
495
|
+
exception_message = "any() takes exactly one argument (0 given)"
|
|
496
|
+
|
|
497
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
498
|
+
expression=node, exception=TypeError(exception_message)
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
502
|
+
node=node,
|
|
503
|
+
builtin_class=ExpressionBuiltinAny,
|
|
504
|
+
builtin_spec=BuiltinParameterSpecs.builtin_any_spec,
|
|
505
|
+
empty_special_class=makeAny0,
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def tuple_extractor(node):
|
|
510
|
+
def makeTuple0(source_ref):
|
|
511
|
+
# pylint: disable=unused-argument
|
|
512
|
+
|
|
513
|
+
return makeConstantReplacementNode(constant=(), node=node, user_provided=False)
|
|
514
|
+
|
|
515
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
516
|
+
node=node,
|
|
517
|
+
builtin_class=ExpressionBuiltinTuple,
|
|
518
|
+
builtin_spec=BuiltinParameterSpecs.builtin_tuple_spec,
|
|
519
|
+
empty_special_class=makeTuple0,
|
|
520
|
+
)
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
def list_extractor(node):
|
|
524
|
+
def makeList0(source_ref):
|
|
525
|
+
# pylint: disable=unused-argument
|
|
526
|
+
|
|
527
|
+
return makeConstantReplacementNode(constant=[], node=node, user_provided=False)
|
|
528
|
+
|
|
529
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
530
|
+
node=node,
|
|
531
|
+
builtin_class=ExpressionBuiltinList,
|
|
532
|
+
builtin_spec=BuiltinParameterSpecs.builtin_list_spec,
|
|
533
|
+
empty_special_class=makeList0,
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
def set_extractor(node):
|
|
538
|
+
def makeSet0(source_ref):
|
|
539
|
+
# pylint: disable=unused-argument
|
|
540
|
+
|
|
541
|
+
return makeConstantReplacementNode(
|
|
542
|
+
constant=set(), node=node, user_provided=False
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
546
|
+
node=node,
|
|
547
|
+
builtin_class=ExpressionBuiltinSet,
|
|
548
|
+
builtin_spec=BuiltinParameterSpecs.builtin_set_spec,
|
|
549
|
+
empty_special_class=makeSet0,
|
|
550
|
+
)
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
def frozenset_extractor(node):
|
|
554
|
+
def makeFrozenset0(source_ref):
|
|
555
|
+
# pylint: disable=unused-argument
|
|
556
|
+
|
|
557
|
+
return makeConstantReplacementNode(
|
|
558
|
+
constant=frozenset(), node=node, user_provided=False
|
|
559
|
+
)
|
|
560
|
+
|
|
561
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
562
|
+
node=node,
|
|
563
|
+
builtin_class=ExpressionBuiltinFrozenset,
|
|
564
|
+
builtin_spec=BuiltinParameterSpecs.builtin_frozenset_spec,
|
|
565
|
+
empty_special_class=makeFrozenset0,
|
|
566
|
+
)
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
def float_extractor(node):
|
|
570
|
+
def makeFloat0(source_ref):
|
|
571
|
+
# pylint: disable=unused-argument
|
|
572
|
+
|
|
573
|
+
return makeConstantReplacementNode(
|
|
574
|
+
constant=float(), node=node, user_provided=False
|
|
575
|
+
)
|
|
576
|
+
|
|
577
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
578
|
+
node=node,
|
|
579
|
+
builtin_class=ExpressionBuiltinFloat,
|
|
580
|
+
builtin_spec=BuiltinParameterSpecs.builtin_float_spec,
|
|
581
|
+
empty_special_class=makeFloat0,
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
def complex_extractor(node):
|
|
586
|
+
def makeComplex0(source_ref):
|
|
587
|
+
# pylint: disable=unused-argument
|
|
588
|
+
|
|
589
|
+
return makeConstantReplacementNode(
|
|
590
|
+
constant=complex(), node=node, user_provided=False
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
def selectComplexBuiltin(real, imag, source_ref):
|
|
594
|
+
if imag is None:
|
|
595
|
+
return ExpressionBuiltinComplex1(value=real, source_ref=source_ref)
|
|
596
|
+
else:
|
|
597
|
+
return ExpressionBuiltinComplex2(
|
|
598
|
+
real=real, imag=imag, source_ref=source_ref
|
|
599
|
+
)
|
|
600
|
+
|
|
601
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
602
|
+
node=node,
|
|
603
|
+
builtin_class=selectComplexBuiltin,
|
|
604
|
+
builtin_spec=BuiltinParameterSpecs.builtin_complex_spec,
|
|
605
|
+
empty_special_class=makeComplex0,
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
def str_extractor(node):
|
|
610
|
+
def makeStr0(source_ref):
|
|
611
|
+
# pylint: disable=unused-argument
|
|
612
|
+
|
|
613
|
+
return makeConstantReplacementNode(
|
|
614
|
+
constant=str(), node=node, user_provided=False
|
|
615
|
+
)
|
|
616
|
+
|
|
617
|
+
builtin_class = ExpressionBuiltinStrP2 if str is bytes else ExpressionBuiltinStrP3
|
|
618
|
+
|
|
619
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
620
|
+
node=node,
|
|
621
|
+
builtin_class=builtin_class,
|
|
622
|
+
builtin_spec=builtin_class.builtin_spec,
|
|
623
|
+
empty_special_class=makeStr0,
|
|
624
|
+
)
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
if python_version < 0x300:
|
|
628
|
+
|
|
629
|
+
def unicode_extractor(node):
|
|
630
|
+
def makeUnicode0(source_ref):
|
|
631
|
+
# pylint: disable=unused-argument
|
|
632
|
+
|
|
633
|
+
return makeConstantReplacementNode(
|
|
634
|
+
constant=unicode(), node=node, user_provided=False
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
638
|
+
node=node,
|
|
639
|
+
builtin_class=ExpressionBuiltinUnicodeP2,
|
|
640
|
+
builtin_spec=ExpressionBuiltinUnicodeP2.builtin_spec,
|
|
641
|
+
empty_special_class=makeUnicode0,
|
|
642
|
+
)
|
|
643
|
+
|
|
644
|
+
else:
|
|
645
|
+
from nuitka.nodes.BuiltinTypeNodes import (
|
|
646
|
+
ExpressionBuiltinBytes1,
|
|
647
|
+
ExpressionBuiltinBytes3,
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
def bytes_extractor(node):
|
|
651
|
+
def makeBytes0(source_ref):
|
|
652
|
+
# pylint: disable=unused-argument
|
|
653
|
+
|
|
654
|
+
return makeConstantReplacementNode(
|
|
655
|
+
constant=bytes(), node=node, user_provided=False
|
|
656
|
+
)
|
|
657
|
+
|
|
658
|
+
def selectBytesBuiltin(string, encoding, errors, source_ref):
|
|
659
|
+
if encoding is None and errors is None:
|
|
660
|
+
return ExpressionBuiltinBytes1(value=string, source_ref=source_ref)
|
|
661
|
+
else:
|
|
662
|
+
return ExpressionBuiltinBytes3(
|
|
663
|
+
value=string,
|
|
664
|
+
encoding=encoding,
|
|
665
|
+
errors=errors,
|
|
666
|
+
source_ref=source_ref,
|
|
667
|
+
)
|
|
668
|
+
|
|
669
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
670
|
+
node=node,
|
|
671
|
+
builtin_class=selectBytesBuiltin,
|
|
672
|
+
builtin_spec=BuiltinParameterSpecs.builtin_bytes_p3_spec,
|
|
673
|
+
empty_special_class=makeBytes0,
|
|
674
|
+
)
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
def bool_extractor(node):
|
|
678
|
+
def makeBool0(source_ref):
|
|
679
|
+
# pylint: disable=unused-argument
|
|
680
|
+
|
|
681
|
+
return makeConstantReplacementNode(
|
|
682
|
+
constant=bool(), node=node, user_provided=False
|
|
683
|
+
)
|
|
684
|
+
|
|
685
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
686
|
+
node=node,
|
|
687
|
+
builtin_class=ExpressionBuiltinBool,
|
|
688
|
+
builtin_spec=BuiltinParameterSpecs.builtin_bool_spec,
|
|
689
|
+
empty_special_class=makeBool0,
|
|
690
|
+
)
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
def int_extractor(node):
|
|
694
|
+
def makeInt0(source_ref):
|
|
695
|
+
# pylint: disable=unused-argument
|
|
696
|
+
|
|
697
|
+
return makeConstantReplacementNode(
|
|
698
|
+
constant=int(), node=node, user_provided=False
|
|
699
|
+
)
|
|
700
|
+
|
|
701
|
+
def selectIntBuiltin(value, base, source_ref):
|
|
702
|
+
if base is None:
|
|
703
|
+
return ExpressionBuiltinInt1(value=value, source_ref=source_ref)
|
|
704
|
+
else:
|
|
705
|
+
return ExpressionBuiltinInt2(value=value, base=base, source_ref=source_ref)
|
|
706
|
+
|
|
707
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
708
|
+
node=node,
|
|
709
|
+
builtin_class=selectIntBuiltin,
|
|
710
|
+
builtin_spec=BuiltinParameterSpecs.builtin_int_spec,
|
|
711
|
+
empty_special_class=makeInt0,
|
|
712
|
+
)
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
if python_version < 0x300:
|
|
716
|
+
from nuitka.nodes.BuiltinIntegerNodes import (
|
|
717
|
+
ExpressionBuiltinLong1,
|
|
718
|
+
ExpressionBuiltinLong2,
|
|
719
|
+
)
|
|
720
|
+
|
|
721
|
+
def long_extractor(node):
|
|
722
|
+
def makeLong0(source_ref):
|
|
723
|
+
# pylint: disable=unused-argument
|
|
724
|
+
|
|
725
|
+
return makeConstantReplacementNode(
|
|
726
|
+
constant=int(), node=node, user_provided=False
|
|
727
|
+
)
|
|
728
|
+
|
|
729
|
+
def selectIntBuiltin(value, base, source_ref):
|
|
730
|
+
if base is None:
|
|
731
|
+
return ExpressionBuiltinLong1(value=value, source_ref=source_ref)
|
|
732
|
+
else:
|
|
733
|
+
return ExpressionBuiltinLong2(
|
|
734
|
+
value=value, base=base, source_ref=source_ref
|
|
735
|
+
)
|
|
736
|
+
|
|
737
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
738
|
+
node=node,
|
|
739
|
+
builtin_class=selectIntBuiltin,
|
|
740
|
+
builtin_spec=BuiltinParameterSpecs.builtin_int_spec,
|
|
741
|
+
empty_special_class=makeLong0,
|
|
742
|
+
)
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
def globals_extractor(node):
|
|
746
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
747
|
+
node=node,
|
|
748
|
+
builtin_class=ExpressionBuiltinGlobals,
|
|
749
|
+
builtin_spec=BuiltinParameterSpecs.builtin_globals_spec,
|
|
750
|
+
)
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
def locals_extractor(node):
|
|
754
|
+
locals_scope = node.subnode_called.getLocalsScope()
|
|
755
|
+
|
|
756
|
+
def makeLocalsNode(source_ref):
|
|
757
|
+
return makeExpressionBuiltinLocals(
|
|
758
|
+
locals_scope=locals_scope, source_ref=source_ref
|
|
759
|
+
)
|
|
760
|
+
|
|
761
|
+
# Note: Locals on the module level is really globals.
|
|
762
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
763
|
+
node=node,
|
|
764
|
+
builtin_class=makeLocalsNode,
|
|
765
|
+
builtin_spec=BuiltinParameterSpecs.builtin_locals_spec,
|
|
766
|
+
)
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
if python_version < 0x300:
|
|
770
|
+
from nuitka.nodes.ExecEvalNodes import ExpressionBuiltinExecfile
|
|
771
|
+
|
|
772
|
+
def execfile_extractor(node):
|
|
773
|
+
def wrapExpressionBuiltinExecfileCreation(
|
|
774
|
+
filename, globals_arg, locals_arg, source_ref
|
|
775
|
+
):
|
|
776
|
+
outline_body = ExpressionOutlineBody(
|
|
777
|
+
provider=node.getParentVariableProvider(),
|
|
778
|
+
name="execfile_call",
|
|
779
|
+
source_ref=source_ref,
|
|
780
|
+
)
|
|
781
|
+
|
|
782
|
+
globals_ref, locals_ref, tried, final = wrapEvalGlobalsAndLocals(
|
|
783
|
+
provider=node.getParentVariableProvider(),
|
|
784
|
+
globals_node=globals_arg,
|
|
785
|
+
locals_node=locals_arg,
|
|
786
|
+
temp_scope=outline_body.getOutlineTempScope(),
|
|
787
|
+
source_ref=source_ref,
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
tried = makeStatementsSequence(
|
|
791
|
+
statements=(
|
|
792
|
+
tried,
|
|
793
|
+
makeStatementReturn(
|
|
794
|
+
expression=ExpressionBuiltinExecfile(
|
|
795
|
+
in_class_body=node.getParentVariableProvider().isExpressionClassBodyBase(),
|
|
796
|
+
source_code=makeCallNode(
|
|
797
|
+
makeExpressionAttributeLookup(
|
|
798
|
+
expression=ExpressionBuiltinOpenP2(
|
|
799
|
+
filename=filename,
|
|
800
|
+
mode=makeConstantRefNode(
|
|
801
|
+
constant="rU", source_ref=source_ref
|
|
802
|
+
),
|
|
803
|
+
buffering=None,
|
|
804
|
+
source_ref=source_ref,
|
|
805
|
+
),
|
|
806
|
+
attribute_name="read",
|
|
807
|
+
source_ref=source_ref,
|
|
808
|
+
),
|
|
809
|
+
source_ref,
|
|
810
|
+
),
|
|
811
|
+
globals_arg=globals_ref,
|
|
812
|
+
locals_arg=locals_ref,
|
|
813
|
+
source_ref=source_ref,
|
|
814
|
+
),
|
|
815
|
+
source_ref=source_ref,
|
|
816
|
+
),
|
|
817
|
+
),
|
|
818
|
+
allow_none=False,
|
|
819
|
+
source_ref=source_ref,
|
|
820
|
+
)
|
|
821
|
+
|
|
822
|
+
outline_body.setChildBody(
|
|
823
|
+
makeStatementsSequenceFromStatement(
|
|
824
|
+
statement=makeTryFinallyStatement(
|
|
825
|
+
provider=outline_body,
|
|
826
|
+
tried=tried,
|
|
827
|
+
final=final,
|
|
828
|
+
source_ref=source_ref,
|
|
829
|
+
)
|
|
830
|
+
)
|
|
831
|
+
)
|
|
832
|
+
|
|
833
|
+
return outline_body
|
|
834
|
+
|
|
835
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
836
|
+
node=node,
|
|
837
|
+
builtin_class=wrapExpressionBuiltinExecfileCreation,
|
|
838
|
+
builtin_spec=BuiltinParameterSpecs.builtin_execfile_spec,
|
|
839
|
+
)
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
def eval_extractor(node):
|
|
843
|
+
def wrapEvalBuiltin(source, globals_arg, locals_arg, source_ref):
|
|
844
|
+
provider = node.getParentVariableProvider()
|
|
845
|
+
|
|
846
|
+
outline_body = ExpressionOutlineBody(
|
|
847
|
+
provider=node.getParentVariableProvider(),
|
|
848
|
+
name="eval_call",
|
|
849
|
+
source_ref=source_ref,
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
globals_ref, locals_ref, tried, final = wrapEvalGlobalsAndLocals(
|
|
853
|
+
provider=provider,
|
|
854
|
+
globals_node=globals_arg,
|
|
855
|
+
locals_node=locals_arg,
|
|
856
|
+
temp_scope=outline_body.getOutlineTempScope(),
|
|
857
|
+
source_ref=source_ref,
|
|
858
|
+
)
|
|
859
|
+
|
|
860
|
+
# The wrapping should not relocate to the "source_ref".
|
|
861
|
+
assert (
|
|
862
|
+
globals_arg is None
|
|
863
|
+
or globals_ref.getSourceReference() == globals_arg.getSourceReference()
|
|
864
|
+
)
|
|
865
|
+
assert (
|
|
866
|
+
locals_arg is None
|
|
867
|
+
or locals_ref.getSourceReference() == locals_arg.getSourceReference()
|
|
868
|
+
)
|
|
869
|
+
|
|
870
|
+
source_variable = outline_body.allocateTempVariable(
|
|
871
|
+
temp_scope=None, name="source", temp_type="object"
|
|
872
|
+
)
|
|
873
|
+
|
|
874
|
+
final.setChildStatements(
|
|
875
|
+
final.subnode_statements
|
|
876
|
+
+ (
|
|
877
|
+
makeStatementDelVariable(
|
|
878
|
+
variable=source_variable, tolerant=True, source_ref=source_ref
|
|
879
|
+
),
|
|
880
|
+
)
|
|
881
|
+
)
|
|
882
|
+
|
|
883
|
+
strip_choice = makeConstantRefNode(constant=(" \t",), source_ref=source_ref)
|
|
884
|
+
|
|
885
|
+
if python_version >= 0x300:
|
|
886
|
+
strip_choice = ExpressionConditional(
|
|
887
|
+
condition=ExpressionComparisonIs(
|
|
888
|
+
left=ExpressionBuiltinType1(
|
|
889
|
+
value=ExpressionTempVariableRef(
|
|
890
|
+
variable=source_variable, source_ref=source_ref
|
|
891
|
+
),
|
|
892
|
+
source_ref=source_ref,
|
|
893
|
+
),
|
|
894
|
+
right=makeExpressionBuiltinTypeRef(
|
|
895
|
+
builtin_name="bytes", source_ref=source_ref
|
|
896
|
+
),
|
|
897
|
+
source_ref=source_ref,
|
|
898
|
+
),
|
|
899
|
+
expression_yes=makeConstantRefNode(
|
|
900
|
+
constant=(b" \t",), source_ref=source_ref
|
|
901
|
+
),
|
|
902
|
+
expression_no=strip_choice,
|
|
903
|
+
source_ref=source_ref,
|
|
904
|
+
)
|
|
905
|
+
|
|
906
|
+
# Source needs some special treatment for eval, if it's a string, it
|
|
907
|
+
# must be stripped.
|
|
908
|
+
string_fixup = makeStatementAssignmentVariable(
|
|
909
|
+
variable=source_variable,
|
|
910
|
+
source=makeExpressionCall(
|
|
911
|
+
called=makeExpressionAttributeLookup(
|
|
912
|
+
expression=ExpressionTempVariableRef(
|
|
913
|
+
variable=source_variable, source_ref=source_ref
|
|
914
|
+
),
|
|
915
|
+
attribute_name="strip",
|
|
916
|
+
source_ref=source_ref,
|
|
917
|
+
),
|
|
918
|
+
args=strip_choice, # This is a tuple
|
|
919
|
+
kw=None,
|
|
920
|
+
source_ref=source_ref,
|
|
921
|
+
),
|
|
922
|
+
source_ref=source_ref,
|
|
923
|
+
)
|
|
924
|
+
|
|
925
|
+
acceptable_builtin_types = [
|
|
926
|
+
ExpressionBuiltinAnonymousRef(builtin_name="code", source_ref=source_ref)
|
|
927
|
+
]
|
|
928
|
+
|
|
929
|
+
if python_version >= 0x270:
|
|
930
|
+
acceptable_builtin_types.append(
|
|
931
|
+
makeExpressionBuiltinTypeRef(
|
|
932
|
+
builtin_name="memoryview", source_ref=source_ref
|
|
933
|
+
)
|
|
934
|
+
)
|
|
935
|
+
|
|
936
|
+
statements = (
|
|
937
|
+
makeStatementAssignmentVariable(
|
|
938
|
+
variable=source_variable, source=source, source_ref=source_ref
|
|
939
|
+
),
|
|
940
|
+
makeStatementConditional(
|
|
941
|
+
condition=ExpressionOperationNot(
|
|
942
|
+
operand=ExpressionBuiltinIsinstance(
|
|
943
|
+
instance=ExpressionTempVariableRef(
|
|
944
|
+
variable=source_variable, source_ref=source_ref
|
|
945
|
+
),
|
|
946
|
+
classes=makeExpressionMakeTupleOrConstant(
|
|
947
|
+
elements=tuple(acceptable_builtin_types),
|
|
948
|
+
user_provided=True,
|
|
949
|
+
source_ref=source_ref,
|
|
950
|
+
),
|
|
951
|
+
source_ref=source_ref,
|
|
952
|
+
),
|
|
953
|
+
source_ref=source_ref,
|
|
954
|
+
),
|
|
955
|
+
yes_branch=string_fixup,
|
|
956
|
+
no_branch=None,
|
|
957
|
+
source_ref=source_ref,
|
|
958
|
+
),
|
|
959
|
+
makeStatementReturn(
|
|
960
|
+
expression=ExpressionBuiltinEval(
|
|
961
|
+
source_code=ExpressionTempVariableRef(
|
|
962
|
+
variable=source_variable, source_ref=source_ref
|
|
963
|
+
),
|
|
964
|
+
globals_arg=globals_ref,
|
|
965
|
+
locals_arg=locals_ref,
|
|
966
|
+
source_ref=source_ref,
|
|
967
|
+
),
|
|
968
|
+
source_ref=source_ref,
|
|
969
|
+
),
|
|
970
|
+
)
|
|
971
|
+
|
|
972
|
+
tried = makeStatementsSequence(
|
|
973
|
+
statements=(tried,) + statements, allow_none=False, source_ref=source_ref
|
|
974
|
+
)
|
|
975
|
+
|
|
976
|
+
outline_body.setChildBody(
|
|
977
|
+
makeStatementsSequenceFromStatement(
|
|
978
|
+
statement=makeTryFinallyStatement(
|
|
979
|
+
provider=outline_body,
|
|
980
|
+
tried=tried,
|
|
981
|
+
final=final,
|
|
982
|
+
source_ref=source_ref,
|
|
983
|
+
)
|
|
984
|
+
)
|
|
985
|
+
)
|
|
986
|
+
|
|
987
|
+
return outline_body
|
|
988
|
+
|
|
989
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
990
|
+
node=node,
|
|
991
|
+
builtin_class=wrapEvalBuiltin,
|
|
992
|
+
builtin_spec=BuiltinParameterSpecs.builtin_eval_spec,
|
|
993
|
+
)
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
if python_version >= 0x300:
|
|
997
|
+
from nuitka.nodes.ExecEvalNodes import ExpressionBuiltinExec
|
|
998
|
+
|
|
999
|
+
def exec_extractor(node):
|
|
1000
|
+
def wrapExpressionBuiltinExecCreation(
|
|
1001
|
+
source, globals_arg, locals_arg, closure=None, source_ref=None
|
|
1002
|
+
):
|
|
1003
|
+
provider = node.getParentVariableProvider()
|
|
1004
|
+
|
|
1005
|
+
outline_body = ExpressionOutlineBody(
|
|
1006
|
+
provider=provider, name="exec_call", source_ref=source_ref
|
|
1007
|
+
)
|
|
1008
|
+
|
|
1009
|
+
globals_ref, locals_ref, tried, final = wrapEvalGlobalsAndLocals(
|
|
1010
|
+
provider=provider,
|
|
1011
|
+
globals_node=globals_arg,
|
|
1012
|
+
locals_node=locals_arg,
|
|
1013
|
+
temp_scope=outline_body.getOutlineTempScope(),
|
|
1014
|
+
source_ref=source_ref,
|
|
1015
|
+
)
|
|
1016
|
+
|
|
1017
|
+
tried = makeStatementsSequence(
|
|
1018
|
+
statements=(
|
|
1019
|
+
tried,
|
|
1020
|
+
makeStatementReturn(
|
|
1021
|
+
expression=ExpressionBuiltinExec(
|
|
1022
|
+
source_code=source,
|
|
1023
|
+
globals_arg=globals_ref,
|
|
1024
|
+
locals_arg=locals_ref,
|
|
1025
|
+
closure=closure,
|
|
1026
|
+
source_ref=source_ref,
|
|
1027
|
+
),
|
|
1028
|
+
source_ref=source_ref,
|
|
1029
|
+
),
|
|
1030
|
+
),
|
|
1031
|
+
allow_none=False,
|
|
1032
|
+
source_ref=source_ref,
|
|
1033
|
+
)
|
|
1034
|
+
|
|
1035
|
+
# Hack: Allow some APIs to work already
|
|
1036
|
+
tried.parent = outline_body
|
|
1037
|
+
|
|
1038
|
+
outline_body.setChildBody(
|
|
1039
|
+
makeStatementsSequenceFromStatement(
|
|
1040
|
+
statement=makeTryFinallyStatement(
|
|
1041
|
+
provider=provider,
|
|
1042
|
+
tried=tried,
|
|
1043
|
+
final=final,
|
|
1044
|
+
source_ref=source_ref,
|
|
1045
|
+
)
|
|
1046
|
+
)
|
|
1047
|
+
)
|
|
1048
|
+
|
|
1049
|
+
return outline_body
|
|
1050
|
+
|
|
1051
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1052
|
+
node=node,
|
|
1053
|
+
builtin_class=wrapExpressionBuiltinExecCreation,
|
|
1054
|
+
builtin_spec=BuiltinParameterSpecs.builtin_exec_spec,
|
|
1055
|
+
)
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
def compile_extractor(node):
|
|
1059
|
+
def wrapExpressionBuiltinCompileCreation(
|
|
1060
|
+
source_code, filename, mode, flags, dont_inherit, optimize=None, source_ref=None
|
|
1061
|
+
):
|
|
1062
|
+
return ExpressionBuiltinCompile(
|
|
1063
|
+
source_code=source_code,
|
|
1064
|
+
filename=filename,
|
|
1065
|
+
mode=mode,
|
|
1066
|
+
flags=flags,
|
|
1067
|
+
dont_inherit=dont_inherit,
|
|
1068
|
+
optimize=optimize,
|
|
1069
|
+
source_ref=source_ref,
|
|
1070
|
+
)
|
|
1071
|
+
|
|
1072
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1073
|
+
node=node,
|
|
1074
|
+
builtin_class=wrapExpressionBuiltinCompileCreation,
|
|
1075
|
+
builtin_spec=BuiltinParameterSpecs.builtin_compile_spec,
|
|
1076
|
+
)
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
def open_extractor(node):
|
|
1080
|
+
def makeOpen0(source_ref):
|
|
1081
|
+
# pylint: disable=unused-argument
|
|
1082
|
+
try:
|
|
1083
|
+
# Not giving arguments or context on purpose
|
|
1084
|
+
# pylint: disable=consider-using-with,unspecified-encoding
|
|
1085
|
+
open()
|
|
1086
|
+
except Exception as e: # We want to broad here, pylint: disable=broad-except
|
|
1087
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
1088
|
+
expression=node, exception=e
|
|
1089
|
+
)
|
|
1090
|
+
else:
|
|
1091
|
+
raise NuitkaAssumptionError("open without argument is expected to raise")
|
|
1092
|
+
|
|
1093
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1094
|
+
node=node,
|
|
1095
|
+
builtin_class=(
|
|
1096
|
+
ExpressionBuiltinOpenP3 if str is not bytes else ExpressionBuiltinOpenP2
|
|
1097
|
+
),
|
|
1098
|
+
builtin_spec=BuiltinParameterSpecs.builtin_open_spec,
|
|
1099
|
+
empty_special_class=makeOpen0,
|
|
1100
|
+
)
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
def super_extractor(node):
|
|
1104
|
+
def wrapSuperBuiltin(type_arg, object_arg, source_ref):
|
|
1105
|
+
# Many cases due to complex defaulting behavior, pylint: disable=too-many-return-statements
|
|
1106
|
+
|
|
1107
|
+
if type_arg is None and python_version >= 0x300:
|
|
1108
|
+
if provider.isCompiledPythonModule():
|
|
1109
|
+
return makeRaiseExceptionReplacementExpression(
|
|
1110
|
+
expression=node,
|
|
1111
|
+
exception_type="RuntimeError",
|
|
1112
|
+
exception_value="super(): no arguments",
|
|
1113
|
+
)
|
|
1114
|
+
|
|
1115
|
+
class_variable = provider.getVariableForReference(variable_name="__class__")
|
|
1116
|
+
|
|
1117
|
+
provider.trace_collection.getVariableCurrentTrace(class_variable).addUsage()
|
|
1118
|
+
|
|
1119
|
+
type_arg = ExpressionVariableRef(
|
|
1120
|
+
# Ought to be already closure taken due to "super" flag in
|
|
1121
|
+
# tree building.
|
|
1122
|
+
variable=class_variable,
|
|
1123
|
+
source_ref=source_ref,
|
|
1124
|
+
)
|
|
1125
|
+
|
|
1126
|
+
# If we already have this as a local variable, then use that
|
|
1127
|
+
# instead.
|
|
1128
|
+
type_arg_owner = class_variable.getOwner()
|
|
1129
|
+
if type_arg_owner is provider or not (
|
|
1130
|
+
type_arg_owner.isExpressionFunctionBody()
|
|
1131
|
+
or type_arg_owner.isExpressionClassBodyBase()
|
|
1132
|
+
):
|
|
1133
|
+
return makeRaiseExceptionReplacementExpression(
|
|
1134
|
+
expression=node,
|
|
1135
|
+
exception_type=(
|
|
1136
|
+
"SystemError" if python_version < 0x331 else "RuntimeError"
|
|
1137
|
+
),
|
|
1138
|
+
exception_value="super(): __class__ cell not found",
|
|
1139
|
+
)
|
|
1140
|
+
|
|
1141
|
+
if object_arg is None:
|
|
1142
|
+
if (
|
|
1143
|
+
provider.isExpressionGeneratorObjectBody()
|
|
1144
|
+
or provider.isExpressionCoroutineObjectBody()
|
|
1145
|
+
or provider.isExpressionAsyncgenObjectBody()
|
|
1146
|
+
):
|
|
1147
|
+
parameter_provider = provider.getParentVariableProvider()
|
|
1148
|
+
else:
|
|
1149
|
+
parameter_provider = provider
|
|
1150
|
+
|
|
1151
|
+
if parameter_provider.getParameters().getArgumentCount() == 0:
|
|
1152
|
+
return makeRaiseExceptionReplacementExpression(
|
|
1153
|
+
expression=node,
|
|
1154
|
+
exception_type="RuntimeError",
|
|
1155
|
+
exception_value="super(): no arguments",
|
|
1156
|
+
)
|
|
1157
|
+
else:
|
|
1158
|
+
par1_name = parameter_provider.getParameters().getArgumentNames()[0]
|
|
1159
|
+
|
|
1160
|
+
object_variable = provider.getVariableForReference(
|
|
1161
|
+
variable_name=par1_name
|
|
1162
|
+
)
|
|
1163
|
+
|
|
1164
|
+
provider.trace_collection.getVariableCurrentTrace(
|
|
1165
|
+
object_variable
|
|
1166
|
+
).addUsage()
|
|
1167
|
+
|
|
1168
|
+
object_arg = ExpressionVariableRef(
|
|
1169
|
+
variable=object_variable, source_ref=source_ref
|
|
1170
|
+
)
|
|
1171
|
+
|
|
1172
|
+
if not object_arg.getVariable().isParameterVariable():
|
|
1173
|
+
return makeRaiseExceptionReplacementExpression(
|
|
1174
|
+
expression=node,
|
|
1175
|
+
exception_type=(
|
|
1176
|
+
"SystemError"
|
|
1177
|
+
if python_version < 0x300
|
|
1178
|
+
else "RuntimeError"
|
|
1179
|
+
),
|
|
1180
|
+
exception_value="super(): __class__ cell not found",
|
|
1181
|
+
)
|
|
1182
|
+
|
|
1183
|
+
return ExpressionBuiltinSuper0(
|
|
1184
|
+
type_arg=type_arg,
|
|
1185
|
+
object_arg=object_arg,
|
|
1186
|
+
source_ref=source_ref,
|
|
1187
|
+
)
|
|
1188
|
+
|
|
1189
|
+
if object_arg is None:
|
|
1190
|
+
return ExpressionBuiltinSuper1(
|
|
1191
|
+
type_arg=type_arg,
|
|
1192
|
+
source_ref=source_ref,
|
|
1193
|
+
)
|
|
1194
|
+
else:
|
|
1195
|
+
return ExpressionBuiltinSuper2(
|
|
1196
|
+
type_arg=type_arg,
|
|
1197
|
+
object_arg=object_arg,
|
|
1198
|
+
source_ref=source_ref,
|
|
1199
|
+
)
|
|
1200
|
+
|
|
1201
|
+
provider = node.getParentVariableProvider().getEntryPoint()
|
|
1202
|
+
|
|
1203
|
+
if not provider.isCompiledPythonModule():
|
|
1204
|
+
provider.discardFlag("has_super")
|
|
1205
|
+
|
|
1206
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1207
|
+
node=node,
|
|
1208
|
+
builtin_class=wrapSuperBuiltin,
|
|
1209
|
+
builtin_spec=BuiltinParameterSpecs.builtin_super_spec,
|
|
1210
|
+
)
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
def hasattr_extractor(node):
|
|
1214
|
+
# We need to have to builtin arguments, pylint: disable=redefined-builtin
|
|
1215
|
+
def makeExpressionBuiltinHasattr(object, name, source_ref):
|
|
1216
|
+
return ExpressionBuiltinHasattr(
|
|
1217
|
+
expression=object, name=name, source_ref=source_ref
|
|
1218
|
+
)
|
|
1219
|
+
|
|
1220
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1221
|
+
node=node,
|
|
1222
|
+
builtin_class=makeExpressionBuiltinHasattr,
|
|
1223
|
+
builtin_spec=BuiltinParameterSpecs.builtin_hasattr_spec,
|
|
1224
|
+
)
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
def getattr_extractor(node):
|
|
1228
|
+
# We need to have to builtin arguments, pylint: disable=redefined-builtin
|
|
1229
|
+
def makeExpressionBuiltinGetattr(object, name, default, source_ref):
|
|
1230
|
+
return ExpressionBuiltinGetattr(
|
|
1231
|
+
expression=object, name=name, default=default, source_ref=source_ref
|
|
1232
|
+
)
|
|
1233
|
+
|
|
1234
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1235
|
+
node=node,
|
|
1236
|
+
builtin_class=makeExpressionBuiltinGetattr,
|
|
1237
|
+
builtin_spec=BuiltinParameterSpecs.builtin_getattr_spec,
|
|
1238
|
+
)
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
def setattr_extractor(node):
|
|
1242
|
+
# We need to have to builtin arguments, pylint: disable=redefined-builtin
|
|
1243
|
+
def makeExpressionBuiltinSetattr(object, name, value, source_ref):
|
|
1244
|
+
return ExpressionBuiltinSetattr(
|
|
1245
|
+
expression=object, name=name, value=value, source_ref=source_ref
|
|
1246
|
+
)
|
|
1247
|
+
|
|
1248
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1249
|
+
node=node,
|
|
1250
|
+
builtin_class=makeExpressionBuiltinSetattr,
|
|
1251
|
+
builtin_spec=BuiltinParameterSpecs.builtin_setattr_spec,
|
|
1252
|
+
)
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
def isinstance_extractor(node):
|
|
1256
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1257
|
+
node=node,
|
|
1258
|
+
builtin_class=ExpressionBuiltinIsinstance,
|
|
1259
|
+
builtin_spec=BuiltinParameterSpecs.builtin_isinstance_spec,
|
|
1260
|
+
)
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
def issubclass_extractor(node):
|
|
1264
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1265
|
+
node=node,
|
|
1266
|
+
builtin_class=ExpressionBuiltinIssubclass,
|
|
1267
|
+
builtin_spec=BuiltinParameterSpecs.builtin_isinstance_spec,
|
|
1268
|
+
)
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
def bytearray_extractor(node):
|
|
1272
|
+
def makeBytearray0(source_ref):
|
|
1273
|
+
return makeConstantRefNode(constant=bytearray(), source_ref=source_ref)
|
|
1274
|
+
|
|
1275
|
+
def selectBytearrayBuiltinClass(string, encoding, errors, source_ref):
|
|
1276
|
+
# TODO: Highly suspicious that "errors"
|
|
1277
|
+
if encoding is None:
|
|
1278
|
+
return ExpressionBuiltinBytearray1(value=string, source_ref=source_ref)
|
|
1279
|
+
else:
|
|
1280
|
+
return ExpressionBuiltinBytearray3(
|
|
1281
|
+
string=string, encoding=encoding, errors=errors, source_ref=source_ref
|
|
1282
|
+
)
|
|
1283
|
+
|
|
1284
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1285
|
+
node=node,
|
|
1286
|
+
builtin_class=selectBytearrayBuiltinClass,
|
|
1287
|
+
builtin_spec=BuiltinParameterSpecs.builtin_bytearray_spec,
|
|
1288
|
+
empty_special_class=makeBytearray0,
|
|
1289
|
+
)
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
def slice_extractor(node):
|
|
1293
|
+
def wrapSlice(start, stop, step, source_ref):
|
|
1294
|
+
if start is not None and stop is None:
|
|
1295
|
+
# Default rules are strange. If one argument is given, it's the
|
|
1296
|
+
# second one then.
|
|
1297
|
+
stop = start
|
|
1298
|
+
start = None
|
|
1299
|
+
|
|
1300
|
+
return makeExpressionBuiltinSlice(
|
|
1301
|
+
start=start, stop=stop, step=step, source_ref=source_ref
|
|
1302
|
+
)
|
|
1303
|
+
|
|
1304
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1305
|
+
node=node,
|
|
1306
|
+
builtin_class=wrapSlice,
|
|
1307
|
+
builtin_spec=BuiltinParameterSpecs.builtin_slice_spec,
|
|
1308
|
+
)
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
def hash_extractor(node):
|
|
1312
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1313
|
+
node=node,
|
|
1314
|
+
builtin_class=ExpressionBuiltinHash,
|
|
1315
|
+
builtin_spec=BuiltinParameterSpecs.builtin_hash_spec,
|
|
1316
|
+
)
|
|
1317
|
+
|
|
1318
|
+
|
|
1319
|
+
def input_extractor(node):
|
|
1320
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1321
|
+
node=node,
|
|
1322
|
+
builtin_class=ExpressionBuiltinInput,
|
|
1323
|
+
builtin_spec=BuiltinParameterSpecs.builtin_input_spec,
|
|
1324
|
+
)
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
def format_extractor(node):
|
|
1328
|
+
def makeFormat0(source_ref):
|
|
1329
|
+
# pylint: disable=unused-argument
|
|
1330
|
+
|
|
1331
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
1332
|
+
expression=node,
|
|
1333
|
+
exception=TypeError("format() takes at least 1 argument (0 given)"),
|
|
1334
|
+
)
|
|
1335
|
+
|
|
1336
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1337
|
+
node=node,
|
|
1338
|
+
builtin_class=ExpressionBuiltinFormat,
|
|
1339
|
+
builtin_spec=BuiltinParameterSpecs.builtin_format_spec,
|
|
1340
|
+
empty_special_class=makeFormat0,
|
|
1341
|
+
)
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
def staticmethod_extractor(node):
|
|
1345
|
+
def makeStaticmethod0(source_ref):
|
|
1346
|
+
# pylint: disable=unused-argument
|
|
1347
|
+
|
|
1348
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
1349
|
+
expression=node,
|
|
1350
|
+
exception=TypeError("staticmethod expected 1 arguments, got 0"),
|
|
1351
|
+
)
|
|
1352
|
+
|
|
1353
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1354
|
+
node=node,
|
|
1355
|
+
builtin_class=ExpressionBuiltinStaticmethod,
|
|
1356
|
+
builtin_spec=BuiltinParameterSpecs.builtin_staticmethod_spec,
|
|
1357
|
+
empty_special_class=makeStaticmethod0,
|
|
1358
|
+
)
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
def classmethod_extractor(node):
|
|
1362
|
+
def makeStaticmethod0(source_ref):
|
|
1363
|
+
# pylint: disable=unused-argument
|
|
1364
|
+
|
|
1365
|
+
return makeRaiseExceptionReplacementExpressionFromInstance(
|
|
1366
|
+
expression=node,
|
|
1367
|
+
exception=TypeError("classmethod expected 1 arguments, got 0"),
|
|
1368
|
+
)
|
|
1369
|
+
|
|
1370
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1371
|
+
node=node,
|
|
1372
|
+
builtin_class=ExpressionBuiltinClassmethod,
|
|
1373
|
+
builtin_spec=BuiltinParameterSpecs.builtin_classmethod_spec,
|
|
1374
|
+
empty_special_class=makeStaticmethod0,
|
|
1375
|
+
)
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
def divmod_extractor(node):
|
|
1379
|
+
return BuiltinParameterSpecs.extractBuiltinArgs(
|
|
1380
|
+
node=node,
|
|
1381
|
+
builtin_class=ExpressionOperationBinaryDivmod,
|
|
1382
|
+
builtin_spec=BuiltinParameterSpecs.builtin_divmod_spec,
|
|
1383
|
+
)
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
_dispatch_dict = {
|
|
1387
|
+
"compile": compile_extractor,
|
|
1388
|
+
"globals": globals_extractor,
|
|
1389
|
+
"locals": locals_extractor,
|
|
1390
|
+
"eval": eval_extractor,
|
|
1391
|
+
"dir": dir_extractor,
|
|
1392
|
+
"vars": vars_extractor,
|
|
1393
|
+
"__import__": import_extractor,
|
|
1394
|
+
"chr": chr_extractor,
|
|
1395
|
+
"ord": ord_extractor,
|
|
1396
|
+
"bin": bin_extractor,
|
|
1397
|
+
"oct": oct_extractor,
|
|
1398
|
+
"hex": hex_extractor,
|
|
1399
|
+
"id": id_extractor,
|
|
1400
|
+
"type": type_extractor,
|
|
1401
|
+
"iter": iter_extractor,
|
|
1402
|
+
"next": next_extractor,
|
|
1403
|
+
"sum": sum_extractor,
|
|
1404
|
+
"tuple": tuple_extractor,
|
|
1405
|
+
"list": list_extractor,
|
|
1406
|
+
"dict": dict_extractor,
|
|
1407
|
+
"set": set_extractor,
|
|
1408
|
+
"frozenset": frozenset_extractor,
|
|
1409
|
+
"float": float_extractor,
|
|
1410
|
+
"complex": complex_extractor,
|
|
1411
|
+
"str": str_extractor,
|
|
1412
|
+
"bool": bool_extractor,
|
|
1413
|
+
"int": int_extractor,
|
|
1414
|
+
"repr": repr_extractor,
|
|
1415
|
+
"len": len_extractor,
|
|
1416
|
+
"any": any_extractor,
|
|
1417
|
+
"abs": abs_extractor,
|
|
1418
|
+
"all": all_extractor,
|
|
1419
|
+
"super": super_extractor,
|
|
1420
|
+
"hasattr": hasattr_extractor,
|
|
1421
|
+
"getattr": getattr_extractor,
|
|
1422
|
+
"setattr": setattr_extractor,
|
|
1423
|
+
"isinstance": isinstance_extractor,
|
|
1424
|
+
"issubclass": issubclass_extractor,
|
|
1425
|
+
"bytearray": bytearray_extractor,
|
|
1426
|
+
"slice": slice_extractor,
|
|
1427
|
+
"hash": hash_extractor,
|
|
1428
|
+
"format": format_extractor,
|
|
1429
|
+
"open": open_extractor,
|
|
1430
|
+
"staticmethod": staticmethod_extractor,
|
|
1431
|
+
"classmethod": classmethod_extractor,
|
|
1432
|
+
"divmod": divmod_extractor,
|
|
1433
|
+
"input": input_extractor,
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
if python_version < 0x300:
|
|
1437
|
+
# These are not in Python3
|
|
1438
|
+
_dispatch_dict["long"] = long_extractor
|
|
1439
|
+
_dispatch_dict["unicode"] = unicode_extractor
|
|
1440
|
+
_dispatch_dict["execfile"] = execfile_extractor
|
|
1441
|
+
_dispatch_dict["xrange"] = xrange_extractor
|
|
1442
|
+
|
|
1443
|
+
_dispatch_dict["range"] = range_extractor
|
|
1444
|
+
else:
|
|
1445
|
+
# This one is not in Python2:
|
|
1446
|
+
_dispatch_dict["bytes"] = bytes_extractor
|
|
1447
|
+
_dispatch_dict["ascii"] = ascii_extractor
|
|
1448
|
+
_dispatch_dict["exec"] = exec_extractor
|
|
1449
|
+
|
|
1450
|
+
# The Python3 range is really an xrange, use that.
|
|
1451
|
+
_dispatch_dict["range"] = xrange_extractor
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
def check():
|
|
1455
|
+
from nuitka.Builtins import builtin_names
|
|
1456
|
+
|
|
1457
|
+
for builtin_name in _dispatch_dict:
|
|
1458
|
+
assert builtin_name in builtin_names, builtin_name
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
check()
|
|
1462
|
+
|
|
1463
|
+
_builtin_ignore_list = (
|
|
1464
|
+
# Not supporting 'print', because it could be replaced, and is not
|
|
1465
|
+
# worth the effort yet.
|
|
1466
|
+
"print",
|
|
1467
|
+
# TODO: This could, and should be supported, as we could e.g. lower
|
|
1468
|
+
# types easily for it.
|
|
1469
|
+
"sorted",
|
|
1470
|
+
# TODO: This would be very worthwhile, as it could easily optimize
|
|
1471
|
+
# its iteration away.
|
|
1472
|
+
"zip",
|
|
1473
|
+
# TODO: This would be most precious due to the type hint it gives
|
|
1474
|
+
"enumerate",
|
|
1475
|
+
# TODO: Also worthwhile for known values.
|
|
1476
|
+
"reversed",
|
|
1477
|
+
# TODO: Not sure what this really is about.
|
|
1478
|
+
"memoryview",
|
|
1479
|
+
)
|
|
1480
|
+
|
|
1481
|
+
|
|
1482
|
+
def _describeNewNode(builtin_name, inspect_node):
|
|
1483
|
+
"""Describe the change for better understanding."""
|
|
1484
|
+
|
|
1485
|
+
# Don't mention side effects, that's not what we care about.
|
|
1486
|
+
if inspect_node.isExpressionSideEffects():
|
|
1487
|
+
inspect_node = inspect_node.subnode_expression
|
|
1488
|
+
|
|
1489
|
+
if inspect_node.isExpressionBuiltinImport():
|
|
1490
|
+
tags = "new_import"
|
|
1491
|
+
message = """\
|
|
1492
|
+
Replaced dynamic "__import__" call with static built-in call."""
|
|
1493
|
+
elif inspect_node.isExpressionBuiltin() or inspect_node.isStatementExec():
|
|
1494
|
+
tags = "new_builtin"
|
|
1495
|
+
message = "Replaced call to built-in '%s' with built-in call '%s'." % (
|
|
1496
|
+
builtin_name,
|
|
1497
|
+
inspect_node.kind,
|
|
1498
|
+
)
|
|
1499
|
+
elif inspect_node.isExpressionRaiseException():
|
|
1500
|
+
tags = "new_raise"
|
|
1501
|
+
message = """\
|
|
1502
|
+
Replaced call to built-in '%s' with exception raise.""" % (
|
|
1503
|
+
builtin_name,
|
|
1504
|
+
)
|
|
1505
|
+
elif inspect_node.isExpressionOperationBinary():
|
|
1506
|
+
tags = "new_expression"
|
|
1507
|
+
message = """\
|
|
1508
|
+
Replaced call to built-in '%s' with binary operation '%s'.""" % (
|
|
1509
|
+
builtin_name,
|
|
1510
|
+
inspect_node.getOperator(),
|
|
1511
|
+
)
|
|
1512
|
+
elif inspect_node.isExpressionOperationUnary():
|
|
1513
|
+
tags = "new_expression"
|
|
1514
|
+
message = """\
|
|
1515
|
+
Replaced call to built-in '%s' with unary operation '%s'.""" % (
|
|
1516
|
+
builtin_name,
|
|
1517
|
+
inspect_node.getOperator(),
|
|
1518
|
+
)
|
|
1519
|
+
elif inspect_node.isExpressionCall():
|
|
1520
|
+
tags = "new_expression"
|
|
1521
|
+
message = """\
|
|
1522
|
+
Replaced call to built-in '%s' with call.""" % (
|
|
1523
|
+
builtin_name,
|
|
1524
|
+
)
|
|
1525
|
+
elif inspect_node.isExpressionOutlineBody():
|
|
1526
|
+
tags = "new_expression"
|
|
1527
|
+
message = (
|
|
1528
|
+
"""\
|
|
1529
|
+
Replaced call to built-in '%s' with outlined call."""
|
|
1530
|
+
% builtin_name
|
|
1531
|
+
)
|
|
1532
|
+
elif inspect_node.isExpressionConstantRef():
|
|
1533
|
+
tags = "new_expression"
|
|
1534
|
+
message = (
|
|
1535
|
+
"""\
|
|
1536
|
+
Replaced call to built-in '%s' with constant value."""
|
|
1537
|
+
% builtin_name
|
|
1538
|
+
)
|
|
1539
|
+
else:
|
|
1540
|
+
assert False, (builtin_name, "->", inspect_node)
|
|
1541
|
+
|
|
1542
|
+
return tags, message
|
|
1543
|
+
|
|
1544
|
+
|
|
1545
|
+
def computeBuiltinCall(builtin_name, call_node):
|
|
1546
|
+
# There is some dispatching for how to output various types of changes,
|
|
1547
|
+
# with lots of cases.
|
|
1548
|
+
if builtin_name in _dispatch_dict:
|
|
1549
|
+
new_node = _dispatch_dict[builtin_name](call_node)
|
|
1550
|
+
|
|
1551
|
+
assert new_node is not call_node, builtin_name
|
|
1552
|
+
assert new_node is not None, builtin_name
|
|
1553
|
+
|
|
1554
|
+
# For traces, we are going to ignore side effects, and output traces
|
|
1555
|
+
# only based on the basis of it.
|
|
1556
|
+
tags, message = _describeNewNode(builtin_name, new_node)
|
|
1557
|
+
|
|
1558
|
+
return new_node, tags, message
|
|
1559
|
+
else:
|
|
1560
|
+
# TODO: Achieve coverage of all built-ins in at least the ignore list.
|
|
1561
|
+
# if False and builtin_name not in _builtin_ignore_list:
|
|
1562
|
+
# optimization_logger.warning(
|
|
1563
|
+
# "Not handling built-in %r, consider support." % builtin_name
|
|
1564
|
+
# )
|
|
1565
|
+
|
|
1566
|
+
return call_node, None, None
|
|
1567
|
+
|
|
1568
|
+
|
|
1569
|
+
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
1570
|
+
# integrates with CPython, but also works on its own.
|
|
1571
|
+
#
|
|
1572
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
1573
|
+
# you may not use this file except in compliance with the License.
|
|
1574
|
+
# You may obtain a copy of the License at
|
|
1575
|
+
#
|
|
1576
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
1577
|
+
#
|
|
1578
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
1579
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
1580
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1581
|
+
# See the License for the specific language governing permissions and
|
|
1582
|
+
# limitations under the License.
|