pforge 1.0.0__py3-none-any.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.
- pforge/Builtins.py +288 -0
- pforge/BytecodeCaching.py +209 -0
- pforge/Bytecodes.py +124 -0
- pforge/CacheCleanup.py +59 -0
- pforge/Constants.py +510 -0
- pforge/Errors.py +104 -0
- pforge/HardImportRegistry.py +591 -0
- pforge/MainControl.py +1535 -0
- pforge/ModuleRegistry.py +401 -0
- pforge/OutputDirectories.py +314 -0
- pforge/Policies.py +125 -0
- pforge/PostProcessing.py +621 -0
- pforge/Progress.py +930 -0
- pforge/PythonFlavors.py +556 -0
- pforge/PythonOperators.py +319 -0
- pforge/PythonPrefixes.py +285 -0
- pforge/PythonVersions.py +594 -0
- pforge/Serialization.py +359 -0
- pforge/SourceCodeReferences.py +181 -0
- pforge/States.py +59 -0
- pforge/Tracing.py +776 -0
- pforge/TreeXML.py +178 -0
- pforge/Variables.py +597 -0
- pforge/Version.py +91 -0
- pforge/VersionCheck.py +364 -0
- pforge/__init__.py +35 -0
- pforge/__main__.py +340 -0
- pforge/__past__.py +280 -0
- pforge/build/AIXObjGenerator.py +153 -0
- pforge/build/AdaptPythonHeaderFiles.py +505 -0
- pforge/build/Backend.scons +555 -0
- pforge/build/CCompilerVersion.scons +70 -0
- pforge/build/ConstantBlobFormat.py +440 -0
- pforge/build/DataComposerInterface.py +217 -0
- pforge/build/Offsets.scons +189 -0
- pforge/build/Onefile.scons +220 -0
- pforge/build/SconsCaching.py +586 -0
- pforge/build/SconsCompilerSettings.py +2419 -0
- pforge/build/SconsControl.py +170 -0
- pforge/build/SconsHacks.py +259 -0
- pforge/build/SconsInterface.py +996 -0
- pforge/build/SconsProgress.py +104 -0
- pforge/build/SconsPythonBuild.py +248 -0
- pforge/build/SconsSourceIndex.py +353 -0
- pforge/build/SconsSpawn.py +594 -0
- pforge/build/SconsStableIncludePaths.py +277 -0
- pforge/build/SconsUtils.py +1388 -0
- pforge/build/WindowsObjGenerator.py +175 -0
- pforge/build/__init__.py +22 -0
- pforge/build/include/pforge/allocator.h +1024 -0
- pforge/build/include/pforge/blobs.h +130 -0
- pforge/build/include/pforge/builtins.h +106 -0
- pforge/build/include/pforge/calling.h +140 -0
- pforge/build/include/pforge/checkers.h +63 -0
- pforge/build/include/pforge/checksum_tools.h +33 -0
- pforge/build/include/pforge/compiled_asyncgen.h +285 -0
- pforge/build/include/pforge/compiled_cell.h +89 -0
- pforge/build/include/pforge/compiled_coroutine.h +282 -0
- pforge/build/include/pforge/compiled_frame.h +896 -0
- pforge/build/include/pforge/compiled_function.h +176 -0
- pforge/build/include/pforge/compiled_generator.h +310 -0
- pforge/build/include/pforge/compiled_method.h +64 -0
- pforge/build/include/pforge/compiled_types_common.h +117 -0
- pforge/build/include/pforge/constants.h +202 -0
- pforge/build/include/pforge/constants_blob.h +62 -0
- pforge/build/include/pforge/constants_blob_spec.h +116 -0
- pforge/build/include/pforge/cpython_api_compat.h +46 -0
- pforge/build/include/pforge/debug_settings.h +63 -0
- pforge/build/include/pforge/defines.h +79 -0
- pforge/build/include/pforge/environment_variables.h +38 -0
- pforge/build/include/pforge/environment_variables_system.h +57 -0
- pforge/build/include/pforge/exception_groups.h +631 -0
- pforge/build/include/pforge/exceptions.h +1495 -0
- pforge/build/include/pforge/filesystem_paths.h +130 -0
- pforge/build/include/pforge/freelists.h +162 -0
- pforge/build/include/pforge/gc_runtime.h +170 -0
- pforge/build/include/pforge/hedley.h +1825 -0
- pforge/build/include/pforge/helper/attributes.h +98 -0
- pforge/build/include/pforge/helper/boolean.h +107 -0
- pforge/build/include/pforge/helper/bytearrays.h +44 -0
- pforge/build/include/pforge/helper/bytes.h +42 -0
- pforge/build/include/pforge/helper/calling_generated.h +139 -0
- pforge/build/include/pforge/helper/comparisons_dual_eq.h +58 -0
- pforge/build/include/pforge/helper/comparisons_dual_ge.h +50 -0
- pforge/build/include/pforge/helper/comparisons_dual_gt.h +50 -0
- pforge/build/include/pforge/helper/comparisons_dual_le.h +58 -0
- pforge/build/include/pforge/helper/comparisons_dual_lt.h +58 -0
- pforge/build/include/pforge/helper/comparisons_dual_ne.h +50 -0
- pforge/build/include/pforge/helper/comparisons_eq.h +263 -0
- pforge/build/include/pforge/helper/comparisons_ge.h +207 -0
- pforge/build/include/pforge/helper/comparisons_gt.h +207 -0
- pforge/build/include/pforge/helper/comparisons_le.h +263 -0
- pforge/build/include/pforge/helper/comparisons_lt.h +263 -0
- pforge/build/include/pforge/helper/comparisons_ne.h +207 -0
- pforge/build/include/pforge/helper/complex.h +57 -0
- pforge/build/include/pforge/helper/dict_internals.h +123 -0
- pforge/build/include/pforge/helper/dictionaries.h +568 -0
- pforge/build/include/pforge/helper/floats.h +41 -0
- pforge/build/include/pforge/helper/import_hard.h +153 -0
- pforge/build/include/pforge/helper/indexes.h +53 -0
- pforge/build/include/pforge/helper/ints.h +188 -0
- pforge/build/include/pforge/helper/iterators.h +467 -0
- pforge/build/include/pforge/helper/lists.h +113 -0
- pforge/build/include/pforge/helper/lists_generated.h +43 -0
- pforge/build/include/pforge/helper/long_helpers.h +78 -0
- pforge/build/include/pforge/helper/mappings.h +67 -0
- pforge/build/include/pforge/helper/operations.h +126 -0
- pforge/build/include/pforge/helper/operations_binary_add.h +268 -0
- pforge/build/include/pforge/helper/operations_binary_bitand.h +118 -0
- pforge/build/include/pforge/helper/operations_binary_bitor.h +118 -0
- pforge/build/include/pforge/helper/operations_binary_bitxor.h +118 -0
- pforge/build/include/pforge/helper/operations_binary_divmod.h +113 -0
- pforge/build/include/pforge/helper/operations_binary_dual_add.h +45 -0
- pforge/build/include/pforge/helper/operations_binary_dual_sub.h +49 -0
- pforge/build/include/pforge/helper/operations_binary_floordiv.h +113 -0
- pforge/build/include/pforge/helper/operations_binary_lshift.h +109 -0
- pforge/build/include/pforge/helper/operations_binary_matmult.h +70 -0
- pforge/build/include/pforge/helper/operations_binary_mod.h +314 -0
- pforge/build/include/pforge/helper/operations_binary_mult.h +275 -0
- pforge/build/include/pforge/helper/operations_binary_olddiv.h +135 -0
- pforge/build/include/pforge/helper/operations_binary_pow.h +100 -0
- pforge/build/include/pforge/helper/operations_binary_rshift.h +109 -0
- pforge/build/include/pforge/helper/operations_binary_sub.h +142 -0
- pforge/build/include/pforge/helper/operations_binary_truediv.h +113 -0
- pforge/build/include/pforge/helper/operations_builtin_types.h +268 -0
- pforge/build/include/pforge/helper/operations_inplace_add.h +181 -0
- pforge/build/include/pforge/helper/operations_inplace_bitand.h +84 -0
- pforge/build/include/pforge/helper/operations_inplace_bitor.h +84 -0
- pforge/build/include/pforge/helper/operations_inplace_bitxor.h +84 -0
- pforge/build/include/pforge/helper/operations_inplace_floordiv.h +103 -0
- pforge/build/include/pforge/helper/operations_inplace_lshift.h +70 -0
- pforge/build/include/pforge/helper/operations_inplace_matmult.h +68 -0
- pforge/build/include/pforge/helper/operations_inplace_mod.h +226 -0
- pforge/build/include/pforge/helper/operations_inplace_mult.h +192 -0
- pforge/build/include/pforge/helper/operations_inplace_olddiv.h +123 -0
- pforge/build/include/pforge/helper/operations_inplace_pow.h +95 -0
- pforge/build/include/pforge/helper/operations_inplace_rshift.h +70 -0
- pforge/build/include/pforge/helper/operations_inplace_sub.h +110 -0
- pforge/build/include/pforge/helper/operations_inplace_truediv.h +103 -0
- pforge/build/include/pforge/helper/pow_helpers.h +41 -0
- pforge/build/include/pforge/helper/raising.h +130 -0
- pforge/build/include/pforge/helper/rangeobjects.h +75 -0
- pforge/build/include/pforge/helper/repeat_helpers.h +41 -0
- pforge/build/include/pforge/helper/richcomparisons.h +39 -0
- pforge/build/include/pforge/helper/sequences.h +42 -0
- pforge/build/include/pforge/helper/sets.h +30 -0
- pforge/build/include/pforge/helper/slices.h +320 -0
- pforge/build/include/pforge/helper/strings.h +41 -0
- pforge/build/include/pforge/helper/subscripts.h +463 -0
- pforge/build/include/pforge/helper/tuples.h +220 -0
- pforge/build/include/pforge/helpers.h +512 -0
- pforge/build/include/pforge/importing.h +180 -0
- pforge/build/include/pforge/incbin.h +360 -0
- pforge/build/include/pforge/jit_sources.h +34 -0
- pforge/build/include/pforge/prelude.h +610 -0
- pforge/build/include/pforge/printing.h +92 -0
- pforge/build/include/pforge/python_internals_access.h +461 -0
- pforge/build/include/pforge/python_pgo.h +66 -0
- pforge/build/include/pforge/python_pgo_spec.h +69 -0
- pforge/build/include/pforge/safe_string_ops.h +78 -0
- pforge/build/include/pforge/string_functions.h +99 -0
- pforge/build/include/pforge/threading.h +158 -0
- pforge/build/include/pforge/tracing.h +86 -0
- pforge/build/include/pforge/type_aliases.h +42 -0
- pforge/build/include/pforge/unfreezing.h +200 -0
- pforge/build/inline_copy/appdirs/LICENSE.txt +23 -0
- pforge/build/inline_copy/appdirs/appdirs.py +611 -0
- pforge/build/inline_copy/bin/scons.py +68 -0
- pforge/build/inline_copy/jinja2/LICENSE.rst +28 -0
- pforge/build/inline_copy/jinja2/README.rst +2 -0
- pforge/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
- pforge/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
- pforge/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
- pforge/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
- pforge/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
- pforge/build/inline_copy/jinja2/jinja2/constants.py +32 -0
- pforge/build/inline_copy/jinja2/jinja2/debug.py +378 -0
- pforge/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
- pforge/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
- pforge/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
- pforge/build/inline_copy/jinja2/jinja2/ext.py +627 -0
- pforge/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
- pforge/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
- pforge/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
- pforge/build/inline_copy/jinja2/jinja2/loaders.py +481 -0
- pforge/build/inline_copy/jinja2/jinja2/meta.py +106 -0
- pforge/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
- pforge/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
- pforge/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
- pforge/build/inline_copy/jinja2/jinja2/parser.py +903 -0
- pforge/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
- pforge/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
- pforge/build/inline_copy/jinja2/jinja2/tests.py +174 -0
- pforge/build/inline_copy/jinja2/jinja2/utils.py +642 -0
- pforge/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Action.py +1619 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Builder.py +918 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/CacheDir.py +404 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Conftest.py +870 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Debug.py +254 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Defaults.py +760 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Environment.py +2910 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/EnvironmentValues.py +119 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Errors.py +222 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Executor.py +665 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Memoize.py +242 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Node/Alias.py +150 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Node/FS.py +3861 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Node/__init__.py +1807 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/PathList.py +227 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/__init__.py +381 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/aix.py +80 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/cygwin.py +62 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/darwin.py +71 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/hpux.py +45 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/irix.py +41 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/mingw.py +35 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/os2.py +56 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/posix.py +125 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/virtualenv.py +135 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Platform/win32.py +447 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/SConf.py +1174 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/SConsign.py +442 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Scanner/C.py +333 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Scanner/Dir.py +131 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Scanner/Prog.py +114 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Scanner/RC.py +57 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Scanner/__init__.py +438 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Script/Interactive.py +377 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Script/Main.py +1601 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Script/SConsOptions.py +1260 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Script/SConscript.py +713 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Script/__init__.py +498 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Subst.py +1003 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Taskmaster/Job.py +762 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Taskmaster/__init__.py +1137 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/386asm.py +61 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/GettextCommon.py +429 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/Config.py +396 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/Dispatcher.py +84 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/Exceptions.py +56 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/Kind.py +668 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/Policy.py +330 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/Registry.py +121 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/ScriptArguments.py +1103 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/SetupEnvDefault.py +236 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/Util.py +494 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/Warnings.py +35 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/WinSDK.py +264 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/MSVC/__init__.py +56 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/__init__.py +101 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/arch.py +66 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/common.py +653 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/netframework.py +82 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/sdk.py +412 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/vc.py +2949 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/MSCommon/vs.py +647 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/PharLapCommon.py +116 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/__init__.py +893 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/aixc++.py +43 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/aixcc.py +74 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/aixcxx.py +77 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/aixlink.py +78 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/applelink.py +209 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/ar.py +63 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/as.py +49 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/asm.py +78 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/bcc32.py +81 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/c++.py +44 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/cc.py +105 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/clang.py +91 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/clangCommon/__init__.py +18 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/clangxx.py +99 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/cxx.py +95 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/cyglink.py +235 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/default.py +45 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/filesystem.py +94 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/g++.py +45 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/gas.py +56 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/gcc.py +108 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/gnulink.py +73 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/gxx.py +80 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/hpc++.py +45 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/hpcc.py +53 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/hpcxx.py +85 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/hplink.py +72 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/icc.py +59 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/icl.py +52 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/ilink32.py +60 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/install.py +510 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/intelc.py +617 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/link.py +72 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/linkCommon/LoadableModule.py +131 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/linkCommon/__init__.py +175 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/linkloc.py +112 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/m4.py +63 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/masm.py +77 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/mingw.py +224 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/msgfmt.py +132 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/msginit.py +137 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/msgmerge.py +125 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/mslib.py +78 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/mslink.py +344 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/mssdk.py +52 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/msvc.py +333 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/msvs.py +2197 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/mwcc.py +207 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/mwld.py +108 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/nasm.py +72 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/rpcgen.py +70 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/tlib.py +53 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/wix.py +104 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Tool/xgettext.py +337 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Util/__init__.py +1423 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Util/envs.py +350 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Util/filelock.py +151 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Util/hashes.py +406 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Util/sctypes.py +383 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Util/stats.py +224 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Utilities/ConfigureCache.py +171 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Utilities/__init__.py +0 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Utilities/sconsign.py +492 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Variables/BoolVariable.py +105 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Variables/EnumVariable.py +148 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Variables/ListVariable.py +237 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Variables/PackageVariable.py +136 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Variables/PathVariable.py +174 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Variables/__init__.py +468 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/Warnings.py +300 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/__init__.py +9 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/compat/__init__.py +104 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/compat/_scons_dbm.py +42 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/compat/win32.py +101 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/cpp.py +684 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/dblite.py +351 -0
- pforge/build/inline_copy/lib/scons-4.10.1/SCons/exitfuncs.py +59 -0
- pforge/build/inline_copy/markupsafe/LICENSE.rst +28 -0
- pforge/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
- pforge/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
- pforge/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
- pforge/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
- pforge/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3275 -0
- pforge/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
- pforge/build/inline_copy/python_hacl/LICENSE.txt +201 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
- pforge/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
- pforge/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
- pforge/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
- pforge/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
- pforge/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
- pforge/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
- pforge/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
- pforge/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
- pforge/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
- pforge/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
- pforge/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
- pforge/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
- pforge/build/inline_copy/stubgen/astunparse.py +938 -0
- pforge/build/inline_copy/stubgen/six.py +998 -0
- pforge/build/inline_copy/stubgen/stubgen.py +850 -0
- pforge/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
- pforge/build/inline_copy/tqdm/tqdm/_main.py +9 -0
- pforge/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
- pforge/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
- pforge/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
- pforge/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
- pforge/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
- pforge/build/inline_copy/tqdm/tqdm/auto.py +44 -0
- pforge/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
- pforge/build/inline_copy/tqdm/tqdm/dask.py +46 -0
- pforge/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
- pforge/build/inline_copy/tqdm/tqdm/std.py +1527 -0
- pforge/build/inline_copy/tqdm/tqdm/tk.py +207 -0
- pforge/build/inline_copy/tqdm/tqdm/utils.py +351 -0
- pforge/build/inline_copy/tqdm/tqdm/version.py +2 -0
- pforge/build/inline_copy/yaml/LICENSE +20 -0
- pforge/build/inline_copy/yaml/yaml/__init__.py +427 -0
- pforge/build/inline_copy/yaml/yaml/composer.py +139 -0
- pforge/build/inline_copy/yaml/yaml/constructor.py +748 -0
- pforge/build/inline_copy/yaml/yaml/cyaml.py +101 -0
- pforge/build/inline_copy/yaml/yaml/dumper.py +62 -0
- pforge/build/inline_copy/yaml/yaml/emitter.py +1137 -0
- pforge/build/inline_copy/yaml/yaml/error.py +75 -0
- pforge/build/inline_copy/yaml/yaml/events.py +86 -0
- pforge/build/inline_copy/yaml/yaml/loader.py +63 -0
- pforge/build/inline_copy/yaml/yaml/nodes.py +49 -0
- pforge/build/inline_copy/yaml/yaml/parser.py +589 -0
- pforge/build/inline_copy/yaml/yaml/reader.py +185 -0
- pforge/build/inline_copy/yaml/yaml/representer.py +389 -0
- pforge/build/inline_copy/yaml/yaml/resolver.py +227 -0
- pforge/build/inline_copy/yaml/yaml/scanner.py +1435 -0
- pforge/build/inline_copy/yaml/yaml/serializer.py +111 -0
- pforge/build/inline_copy/yaml/yaml/tokens.py +104 -0
- pforge/build/inline_copy/zlib/LICENSE +22 -0
- pforge/build/inline_copy/zlib/crc32.c +991 -0
- pforge/build/inline_copy/zlib/crc32.h +9446 -0
- pforge/build/inline_copy/zlib/zconf.h +397 -0
- pforge/build/inline_copy/zlib/zutil.h +275 -0
- pforge/build/inline_copy/zstd/LICENSE.txt +30 -0
- pforge/build/inline_copy/zstd/common/bitstream.h +463 -0
- pforge/build/inline_copy/zstd/common/compiler.h +288 -0
- pforge/build/inline_copy/zstd/common/cpu.h +213 -0
- pforge/build/inline_copy/zstd/common/debug.h +107 -0
- pforge/build/inline_copy/zstd/common/entropy_common.c +360 -0
- pforge/build/inline_copy/zstd/common/error_private.c +56 -0
- pforge/build/inline_copy/zstd/common/error_private.h +80 -0
- pforge/build/inline_copy/zstd/common/fse.h +715 -0
- pforge/build/inline_copy/zstd/common/fse_decompress.c +393 -0
- pforge/build/inline_copy/zstd/common/huf.h +361 -0
- pforge/build/inline_copy/zstd/common/mem.h +426 -0
- pforge/build/inline_copy/zstd/common/xxhash.c +826 -0
- pforge/build/inline_copy/zstd/common/xxhash.h +285 -0
- pforge/build/inline_copy/zstd/common/zstd_common.c +83 -0
- pforge/build/inline_copy/zstd/common/zstd_deps.h +111 -0
- pforge/build/inline_copy/zstd/common/zstd_errors.h +95 -0
- pforge/build/inline_copy/zstd/common/zstd_internal.h +478 -0
- pforge/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
- pforge/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
- pforge/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
- pforge/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
- pforge/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
- pforge/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
- pforge/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
- pforge/build/inline_copy/zstd/zstd.h +2391 -0
- pforge/build/python_internal_offset/offsets_3.13-Windows-x86-gil-debug.json +6 -0
- pforge/build/python_internal_offset/offsets_3.13-Windows-x86-gil.json +6 -0
- pforge/build/python_internal_offset/offsets_3.13-Windows-x86_64-gil-debug.json +6 -0
- pforge/build/python_internal_offset/offsets_3.13-Windows-x86_64-gil.json +6 -0
- pforge/build/python_internal_offset/offsets_3.14-Windows-x86-gil-debug.json +7 -0
- pforge/build/python_internal_offset/offsets_3.14-Windows-x86-gil.json +7 -0
- pforge/build/python_internal_offset/offsets_3.14-Windows-x86_64-gil-debug.json +7 -0
- pforge/build/python_internal_offset/offsets_3.14-Windows-x86_64-gil.json +7 -0
- pforge/build/python_internal_offset/offsets_3.15-Windows-x86-gil-debug.json +7 -0
- pforge/build/python_internal_offset/offsets_3.15-Windows-x86-gil.json +7 -0
- pforge/build/python_internal_offset/offsets_3.15-Windows-x86_64-gil-debug.json +7 -0
- pforge/build/python_internal_offset/offsets_3.15-Windows-x86_64-gil.json +7 -0
- pforge/build/static_src/CompiledAsyncgenType.c +2393 -0
- pforge/build/static_src/CompiledCellType.c +324 -0
- pforge/build/static_src/CompiledCodeHelpers.c +2387 -0
- pforge/build/static_src/CompiledCoroutineType.c +2061 -0
- pforge/build/static_src/CompiledFrameLocalsProxyType.c +868 -0
- pforge/build/static_src/CompiledFrameType.c +1752 -0
- pforge/build/static_src/CompiledFunctionType.c +3608 -0
- pforge/build/static_src/CompiledGeneratorType.c +2064 -0
- pforge/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2708 -0
- pforge/build/static_src/CompiledMethodType.c +701 -0
- pforge/build/static_src/HelpersAllocator.c +1132 -0
- pforge/build/static_src/HelpersAttributes.c +1261 -0
- pforge/build/static_src/HelpersBuiltin.c +1104 -0
- pforge/build/static_src/HelpersBuiltinTypeMethods.c +3678 -0
- pforge/build/static_src/HelpersBytes.c +148 -0
- pforge/build/static_src/HelpersCalling.c +400 -0
- pforge/build/static_src/HelpersCallingGenerated.c +14688 -0
- pforge/build/static_src/HelpersChecksumTools.c +72 -0
- pforge/build/static_src/HelpersClasses.c +94 -0
- pforge/build/static_src/HelpersComparisonDualEq.c +201 -0
- pforge/build/static_src/HelpersComparisonDualGe.c +139 -0
- pforge/build/static_src/HelpersComparisonDualGt.c +139 -0
- pforge/build/static_src/HelpersComparisonDualLe.c +201 -0
- pforge/build/static_src/HelpersComparisonDualLt.c +201 -0
- pforge/build/static_src/HelpersComparisonDualNe.c +139 -0
- pforge/build/static_src/HelpersComparisonEq.c +12140 -0
- pforge/build/static_src/HelpersComparisonEqUtils.c +174 -0
- pforge/build/static_src/HelpersComparisonGe.c +11910 -0
- pforge/build/static_src/HelpersComparisonGt.c +11894 -0
- pforge/build/static_src/HelpersComparisonLe.c +12032 -0
- pforge/build/static_src/HelpersComparisonLt.c +12016 -0
- pforge/build/static_src/HelpersComparisonNe.c +12014 -0
- pforge/build/static_src/HelpersConsole.c +233 -0
- pforge/build/static_src/HelpersConstantsBlob.c +1780 -0
- pforge/build/static_src/HelpersDeepcopy.c +810 -0
- pforge/build/static_src/HelpersDialogs.c +232 -0
- pforge/build/static_src/HelpersDictionaries.c +4383 -0
- pforge/build/static_src/HelpersDictionariesGenerated.c +476 -0
- pforge/build/static_src/HelpersDictionariesSetGenerated.c +1043 -0
- pforge/build/static_src/HelpersDumpBacktraces.c +157 -0
- pforge/build/static_src/HelpersEnvironmentVariables.c +68 -0
- pforge/build/static_src/HelpersEnvironmentVariablesSystem.c +125 -0
- pforge/build/static_src/HelpersExceptions.c +322 -0
- pforge/build/static_src/HelpersFiles.c +366 -0
- pforge/build/static_src/HelpersFilesystemPaths.c +1636 -0
- pforge/build/static_src/HelpersFloats.c +107 -0
- pforge/build/static_src/HelpersHeapStorage.c +99 -0
- pforge/build/static_src/HelpersImport.c +604 -0
- pforge/build/static_src/HelpersImportHard.c +644 -0
- pforge/build/static_src/HelpersJitSources.c +52 -0
- pforge/build/static_src/HelpersLists.c +1214 -0
- pforge/build/static_src/HelpersListsGenerated.c +568 -0
- pforge/build/static_src/HelpersMappings.c +49 -0
- pforge/build/static_src/HelpersMatching.c +212 -0
- pforge/build/static_src/HelpersOperationBinaryAdd.c +6751 -0
- pforge/build/static_src/HelpersOperationBinaryAddUtils.c +834 -0
- pforge/build/static_src/HelpersOperationBinaryBitand.c +2744 -0
- pforge/build/static_src/HelpersOperationBinaryBitor.c +2744 -0
- pforge/build/static_src/HelpersOperationBinaryBitxor.c +2744 -0
- pforge/build/static_src/HelpersOperationBinaryDivmod.c +2412 -0
- pforge/build/static_src/HelpersOperationBinaryDivmodUtils.c +36 -0
- pforge/build/static_src/HelpersOperationBinaryDualAdd.c +176 -0
- pforge/build/static_src/HelpersOperationBinaryDualSub.c +242 -0
- pforge/build/static_src/HelpersOperationBinaryFloordiv.c +2428 -0
- pforge/build/static_src/HelpersOperationBinaryLshift.c +2852 -0
- pforge/build/static_src/HelpersOperationBinaryMatmult.c +459 -0
- pforge/build/static_src/HelpersOperationBinaryMod.c +6555 -0
- pforge/build/static_src/HelpersOperationBinaryMult.c +6712 -0
- pforge/build/static_src/HelpersOperationBinaryMultUtils.c +142 -0
- pforge/build/static_src/HelpersOperationBinaryOlddiv.c +2361 -0
- pforge/build/static_src/HelpersOperationBinaryPow.c +2923 -0
- pforge/build/static_src/HelpersOperationBinaryPowUtils.c +29 -0
- pforge/build/static_src/HelpersOperationBinaryRshift.c +2712 -0
- pforge/build/static_src/HelpersOperationBinarySub.c +2880 -0
- pforge/build/static_src/HelpersOperationBinaryTruediv.c +2421 -0
- pforge/build/static_src/HelpersOperationInplaceAdd.c +5219 -0
- pforge/build/static_src/HelpersOperationInplaceAddUtils.c +151 -0
- pforge/build/static_src/HelpersOperationInplaceBitand.c +1830 -0
- pforge/build/static_src/HelpersOperationInplaceBitor.c +1830 -0
- pforge/build/static_src/HelpersOperationInplaceBitxor.c +1830 -0
- pforge/build/static_src/HelpersOperationInplaceFloordiv.c +2609 -0
- pforge/build/static_src/HelpersOperationInplaceLshift.c +1598 -0
- pforge/build/static_src/HelpersOperationInplaceMatmult.c +607 -0
- pforge/build/static_src/HelpersOperationInplaceMod.c +4766 -0
- pforge/build/static_src/HelpersOperationInplaceMult.c +4695 -0
- pforge/build/static_src/HelpersOperationInplaceOlddiv.c +2557 -0
- pforge/build/static_src/HelpersOperationInplacePow.c +3063 -0
- pforge/build/static_src/HelpersOperationInplaceRshift.c +1538 -0
- pforge/build/static_src/HelpersOperationInplaceSub.c +2900 -0
- pforge/build/static_src/HelpersOperationInplaceTruediv.c +2616 -0
- pforge/build/static_src/HelpersProfiling.c +107 -0
- pforge/build/static_src/HelpersPythonPgo.c +1137 -0
- pforge/build/static_src/HelpersRaising.c +473 -0
- pforge/build/static_src/HelpersSafeStrings.c +282 -0
- pforge/build/static_src/HelpersSequences.c +179 -0
- pforge/build/static_src/HelpersSlices.c +87 -0
- pforge/build/static_src/HelpersStrings.c +1260 -0
- pforge/build/static_src/HelpersTuples.c +180 -0
- pforge/build/static_src/HelpersTypes.c +1240 -0
- pforge/build/static_src/HelpersWarnings.c +86 -0
- pforge/build/static_src/InspectPatcher.c +700 -0
- pforge/build/static_src/MainProgram.c +2611 -0
- pforge/build/static_src/MetaPathBasedLoader.c +3817 -0
- pforge/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +135 -0
- pforge/build/static_src/MetaPathBasedLoaderResourceReader.c +218 -0
- pforge/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +845 -0
- pforge/build/static_src/OnefileBootstrap.c +2098 -0
- pforge/build/static_src/OnefileSplashScreen.cpp +301 -0
- pforge/code_generation/AnnotateFunctionCodes.py +234 -0
- pforge/code_generation/AsyncgenCodes.py +199 -0
- pforge/code_generation/AttributeCodes.py +360 -0
- pforge/code_generation/BinaryOperationHelperDefinitions.py +740 -0
- pforge/code_generation/BranchCodes.py +68 -0
- pforge/code_generation/BuiltinCodes.py +642 -0
- pforge/code_generation/CallCodes.py +1280 -0
- pforge/code_generation/ClassCodes.py +288 -0
- pforge/code_generation/CodeGeneration.py +1228 -0
- pforge/code_generation/CodeHelperSelection.py +84 -0
- pforge/code_generation/CodeHelpers.py +459 -0
- pforge/code_generation/CodeObjectCodes.py +33 -0
- pforge/code_generation/ComparisonCodes.py +575 -0
- pforge/code_generation/ComparisonHelperDefinitions.py +158 -0
- pforge/code_generation/ConditionalCodes.py +236 -0
- pforge/code_generation/ConstantCodes.py +454 -0
- pforge/code_generation/Contexts.py +1275 -0
- pforge/code_generation/CoroutineCodes.py +265 -0
- pforge/code_generation/CtypesCodes.py +49 -0
- pforge/code_generation/DeferredReleaseCodes.py +68 -0
- pforge/code_generation/DictCodes.py +946 -0
- pforge/code_generation/Emission.py +69 -0
- pforge/code_generation/ErrorCodes.py +457 -0
- pforge/code_generation/EvalCodes.py +464 -0
- pforge/code_generation/ExceptionCodes.py +378 -0
- pforge/code_generation/ExpressionCTypeSelectionHelpers.py +230 -0
- pforge/code_generation/ExpressionCodes.py +64 -0
- pforge/code_generation/FrameCodes.py +669 -0
- pforge/code_generation/FunctionCodes.py +1064 -0
- pforge/code_generation/GeneratorCodes.py +230 -0
- pforge/code_generation/GlobalConstants.py +286 -0
- pforge/code_generation/GlobalsLocalsCodes.py +226 -0
- pforge/code_generation/IdCodes.py +54 -0
- pforge/code_generation/ImportCodes.py +789 -0
- pforge/code_generation/Indentation.py +34 -0
- pforge/code_generation/IndexCodes.py +53 -0
- pforge/code_generation/IntegerCodes.py +111 -0
- pforge/code_generation/IteratorCodes.py +588 -0
- pforge/code_generation/JitCodes.py +47 -0
- pforge/code_generation/LabelCodes.py +68 -0
- pforge/code_generation/LineNumberCodes.py +98 -0
- pforge/code_generation/ListCodes.py +506 -0
- pforge/code_generation/LoaderCodes.py +449 -0
- pforge/code_generation/LocalsDictCodes.py +370 -0
- pforge/code_generation/LoopCodes.py +111 -0
- pforge/code_generation/MatchCodes.py +68 -0
- pforge/code_generation/ModuleCodes.py +313 -0
- pforge/code_generation/Namify.py +292 -0
- pforge/code_generation/NetworkxCodes.py +54 -0
- pforge/code_generation/OperationCodes.py +404 -0
- pforge/code_generation/PackageResourceCodes.py +1129 -0
- pforge/code_generation/PgoCodes.py +217 -0
- pforge/code_generation/PrintCodes.py +96 -0
- pforge/code_generation/PythonAPICodes.py +279 -0
- pforge/code_generation/PythonSourceCodeGeneration.py +1247 -0
- pforge/code_generation/RaisingCodes.py +490 -0
- pforge/code_generation/Reports.py +118 -0
- pforge/code_generation/ReturnCodes.py +166 -0
- pforge/code_generation/SetCodes.py +199 -0
- pforge/code_generation/SliceCodes.py +468 -0
- pforge/code_generation/SpecialConstantData.py +76 -0
- pforge/code_generation/StringCodes.py +406 -0
- pforge/code_generation/SubscriptCodes.py +255 -0
- pforge/code_generation/TensorflowCodes.py +57 -0
- pforge/code_generation/TryCodes.py +360 -0
- pforge/code_generation/TupleCodes.py +116 -0
- pforge/code_generation/TypeAliasCodes.py +182 -0
- pforge/code_generation/VariableCodes.py +596 -0
- pforge/code_generation/VariableDeclarations.py +432 -0
- pforge/code_generation/YieldCodes.py +274 -0
- pforge/code_generation/__init__.py +22 -0
- pforge/code_generation/c_types/CTypeBases.py +191 -0
- pforge/code_generation/c_types/CTypeBooleans.py +105 -0
- pforge/code_generation/c_types/CTypeCFloats.py +62 -0
- pforge/code_generation/c_types/CTypeCLongs.py +46 -0
- pforge/code_generation/c_types/CTypeModuleDictVariables.py +114 -0
- pforge/code_generation/c_types/CTypePforgeBooleans.py +151 -0
- pforge/code_generation/c_types/CTypePforgeInts.py +201 -0
- pforge/code_generation/c_types/CTypePforgeVoids.py +110 -0
- pforge/code_generation/c_types/CTypePyObjectPointers.py +709 -0
- pforge/code_generation/c_types/CTypeVoids.py +93 -0
- pforge/code_generation/c_types/__init__.py +22 -0
- pforge/code_generation/templates/CodeTemplatesAsyncgens.py +108 -0
- pforge/code_generation/templates/CodeTemplatesConstants.py +323 -0
- pforge/code_generation/templates/CodeTemplatesCoroutines.py +111 -0
- pforge/code_generation/templates/CodeTemplatesExceptions.py +81 -0
- pforge/code_generation/templates/CodeTemplatesFrames.py +225 -0
- pforge/code_generation/templates/CodeTemplatesFunction.py +131 -0
- pforge/code_generation/templates/CodeTemplatesGeneratorFunction.py +131 -0
- pforge/code_generation/templates/CodeTemplatesIterators.py +40 -0
- pforge/code_generation/templates/CodeTemplatesLoader.py +183 -0
- pforge/code_generation/templates/CodeTemplatesModules.py +714 -0
- pforge/code_generation/templates/CodeTemplatesVariables.py +439 -0
- pforge/code_generation/templates/TemplateDebugWrapper.py +83 -0
- pforge/code_generation/templates/__init__.py +22 -0
- pforge/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +324 -0
- pforge/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +146 -0
- pforge/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +694 -0
- pforge/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +169 -0
- pforge/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +41 -0
- pforge/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +44 -0
- pforge/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +56 -0
- pforge/code_generation/templates_c/HelperDictionaryCopy.c.j2 +334 -0
- pforge/code_generation/templates_c/HelperDictionarySet.c.j2 +613 -0
- pforge/code_generation/templates_c/HelperImportHard.c.j2 +40 -0
- pforge/code_generation/templates_c/HelperLongTools.c.j2 +56 -0
- pforge/code_generation/templates_c/HelperObjectTools.c.j2 +23 -0
- pforge/code_generation/templates_c/HelperOperationBinary.c.j2 +151 -0
- pforge/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +118 -0
- pforge/code_generation/templates_c/HelperOperationComparison.c.j2 +355 -0
- pforge/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +118 -0
- pforge/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +89 -0
- pforge/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +34 -0
- pforge/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +35 -0
- pforge/code_generation/templates_c/HelperOperationComparisonList.c.j2 +131 -0
- pforge/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +160 -0
- pforge/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +118 -0
- pforge/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +102 -0
- pforge/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +118 -0
- pforge/code_generation/templates_c/HelperOperationInplace.c.j2 +290 -0
- pforge/code_generation/templates_c/HelperSlotsBinary.c.j2 +441 -0
- pforge/code_generation/templates_c/HelperSlotsBytes.c.j2 +54 -0
- pforge/code_generation/templates_c/HelperSlotsCommon.c.j2 +74 -0
- pforge/code_generation/templates_c/HelperSlotsFloat.c.j2 +387 -0
- pforge/code_generation/templates_c/HelperSlotsInt.c.j2 +414 -0
- pforge/code_generation/templates_c/HelperSlotsList.c.j2 +62 -0
- pforge/code_generation/templates_c/HelperSlotsLong.c.j2 +232 -0
- pforge/code_generation/templates_c/HelperSlotsSet.c.j2 +50 -0
- pforge/code_generation/templates_c/HelperSlotsStr.c.j2 +58 -0
- pforge/code_generation/templates_c/HelperSlotsTuple.c.j2 +61 -0
- pforge/code_generation/templates_c/HelperSlotsUnicode.c.j2 +65 -0
- pforge/containers/Namedtuples.py +63 -0
- pforge/containers/OrderedDicts.py +191 -0
- pforge/containers/OrderedSets.py +43 -0
- pforge/containers/OrderedSetsFallback.py +142 -0
- pforge/containers/__init__.py +22 -0
- pforge/distutils/Build.py +79 -0
- pforge/distutils/DistutilsCommands.py +516 -0
- pforge/distutils/__init__.py +22 -0
- pforge/finalizations/Finalization.py +38 -0
- pforge/finalizations/FinalizeMarkups.py +124 -0
- pforge/finalizations/__init__.py +22 -0
- pforge/format/BiomeFormatter.py +147 -0
- pforge/format/FileFormatting.py +392 -0
- pforge/format/PythonFormatting.py +477 -0
- pforge/format/YamlChecker.py +239 -0
- pforge/format/YamlFormatter.py +476 -0
- pforge/format/__init__.py +28 -0
- pforge/format/biome.json +10 -0
- pforge/freezer/DllDependenciesCommon.py +221 -0
- pforge/freezer/DllDependenciesMacOS.py +642 -0
- pforge/freezer/DllDependenciesPosix.py +256 -0
- pforge/freezer/DllDependenciesWin32.py +683 -0
- pforge/freezer/DllDependenciesWin32DependsExe.py +331 -0
- pforge/freezer/DllDependenciesWin32PEFile.py +130 -0
- pforge/freezer/DllDependenciesWin32WinDepends.py +329 -0
- pforge/freezer/ImportDetection.py +367 -0
- pforge/freezer/IncludedDataFiles.py +1319 -0
- pforge/freezer/IncludedEntryPoints.py +568 -0
- pforge/freezer/LinuxApp.py +256 -0
- pforge/freezer/MacOSApp.py +270 -0
- pforge/freezer/Onefile.py +364 -0
- pforge/freezer/Standalone.py +845 -0
- pforge/freezer/__init__.py +22 -0
- pforge/importing/FakeModules.py +117 -0
- pforge/importing/IgnoreListing.py +449 -0
- pforge/importing/ImportCache.py +98 -0
- pforge/importing/ImportResolving.py +187 -0
- pforge/importing/Importing.py +1729 -0
- pforge/importing/ImportingResults.py +48 -0
- pforge/importing/PreloadedPackages.py +169 -0
- pforge/importing/Recursion.py +881 -0
- pforge/importing/StandardLibrary.py +459 -0
- pforge/importing/__init__.py +22 -0
- pforge/installer/Installer.py +147 -0
- pforge/installer/LinuxInstaller.py +137 -0
- pforge/installer/MacOSDmg.py +197 -0
- pforge/installer/WindowsInstaller.py +162 -0
- pforge/installer/__init__.py +22 -0
- pforge/installer/backends/AppImageBackend.py +261 -0
- pforge/installer/backends/NsisBackend.py +522 -0
- pforge/installer/backends/NsisTemplate.nsi +105 -0
- pforge/installer/backends/__init__.py +26 -0
- pforge/nodes/AsyncgenNodes.py +89 -0
- pforge/nodes/AttributeLookupNodes.py +127 -0
- pforge/nodes/AttributeNodes.py +400 -0
- pforge/nodes/AttributeNodesGenerated.py +10978 -0
- pforge/nodes/BuiltinAllNodes.py +116 -0
- pforge/nodes/BuiltinAnyNodes.py +125 -0
- pforge/nodes/BuiltinComplexNodes.py +92 -0
- pforge/nodes/BuiltinDecodingNodes.py +55 -0
- pforge/nodes/BuiltinDecoratorNodes.py +92 -0
- pforge/nodes/BuiltinDictNodes.py +231 -0
- pforge/nodes/BuiltinFormatNodes.py +165 -0
- pforge/nodes/BuiltinHashNodes.py +70 -0
- pforge/nodes/BuiltinInputNodes.py +46 -0
- pforge/nodes/BuiltinIntegerNodes.py +194 -0
- pforge/nodes/BuiltinIteratorNodes.py +743 -0
- pforge/nodes/BuiltinLenNodes.py +64 -0
- pforge/nodes/BuiltinNextNodes.py +118 -0
- pforge/nodes/BuiltinOpenNodes.py +103 -0
- pforge/nodes/BuiltinOperationNodeBasesGenerated.py +7382 -0
- pforge/nodes/BuiltinRangeNodes.py +701 -0
- pforge/nodes/BuiltinRefNodes.py +328 -0
- pforge/nodes/BuiltinSumNodes.py +111 -0
- pforge/nodes/BuiltinTemplateNodes.py +74 -0
- pforge/nodes/BuiltinTypeNodes.py +491 -0
- pforge/nodes/BuiltinVarsNodes.py +51 -0
- pforge/nodes/BytesNodes.py +830 -0
- pforge/nodes/CallNodes.py +220 -0
- pforge/nodes/Checkers.py +58 -0
- pforge/nodes/ChildrenHavingMixins.py +24956 -0
- pforge/nodes/ClassNodes.py +581 -0
- pforge/nodes/CodeObjectSpecs.py +518 -0
- pforge/nodes/ComparisonNodes.py +691 -0
- pforge/nodes/ConditionalNodes.py +946 -0
- pforge/nodes/ConstantRefNodes.py +1894 -0
- pforge/nodes/ContainerMakingNodes.py +412 -0
- pforge/nodes/ContainerOperationNodes.py +97 -0
- pforge/nodes/CoroutineNodes.py +126 -0
- pforge/nodes/CtypesNodes.py +52 -0
- pforge/nodes/DictionaryNodes.py +1571 -0
- pforge/nodes/ExceptionNodes.py +467 -0
- pforge/nodes/ExecEvalNodes.py +246 -0
- pforge/nodes/ExpressionBases.py +1356 -0
- pforge/nodes/ExpressionBasesGenerated.py +3183 -0
- pforge/nodes/ExpressionShapeMixins.py +965 -0
- pforge/nodes/FrameNodes.py +516 -0
- pforge/nodes/FunctionAttributeNodes.py +105 -0
- pforge/nodes/FunctionNodes.py +1347 -0
- pforge/nodes/FutureSpecs.py +227 -0
- pforge/nodes/GeneratorNodes.py +204 -0
- pforge/nodes/GlobalsLocalsNodes.py +226 -0
- pforge/nodes/HardImportNodes.py +52 -0
- pforge/nodes/HardImportNodesGenerated.py +5059 -0
- pforge/nodes/ImportHardNodes.py +193 -0
- pforge/nodes/ImportNodes.py +1542 -0
- pforge/nodes/IndicatorMixins.py +82 -0
- pforge/nodes/IterationHandles.py +412 -0
- pforge/nodes/KeyValuePairNodes.py +381 -0
- pforge/nodes/ListOperationNodes.py +534 -0
- pforge/nodes/LocalsDictNodes.py +778 -0
- pforge/nodes/LocalsScopes.py +539 -0
- pforge/nodes/LoopNodes.py +605 -0
- pforge/nodes/MatchNodes.py +63 -0
- pforge/nodes/ModuleAttributeNodes.py +209 -0
- pforge/nodes/ModuleNodes.py +1233 -0
- pforge/nodes/NetworkxNodes.py +46 -0
- pforge/nodes/NodeBases.py +957 -0
- pforge/nodes/NodeMakingHelpers.py +500 -0
- pforge/nodes/NodeMetaClasses.py +171 -0
- pforge/nodes/OperatorNodes.py +1094 -0
- pforge/nodes/OperatorNodesUnary.py +406 -0
- pforge/nodes/OsSysNodes.py +344 -0
- pforge/nodes/OutlineNodes.py +504 -0
- pforge/nodes/PackageMetadataNodes.py +999 -0
- pforge/nodes/PackageResourceNodes.py +566 -0
- pforge/nodes/PrintNodes.py +178 -0
- pforge/nodes/ReturnNodes.py +258 -0
- pforge/nodes/RuntimePathNodes.py +44 -0
- pforge/nodes/SideEffectNodes.py +142 -0
- pforge/nodes/SliceNodes.py +401 -0
- pforge/nodes/StatementBasesGenerated.py +3896 -0
- pforge/nodes/StatementNodes.py +299 -0
- pforge/nodes/StrNodes.py +989 -0
- pforge/nodes/StringConcatenationNodes.py +130 -0
- pforge/nodes/SubscriptNodes.py +248 -0
- pforge/nodes/TensorflowNodes.py +39 -0
- pforge/nodes/TryNodes.py +523 -0
- pforge/nodes/TypeMatchNodes.py +68 -0
- pforge/nodes/TypeNodes.py +450 -0
- pforge/nodes/VariableAssignNodes.py +1256 -0
- pforge/nodes/VariableDelNodes.py +364 -0
- pforge/nodes/VariableNameNodes.py +156 -0
- pforge/nodes/VariableRefNodes.py +886 -0
- pforge/nodes/VariableReleaseNodes.py +179 -0
- pforge/nodes/YieldNodes.py +124 -0
- pforge/nodes/__init__.py +22 -0
- pforge/nodes/shapes/BuiltinTypeShapes.py +4461 -0
- pforge/nodes/shapes/ControlFlowDescriptions.py +224 -0
- pforge/nodes/shapes/IteratorShapes.py +70 -0
- pforge/nodes/shapes/ShapeMixins.py +272 -0
- pforge/nodes/shapes/StandardShapes.py +1417 -0
- pforge/nodes/shapes/__init__.py +22 -0
- pforge/optimizations/BytecodeDemotion.py +103 -0
- pforge/optimizations/FunctionInlining.py +113 -0
- pforge/optimizations/Graphs.py +73 -0
- pforge/optimizations/Optimization.py +429 -0
- pforge/optimizations/OptimizeBuiltinCalls.py +1668 -0
- pforge/optimizations/Tags.py +86 -0
- pforge/optimizations/TraceCollections.py +1523 -0
- pforge/optimizations/__init__.py +22 -0
- pforge/optimizations/bench_startup.py +62 -0
- pforge/optimizations/bench_tags.py +55 -0
- pforge/optimizations/value_traces/ValueTraces.py +61 -0
- pforge/optimizations/value_traces/ValueTracesGenerated.py +1920 -0
- pforge/optimizations/value_traces/ValueTracesStatic.py +1596 -0
- pforge/optimizations/value_traces/__init__.py +22 -0
- pforge/options/BuildPackage.py +193 -0
- pforge/options/BuildPackageCommon.py +109 -0
- pforge/options/CommandLineOptionsTools.py +359 -0
- pforge/options/OptionParsing.py +3385 -0
- pforge/options/Options.py +3736 -0
- pforge/options/PathSpecs.py +246 -0
- pforge/options/Poetry.py +96 -0
- pforge/options/UvBuild.py +159 -0
- pforge/options/__init__.py +22 -0
- pforge/package_config/__init__.py +22 -0
- pforge/pgo/Pgo.py +865 -0
- pforge/pgo/PgoFormat.py +240 -0
- pforge/pgo/__init__.py +22 -0
- pforge/plugins/Hooks.py +437 -0
- pforge/plugins/PluginBase.py +2267 -0
- pforge/plugins/Plugins.py +2681 -0
- pforge/plugins/PluginsUsage.py +72 -0
- pforge/plugins/YamlPluginBase.py +132 -0
- pforge/plugins/__init__.py +22 -0
- pforge/plugins/standard/AntiBloatPlugin.py +1134 -0
- pforge/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +97 -0
- pforge/plugins/standard/DataFilesPlugin.py +347 -0
- pforge/plugins/standard/DelvewheelPlugin.py +161 -0
- pforge/plugins/standard/DillPlugin/DillPlugin.c +40 -0
- pforge/plugins/standard/DillPlugin/cloudpickle-postLoad.py +69 -0
- pforge/plugins/standard/DillPlugin/dill-postLoad.py +228 -0
- pforge/plugins/standard/DillPlugin.py +152 -0
- pforge/plugins/standard/DllFilesPlugin.py +564 -0
- pforge/plugins/standard/EnumPlugin.py +67 -0
- pforge/plugins/standard/EventletPlugin.py +37 -0
- pforge/plugins/standard/GeventPlugin.py +66 -0
- pforge/plugins/standard/GiPlugin.py +278 -0
- pforge/plugins/standard/GlfwPlugin.py +179 -0
- pforge/plugins/standard/ImplicitImports.py +1023 -0
- pforge/plugins/standard/KivyPlugin.py +143 -0
- pforge/plugins/standard/MatplotlibPlugin.py +260 -0
- pforge/plugins/standard/MultiprocessingPlugin.py +372 -0
- pforge/plugins/standard/NumbaPlugin.py +110 -0
- pforge/plugins/standard/NumpyPlugin.py +37 -0
- pforge/plugins/standard/OptionsNannyPlugin.py +145 -0
- pforge/plugins/standard/PbrPlugin.py +65 -0
- pforge/plugins/standard/PkgResourcesPlugin.py +171 -0
- pforge/plugins/standard/PlaywrightPlugin.py +181 -0
- pforge/plugins/standard/PmwPlugin.py +249 -0
- pforge/plugins/standard/PySidePyQtPlugin.py +1830 -0
- pforge/plugins/standard/PywebViewPlugin.py +85 -0
- pforge/plugins/standard/SourceInclusionPlugin.py +671 -0
- pforge/plugins/standard/SpacyPlugin.py +138 -0
- pforge/plugins/standard/TensorflowPlugin.py +37 -0
- pforge/plugins/standard/TkinterPlugin.py +636 -0
- pforge/plugins/standard/TorchHubPlugin.py +521 -0
- pforge/plugins/standard/TorchJitPlugin.py +236 -0
- pforge/plugins/standard/TorchPlugin.py +37 -0
- pforge/plugins/standard/TransformersPlugin.py +333 -0
- pforge/plugins/standard/TrioPlugin.py +35 -0
- pforge/plugins/standard/UpxPlugin.py +191 -0
- pforge/plugins/standard/__init__.py +22 -0
- pforge/plugins/standard/standard.pforge-package.config.yml +10867 -0
- pforge/plugins/standard/stdlib.pforge-package.config.yml +410 -0
- pforge/plugins/standard/stdlib2.pforge-package.config.yml +72 -0
- pforge/plugins/standard/stdlib3.pforge-package.config.yml +100 -0
- pforge/reports/CompilationReportReader.py +134 -0
- pforge/reports/LicenseReport.rst.j2 +44 -0
- pforge/reports/Reports.py +1560 -0
- pforge/reports/__init__.py +22 -0
- pforge/specs/BuiltinBytesOperationSpecs.py +196 -0
- pforge/specs/BuiltinDictOperationSpecs.py +96 -0
- pforge/specs/BuiltinListOperationSpecs.py +83 -0
- pforge/specs/BuiltinParameterSpecs.py +953 -0
- pforge/specs/BuiltinStrOperationSpecs.py +215 -0
- pforge/specs/BuiltinTypeOperationSpecs.py +37 -0
- pforge/specs/BuiltinUnicodeOperationSpecs.py +132 -0
- pforge/specs/HardImportSpecs.py +275 -0
- pforge/specs/ParameterSpecs.py +683 -0
- pforge/specs/__init__.py +22 -0
- pforge/targets/TargetLinux.py +278 -0
- pforge/targets/TargetMatrix.py +415 -0
- pforge/targets/TargetNative.py +132 -0
- pforge/targets/TargetPython.py +914 -0
- pforge/targets/TargetWASI.py +124 -0
- pforge/targets/TargetWin32.py +304 -0
- pforge/targets/Targets.py +378 -0
- pforge/targets/__init__.py +22 -0
- pforge/tools/Basics.py +60 -0
- pforge/tools/__init__.py +22 -0
- pforge/tools/commercial/__init__.py +22 -0
- pforge/tools/data_composer/DataComposer.py +764 -0
- pforge/tools/data_composer/__init__.py +22 -0
- pforge/tools/data_composer/__main__.py +42 -0
- pforge/tools/environments/CreateEnvironment.py +72 -0
- pforge/tools/environments/Virtualenv.py +219 -0
- pforge/tools/environments/__init__.py +22 -0
- pforge/tools/general/__init__.py +22 -0
- pforge/tools/general/dll_report/__init__.py +22 -0
- pforge/tools/general/dll_report/__main__.py +87 -0
- pforge/tools/general/extract_poetry_config/__init__.py +22 -0
- pforge/tools/general/extract_poetry_config/__main__.py +144 -0
- pforge/tools/general/extract_uv_config/__init__.py +24 -0
- pforge/tools/general/extract_uv_config/__main__.py +202 -0
- pforge/tools/general/find_module/FindModuleCode.py +127 -0
- pforge/tools/general/find_module/__init__.py +22 -0
- pforge/tools/general/generate_header/GenerateHeader.py +168 -0
- pforge/tools/general/generate_header/GenerateOffsets.py +395 -0
- pforge/tools/general/generate_header/__init__.py +22 -0
- pforge/tools/onefile_compressor/OnefileCompressor.py +535 -0
- pforge/tools/onefile_compressor/__init__.py +22 -0
- pforge/tools/onefile_compressor/__main__.py +42 -0
- pforge/tools/podman/Container.py +850 -0
- pforge/tools/podman/Podman.py +58 -0
- pforge/tools/podman/__init__.py +22 -0
- pforge/tools/podman/__main__.py +173 -0
- pforge/tools/podman/containers/CI.containerfile +69 -0
- pforge/tools/podman/containers/Python-Minor-Versions.containerfile.j2 +39 -0
- pforge/tools/profiler/__init__.py +22 -0
- pforge/tools/profiler/__main__.py +96 -0
- pforge/tools/scanning/DisplayDistributions.py +60 -0
- pforge/tools/scanning/DisplayPackageDLLs.py +159 -0
- pforge/tools/scanning/DisplayPackageData.py +78 -0
- pforge/tools/scanning/__init__.py +22 -0
- pforge/tools/specialize/CTypeDescriptions.py +1931 -0
- pforge/tools/specialize/Common.py +454 -0
- pforge/tools/specialize/SpecializeC.py +1896 -0
- pforge/tools/specialize/SpecializePython.py +1356 -0
- pforge/tools/specialize/__init__.py +22 -0
- pforge/tools/testing/Common.py +2190 -0
- pforge/tools/testing/Constructs.py +54 -0
- pforge/tools/testing/Coverage.py +197 -0
- pforge/tools/testing/DocTests.py +159 -0
- pforge/tools/testing/OutputComparison.py +492 -0
- pforge/tools/testing/Pythons.py +37 -0
- pforge/tools/testing/RuntimeTracing.py +296 -0
- pforge/tools/testing/SearchModes.py +292 -0
- pforge/tools/testing/Valgrind.py +106 -0
- pforge/tools/testing/__init__.py +22 -0
- pforge/tools/testing/check_reference_counts/__init__.py +22 -0
- pforge/tools/testing/check_reference_counts/__main__.py +108 -0
- pforge/tools/testing/compare_with_cpython/__init__.py +22 -0
- pforge/tools/testing/compare_with_cpython/__main__.py +1107 -0
- pforge/tools/testing/find_sxs_modules/__init__.py +22 -0
- pforge/tools/testing/find_sxs_modules/__main__.py +74 -0
- pforge/tools/testing/measure_construct_performance/__init__.py +22 -0
- pforge/tools/testing/measure_construct_performance/__main__.py +291 -0
- pforge/tools/testing/run_pforge_tests/__init__.py +22 -0
- pforge/tools/testing/run_pforge_tests/__main__.py +1146 -0
- pforge/tools/watch/AutoStage.py +462 -0
- pforge/tools/watch/Common.py +54 -0
- pforge/tools/watch/Conda.py +128 -0
- pforge/tools/watch/GitHub.py +116 -0
- pforge/tools/watch/Pacman.py +76 -0
- pforge/tools/watch/Pipenv.py +165 -0
- pforge/tools/watch/__init__.py +22 -0
- pforge/tools/watch/__main__.py +727 -0
- pforge/tree/Building.py +1595 -0
- pforge/tree/ComplexCallHelperFunctions.py +2279 -0
- pforge/tree/Extractions.py +75 -0
- pforge/tree/FutureSpecState.py +76 -0
- pforge/tree/InternalModule.py +99 -0
- pforge/tree/Operations.py +108 -0
- pforge/tree/ReformulationAssertStatements.py +110 -0
- pforge/tree/ReformulationAssignmentStatements.py +1513 -0
- pforge/tree/ReformulationBooleanExpressions.py +100 -0
- pforge/tree/ReformulationCallExpressions.py +336 -0
- pforge/tree/ReformulationClasses.py +403 -0
- pforge/tree/ReformulationClasses3.py +1519 -0
- pforge/tree/ReformulationComparisonExpressions.py +177 -0
- pforge/tree/ReformulationContractionExpressions.py +809 -0
- pforge/tree/ReformulationDictionaryCreation.py +308 -0
- pforge/tree/ReformulationExecStatements.py +387 -0
- pforge/tree/ReformulationForLoopStatements.py +218 -0
- pforge/tree/ReformulationFunctionStatements.py +1306 -0
- pforge/tree/ReformulationImportStatements.py +350 -0
- pforge/tree/ReformulationLambdaExpressions.py +196 -0
- pforge/tree/ReformulationMatchStatements.py +902 -0
- pforge/tree/ReformulationMultidist.py +83 -0
- pforge/tree/ReformulationNamespacePackages.py +264 -0
- pforge/tree/ReformulationPrintStatements.py +130 -0
- pforge/tree/ReformulationSequenceCreation.py +443 -0
- pforge/tree/ReformulationSubscriptExpressions.py +126 -0
- pforge/tree/ReformulationTryExceptStatements.py +720 -0
- pforge/tree/ReformulationTryFinallyStatements.py +244 -0
- pforge/tree/ReformulationWhileLoopStatements.py +162 -0
- pforge/tree/ReformulationWithStatements.py +394 -0
- pforge/tree/ReformulationYieldExpressions.py +136 -0
- pforge/tree/SourceHandling.py +522 -0
- pforge/tree/SyntaxErrors.py +245 -0
- pforge/tree/TreeHelpers.py +759 -0
- pforge/tree/VariableClosure.py +554 -0
- pforge/tree/__init__.py +22 -0
- pforge/utils/AppDirs.py +148 -0
- pforge/utils/CStrings.py +208 -0
- pforge/utils/Diffs.py +192 -0
- pforge/utils/Distributions.py +901 -0
- pforge/utils/Download.py +466 -0
- pforge/utils/Execution.py +1154 -0
- pforge/utils/FileOperations.py +2481 -0
- pforge/utils/Hashing.py +159 -0
- pforge/utils/Images.py +75 -0
- pforge/utils/Importing.py +392 -0
- pforge/utils/InlineCopies.py +132 -0
- pforge/utils/InstalledPythons.py +281 -0
- pforge/utils/InstanceCounters.py +89 -0
- pforge/utils/Jinja2.py +195 -0
- pforge/utils/Json.py +96 -0
- pforge/utils/LinuxPython.py +365 -0
- pforge/utils/MemoryUsage.py +166 -0
- pforge/utils/ModuleNames.py +384 -0
- pforge/utils/PackageResources.py +67 -0
- pforge/utils/PrivatePipSpace.py +1317 -0
- pforge/utils/Profiling.py +243 -0
- pforge/utils/PythonPrefetch.py +391 -0
- pforge/utils/ReExecute.py +120 -0
- pforge/utils/Rest.py +63 -0
- pforge/utils/SharedLibraries.py +1623 -0
- pforge/utils/Shebang.py +114 -0
- pforge/utils/Signing.py +500 -0
- pforge/utils/SlotMetaClasses.py +60 -0
- pforge/utils/StaticLibraries.py +422 -0
- pforge/utils/ThreadedExecutor.py +90 -0
- pforge/utils/Timing.py +201 -0
- pforge/utils/Toml.py +65 -0
- pforge/utils/Utils.py +643 -0
- pforge/utils/WasiPython.py +428 -0
- pforge/utils/WasiSDK.py +226 -0
- pforge/utils/Wasmtime.py +178 -0
- pforge/utils/WindowsFileUsage.py +338 -0
- pforge/utils/WindowsResources.py +659 -0
- pforge/utils/Yaml.py +1143 -0
- pforge/utils/Zipfiles.py +131 -0
- pforge/utils/__init__.py +22 -0
- pforge/utils/requirements-private.txt +26 -0
- pforge-1.0.0.data/scripts/compile-python-for-pforge-linux.sh +232 -0
- pforge-1.0.0.dist-info/METADATA +2228 -0
- pforge-1.0.0.dist-info/RECORD +1090 -0
- pforge-1.0.0.dist-info/WHEEL +5 -0
- pforge-1.0.0.dist-info/entry_points.txt +11 -0
- pforge-1.0.0.dist-info/licenses/LICENSE-RUNTIME.txt +57 -0
- pforge-1.0.0.dist-info/licenses/LICENSE.txt +661 -0
- pforge-1.0.0.dist-info/licenses/NOTICE.txt +11 -0
- pforge-1.0.0.dist-info/top_level.txt +1 -0
- pforge-1.0.0.dist-info/zip-safe +1 -0
|
@@ -0,0 +1,1306 @@
|
|
|
1
|
+
# Copyright 2026, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
"""Reformulation of function statements.
|
|
5
|
+
|
|
6
|
+
Consult the Developer Manual for information. TODO: Add ability to sync
|
|
7
|
+
source code comments with Developer Manual sections.
|
|
8
|
+
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import ast
|
|
12
|
+
|
|
13
|
+
from pforge.nodes.AsyncgenNodes import (
|
|
14
|
+
ExpressionAsyncgenObjectBody,
|
|
15
|
+
ExpressionMakeAsyncgenObject,
|
|
16
|
+
)
|
|
17
|
+
from pforge.nodes.BuiltinIteratorNodes import (
|
|
18
|
+
ExpressionBuiltinIter1,
|
|
19
|
+
ExpressionBuiltinIterForUnpack,
|
|
20
|
+
StatementSpecialUnpackCheck,
|
|
21
|
+
)
|
|
22
|
+
from pforge.nodes.BuiltinNextNodes import (
|
|
23
|
+
ExpressionBuiltinNext1,
|
|
24
|
+
ExpressionSpecialUnpack,
|
|
25
|
+
)
|
|
26
|
+
from pforge.nodes.BuiltinRefNodes import (
|
|
27
|
+
ExpressionBuiltinExceptionRef,
|
|
28
|
+
makeExpressionBuiltinTypeRef,
|
|
29
|
+
)
|
|
30
|
+
from pforge.nodes.CodeObjectSpecs import CodeObjectSpec
|
|
31
|
+
from pforge.nodes.ComparisonNodes import (
|
|
32
|
+
ExpressionComparisonGt,
|
|
33
|
+
makeComparisonExpression,
|
|
34
|
+
)
|
|
35
|
+
from pforge.nodes.ConditionalNodes import (
|
|
36
|
+
ExpressionConditional,
|
|
37
|
+
makeStatementConditional,
|
|
38
|
+
)
|
|
39
|
+
from pforge.nodes.ConstantRefNodes import (
|
|
40
|
+
ExpressionConstantIntRef,
|
|
41
|
+
makeConstantRefNode,
|
|
42
|
+
)
|
|
43
|
+
from pforge.nodes.ContainerMakingNodes import ExpressionMakeTuple
|
|
44
|
+
from pforge.nodes.CoroutineNodes import (
|
|
45
|
+
ExpressionCoroutineObjectBody,
|
|
46
|
+
ExpressionMakeCoroutineObject,
|
|
47
|
+
)
|
|
48
|
+
from pforge.nodes.DictionaryNodes import makeExpressionMakeDict
|
|
49
|
+
from pforge.nodes.ExceptionNodes import StatementRaiseException
|
|
50
|
+
from pforge.nodes.ExecEvalNodes import ExpressionBuiltinExec
|
|
51
|
+
from pforge.nodes.FrameNodes import StatementsFrameFunction
|
|
52
|
+
from pforge.nodes.FunctionNodes import (
|
|
53
|
+
ExpressionFunctionBody,
|
|
54
|
+
ExpressionFunctionRef,
|
|
55
|
+
makeExpressionFunctionCreation,
|
|
56
|
+
)
|
|
57
|
+
from pforge.nodes.GeneratorNodes import (
|
|
58
|
+
ExpressionGeneratorObjectBody,
|
|
59
|
+
ExpressionMakeGeneratorObject,
|
|
60
|
+
StatementGeneratorReturnNone,
|
|
61
|
+
)
|
|
62
|
+
from pforge.nodes.KeyValuePairNodes import (
|
|
63
|
+
makeExpressionKeyValuePairConstantKey,
|
|
64
|
+
)
|
|
65
|
+
from pforge.nodes.LocalsDictNodes import StatementSetLocalsDictionary
|
|
66
|
+
from pforge.nodes.OperatorNodes import makeBinaryOperationNode
|
|
67
|
+
from pforge.nodes.OutlineNodes import ExpressionOutlineFunction
|
|
68
|
+
from pforge.nodes.ReturnNodes import StatementReturn, StatementReturnNone
|
|
69
|
+
from pforge.nodes.StatementNodes import StatementExpressionOnly
|
|
70
|
+
from pforge.nodes.VariableAssignNodes import makeStatementAssignmentVariable
|
|
71
|
+
from pforge.nodes.VariableNameNodes import (
|
|
72
|
+
ExpressionVariableNameRef,
|
|
73
|
+
StatementAssignmentVariableName,
|
|
74
|
+
)
|
|
75
|
+
from pforge.nodes.VariableRefNodes import (
|
|
76
|
+
ExpressionTempVariableRef,
|
|
77
|
+
ExpressionVariableRef,
|
|
78
|
+
)
|
|
79
|
+
from pforge.options.Options import isExperimental
|
|
80
|
+
from pforge.plugins.Hooks import (
|
|
81
|
+
decideNeedsFrameLocalsProxy,
|
|
82
|
+
getUncompiledDecoratorNames,
|
|
83
|
+
onFunctionBodyParsing,
|
|
84
|
+
)
|
|
85
|
+
from pforge.PythonVersions import python_version
|
|
86
|
+
from pforge.specs.ParameterSpecs import ParameterSpec
|
|
87
|
+
|
|
88
|
+
from .FutureSpecState import getFutureSpec
|
|
89
|
+
from .ReformulationExecStatements import wrapEvalGlobalsAndLocals
|
|
90
|
+
from .ReformulationTryFinallyStatements import (
|
|
91
|
+
makeTryFinallyReleaseStatement,
|
|
92
|
+
makeTryFinallyStatement,
|
|
93
|
+
)
|
|
94
|
+
from .SyntaxErrors import checkDebugNameAssignment, raiseSyntaxError
|
|
95
|
+
from .TreeHelpers import (
|
|
96
|
+
buildAnnotationNode,
|
|
97
|
+
buildFrameNode,
|
|
98
|
+
buildNode,
|
|
99
|
+
buildNodeList,
|
|
100
|
+
buildNodeTuple,
|
|
101
|
+
detectFunctionBodyKind,
|
|
102
|
+
extractDocFromBody,
|
|
103
|
+
getKind,
|
|
104
|
+
makeCallNode,
|
|
105
|
+
makeDictCreationOrConstant2,
|
|
106
|
+
makeStatementsSequence,
|
|
107
|
+
makeStatementsSequenceFromStatement,
|
|
108
|
+
makeStatementsSequenceFromStatements,
|
|
109
|
+
mangleName,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _insertFinalReturnStatement(function_statements_body, return_statement):
|
|
114
|
+
if function_statements_body is None:
|
|
115
|
+
function_statements_body = makeStatementsSequenceFromStatement(
|
|
116
|
+
statement=return_statement
|
|
117
|
+
)
|
|
118
|
+
elif not function_statements_body.isStatementAborting():
|
|
119
|
+
function_statements_body.setChildStatements(
|
|
120
|
+
function_statements_body.subnode_statements + (return_statement,)
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
return function_statements_body
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _insertInitialSetLocalsDictStatement(function_body, function_statements_body):
|
|
127
|
+
locals_statement = StatementSetLocalsDictionary(
|
|
128
|
+
locals_scope=function_body.getLocalsScope(), source_ref=function_body.source_ref
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
if function_statements_body is None:
|
|
132
|
+
function_statements_body = makeStatementsSequenceFromStatement(
|
|
133
|
+
statement=locals_statement
|
|
134
|
+
)
|
|
135
|
+
else:
|
|
136
|
+
function_statements_body.setChildStatements(
|
|
137
|
+
(locals_statement,) + function_statements_body.subnode_statements
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
return function_statements_body
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def _injectDecorator(decorators, inject, acceptable, source_ref):
|
|
144
|
+
assert type(decorators) is list
|
|
145
|
+
assert type(inject) is str
|
|
146
|
+
assert type(acceptable) is tuple
|
|
147
|
+
|
|
148
|
+
for decorator in decorators:
|
|
149
|
+
if (
|
|
150
|
+
decorator.isExpressionVariableNameRef()
|
|
151
|
+
and decorator.getVariableName() in acceptable
|
|
152
|
+
):
|
|
153
|
+
break
|
|
154
|
+
else:
|
|
155
|
+
decorators.append(
|
|
156
|
+
makeExpressionBuiltinTypeRef(builtin_name=inject, source_ref=source_ref)
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def _getDecoratorName(decorator):
|
|
161
|
+
# Attribute lookups are considered too, so that e.g. "@numba.njit" or
|
|
162
|
+
# "@numba.jit(nopython=True)" can be recognized by their attribute name.
|
|
163
|
+
if decorator.isExpressionVariableNameRef():
|
|
164
|
+
return decorator.getVariableName()
|
|
165
|
+
|
|
166
|
+
if decorator.isExpressionAttributeLookup():
|
|
167
|
+
return decorator.getAttributeName()
|
|
168
|
+
|
|
169
|
+
if decorator.isExpressionCall():
|
|
170
|
+
return _getDecoratorName(decorator.subnode_called)
|
|
171
|
+
|
|
172
|
+
return None
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def _isUncompiledDecorator(decorator):
|
|
176
|
+
decorator_name = _getDecoratorName(decorator)
|
|
177
|
+
|
|
178
|
+
# Hard coded name.
|
|
179
|
+
if decorator_name == "pforge_ignore":
|
|
180
|
+
return True
|
|
181
|
+
|
|
182
|
+
# False alarm, pylint: disable=I0021,unsupported-membership-test
|
|
183
|
+
if decorator_name in getUncompiledDecoratorNames():
|
|
184
|
+
return True
|
|
185
|
+
|
|
186
|
+
return False
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def decideFunctionCompilationMode(decorators):
|
|
190
|
+
"""Decide how to compile a function based on decorator names."""
|
|
191
|
+
for decorator in decorators:
|
|
192
|
+
if _isUncompiledDecorator(decorator):
|
|
193
|
+
return "bytecode"
|
|
194
|
+
|
|
195
|
+
return "compiled"
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _buildBytecodeOrSourceFunction(provider, node, compilation_mode, source_ref):
|
|
199
|
+
# TODO: We should have a compile() builtin usage here, lookup "co_code" and
|
|
200
|
+
# support that as a constant value. We then would have the "bytecode" only
|
|
201
|
+
# in the binary, right now "bytecode" and "source" make no difference.
|
|
202
|
+
# pylint: disable=unused-argument
|
|
203
|
+
source_code = ast.unparse(node)
|
|
204
|
+
|
|
205
|
+
source = makeConstantRefNode(
|
|
206
|
+
constant=source_code,
|
|
207
|
+
source_ref=source_ref,
|
|
208
|
+
user_provided=True,
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
# if compilation_mode == "bytecode":
|
|
212
|
+
# source = ExpressionBuiltinCompile(
|
|
213
|
+
# source_code=source,
|
|
214
|
+
# filename=makeConstantRefNode(constant="<exec>", source_ref=source_ref),
|
|
215
|
+
# mode=makeConstantRefNode(constant="exec", source_ref=source_ref),
|
|
216
|
+
# flags=None,
|
|
217
|
+
# dont_inherit=None,
|
|
218
|
+
# optimize=None,
|
|
219
|
+
# source_ref=source_ref
|
|
220
|
+
# )
|
|
221
|
+
|
|
222
|
+
# This is actually for the globals locals usage to be default values of the
|
|
223
|
+
# scope.
|
|
224
|
+
|
|
225
|
+
temp_scope = provider.allocateTempScope("function_exec")
|
|
226
|
+
|
|
227
|
+
globals_ref, locals_ref, tried, final = wrapEvalGlobalsAndLocals(
|
|
228
|
+
provider=provider,
|
|
229
|
+
locals_scope=provider.getLocalsScope(),
|
|
230
|
+
globals_node=None,
|
|
231
|
+
locals_node=None,
|
|
232
|
+
temp_scope=temp_scope,
|
|
233
|
+
source_ref=source_ref,
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
tried = makeStatementsSequence(
|
|
237
|
+
statements=(
|
|
238
|
+
tried,
|
|
239
|
+
(
|
|
240
|
+
StatementExpressionOnly(
|
|
241
|
+
expression=ExpressionBuiltinExec(
|
|
242
|
+
source_code=source,
|
|
243
|
+
globals_arg=globals_ref,
|
|
244
|
+
locals_arg=locals_ref,
|
|
245
|
+
closure=None,
|
|
246
|
+
source_ref=source_ref,
|
|
247
|
+
),
|
|
248
|
+
source_ref=source_ref,
|
|
249
|
+
)
|
|
250
|
+
),
|
|
251
|
+
),
|
|
252
|
+
source_ref=source_ref,
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
# Hack: Allow some APIs to work already
|
|
256
|
+
# tried.parent = provider
|
|
257
|
+
|
|
258
|
+
return makeTryFinallyStatement(
|
|
259
|
+
provider=provider,
|
|
260
|
+
tried=tried,
|
|
261
|
+
final=final,
|
|
262
|
+
source_ref=source_ref,
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def _getFunctionProvider(provider, node, source_ref):
|
|
267
|
+
if python_version >= 0x3C0 and node.type_params:
|
|
268
|
+
type_params_outline = ExpressionOutlineFunction(
|
|
269
|
+
provider, "create_type_annotations", source_ref
|
|
270
|
+
)
|
|
271
|
+
return type_params_outline
|
|
272
|
+
else:
|
|
273
|
+
return provider
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def _maybeWrapWithAnnotations(function_provider, node, function_creation, source_ref):
|
|
277
|
+
if python_version >= 0x3C0 and node.type_params:
|
|
278
|
+
type_statements = []
|
|
279
|
+
|
|
280
|
+
for type_param in node.type_params:
|
|
281
|
+
type_var = buildNode(
|
|
282
|
+
provider=function_provider, node=type_param, source_ref=source_ref
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
assign = StatementAssignmentVariableName(
|
|
286
|
+
provider=function_provider,
|
|
287
|
+
variable_name=type_param.name,
|
|
288
|
+
source=type_var,
|
|
289
|
+
source_ref=source_ref,
|
|
290
|
+
)
|
|
291
|
+
type_statements.append(assign)
|
|
292
|
+
|
|
293
|
+
type_statements.append(StatementReturn(function_creation, source_ref))
|
|
294
|
+
assert function_provider.isExpressionOutlineFunction()
|
|
295
|
+
function_provider.setChildBody(
|
|
296
|
+
makeStatementsSequenceFromStatements(type_statements)
|
|
297
|
+
)
|
|
298
|
+
return function_provider
|
|
299
|
+
else:
|
|
300
|
+
return function_creation
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
def buildFunctionNode(provider, node, source_ref):
|
|
304
|
+
# Functions have way too many details,
|
|
305
|
+
# pylint: disable=too-many-branches,too-many-locals
|
|
306
|
+
|
|
307
|
+
assert getKind(node) == "FunctionDef"
|
|
308
|
+
|
|
309
|
+
decorators = buildNodeList(
|
|
310
|
+
provider=provider, nodes=reversed(node.decorator_list), source_ref=source_ref
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
compilation_mode = decideFunctionCompilationMode(decorators)
|
|
314
|
+
|
|
315
|
+
onFunctionBodyParsing(provider=provider, function_name=node.name, body=node.body)
|
|
316
|
+
|
|
317
|
+
if compilation_mode != "compiled":
|
|
318
|
+
node.name = mangleName(node.name, provider)
|
|
319
|
+
|
|
320
|
+
return _buildBytecodeOrSourceFunction(
|
|
321
|
+
provider=provider,
|
|
322
|
+
node=node,
|
|
323
|
+
compilation_mode=compilation_mode,
|
|
324
|
+
source_ref=source_ref,
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
function_provider = _getFunctionProvider(provider, node, source_ref)
|
|
328
|
+
|
|
329
|
+
function_statement_nodes, function_doc = extractDocFromBody(node)
|
|
330
|
+
|
|
331
|
+
function_kind, flags = detectFunctionBodyKind(nodes=function_statement_nodes)
|
|
332
|
+
|
|
333
|
+
function_body, code_body, code_object = buildFunctionWithParsing(
|
|
334
|
+
provider=function_provider,
|
|
335
|
+
function_kind=function_kind,
|
|
336
|
+
name=node.name,
|
|
337
|
+
function_doc=function_doc,
|
|
338
|
+
flags=flags,
|
|
339
|
+
node=node,
|
|
340
|
+
source_ref=source_ref,
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
if function_kind in ("Generator", "Coroutine"):
|
|
344
|
+
if function_kind == "Coroutine":
|
|
345
|
+
code_body = ExpressionCoroutineObjectBody(
|
|
346
|
+
provider=function_body,
|
|
347
|
+
name=node.name,
|
|
348
|
+
code_object=code_object,
|
|
349
|
+
flags=flags,
|
|
350
|
+
auto_release=None,
|
|
351
|
+
source_ref=source_ref,
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
maker_class = ExpressionMakeCoroutineObject
|
|
355
|
+
else:
|
|
356
|
+
code_body = ExpressionGeneratorObjectBody(
|
|
357
|
+
provider=function_body,
|
|
358
|
+
name=node.name,
|
|
359
|
+
code_object=code_object,
|
|
360
|
+
flags=flags,
|
|
361
|
+
auto_release=None,
|
|
362
|
+
source_ref=source_ref,
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
maker_class = ExpressionMakeGeneratorObject
|
|
366
|
+
|
|
367
|
+
code_body.qualname_provider = provider
|
|
368
|
+
|
|
369
|
+
for variable in function_body.getProvidedVariables():
|
|
370
|
+
code_body.getVariableForReference(variable.getName())
|
|
371
|
+
|
|
372
|
+
function_body.setChildBody(
|
|
373
|
+
makeStatementsSequenceFromStatement(
|
|
374
|
+
statement=StatementReturn(
|
|
375
|
+
expression=maker_class(
|
|
376
|
+
ExpressionFunctionRef(
|
|
377
|
+
function_body=code_body, source_ref=source_ref
|
|
378
|
+
),
|
|
379
|
+
source_ref=source_ref,
|
|
380
|
+
),
|
|
381
|
+
source_ref=source_ref,
|
|
382
|
+
)
|
|
383
|
+
)
|
|
384
|
+
)
|
|
385
|
+
|
|
386
|
+
defaults = buildNodeTuple(
|
|
387
|
+
provider=provider, nodes=node.args.defaults, source_ref=source_ref
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
kw_defaults = buildParameterKwDefaults(
|
|
391
|
+
provider=function_provider,
|
|
392
|
+
node=node,
|
|
393
|
+
function_body=function_body,
|
|
394
|
+
source_ref=source_ref,
|
|
395
|
+
)
|
|
396
|
+
|
|
397
|
+
function_statements_body = buildFrameNode(
|
|
398
|
+
provider=code_body,
|
|
399
|
+
nodes=function_statement_nodes,
|
|
400
|
+
code_object=code_object,
|
|
401
|
+
source_ref=source_ref,
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
if function_kind == "Function":
|
|
405
|
+
# TODO: Generators might have to raise GeneratorExit instead.
|
|
406
|
+
function_statements_body = _insertFinalReturnStatement(
|
|
407
|
+
function_statements_body=function_statements_body,
|
|
408
|
+
return_statement=StatementReturnNone(source_ref=source_ref),
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
if "has_exec" in flags:
|
|
412
|
+
function_statements_body = _insertInitialSetLocalsDictStatement(
|
|
413
|
+
function_body=code_body, function_statements_body=function_statements_body
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
if function_statements_body.isStatementsFrame():
|
|
417
|
+
function_statements_body = makeStatementsSequenceFromStatement(
|
|
418
|
+
statement=function_statements_body
|
|
419
|
+
)
|
|
420
|
+
|
|
421
|
+
code_body.setChildBody(function_statements_body)
|
|
422
|
+
|
|
423
|
+
annotations = buildParameterAnnotations(function_provider, node, source_ref)
|
|
424
|
+
|
|
425
|
+
if python_version >= 0x3C0 and node.type_params:
|
|
426
|
+
type_params_tuple = ExpressionMakeTuple(
|
|
427
|
+
elements=buildNodeTuple(provider, node.type_params, source_ref),
|
|
428
|
+
source_ref=source_ref,
|
|
429
|
+
)
|
|
430
|
+
else:
|
|
431
|
+
type_params_tuple = None
|
|
432
|
+
|
|
433
|
+
function_creation = makeExpressionFunctionCreation(
|
|
434
|
+
function_ref=ExpressionFunctionRef(
|
|
435
|
+
function_body=function_body, source_ref=source_ref
|
|
436
|
+
),
|
|
437
|
+
defaults=defaults,
|
|
438
|
+
kw_defaults=kw_defaults,
|
|
439
|
+
annotations=annotations,
|
|
440
|
+
type_params=type_params_tuple,
|
|
441
|
+
source_ref=source_ref,
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
function_creation = _maybeWrapWithAnnotations(
|
|
445
|
+
function_provider, node, function_creation, source_ref
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
# Add the "staticmethod" decorator to __new__ methods if not provided.
|
|
449
|
+
# CPython does this implicitly only for its own function type when
|
|
450
|
+
# creating a class. We add it earlier so our optimization sees it and
|
|
451
|
+
# compiled functions get the same treatment. Before Python 3.10,
|
|
452
|
+
# 'staticmethod' objects are not callable, and 'enum' calls '__new__' from
|
|
453
|
+
# the class namespace directly, so pre-wrapping would break enum classes
|
|
454
|
+
# there.
|
|
455
|
+
if (
|
|
456
|
+
node.name == "__new__"
|
|
457
|
+
and provider.isExpressionClassBodyBase()
|
|
458
|
+
and (python_version < 0x300 or python_version >= 0x3A0)
|
|
459
|
+
):
|
|
460
|
+
_injectDecorator(
|
|
461
|
+
decorators, "staticmethod", ("staticmethod", "classmethod"), source_ref
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
# Add the "classmethod" decorator to __init_subclass__ methods if not provided.
|
|
465
|
+
if (
|
|
466
|
+
python_version >= 0x360
|
|
467
|
+
and node.name == "__init_subclass__"
|
|
468
|
+
and provider.isExpressionClassBodyBase()
|
|
469
|
+
):
|
|
470
|
+
_injectDecorator(decorators, "classmethod", ("classmethod",), source_ref)
|
|
471
|
+
|
|
472
|
+
if (
|
|
473
|
+
python_version >= 0x370
|
|
474
|
+
and node.name == "__class_getitem__"
|
|
475
|
+
and provider.isExpressionClassBodyBase()
|
|
476
|
+
):
|
|
477
|
+
_injectDecorator(decorators, "classmethod", ("classmethod",), source_ref)
|
|
478
|
+
|
|
479
|
+
decorated_function = function_creation
|
|
480
|
+
for decorator in decorators:
|
|
481
|
+
decorated_function = makeCallNode(
|
|
482
|
+
decorator, decorated_function, decorator.getSourceReference()
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
result = StatementAssignmentVariableName(
|
|
486
|
+
provider=provider,
|
|
487
|
+
variable_name=mangleName(node.name, provider),
|
|
488
|
+
source=decorated_function,
|
|
489
|
+
source_ref=source_ref,
|
|
490
|
+
)
|
|
491
|
+
|
|
492
|
+
if python_version >= 0x300:
|
|
493
|
+
function_body.qualname_setup = result.getVariableName()
|
|
494
|
+
|
|
495
|
+
return result
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
def buildAsyncFunctionNode(provider, node, source_ref):
|
|
499
|
+
# We are creating a function here that creates coroutine objects, with
|
|
500
|
+
# many details each, pylint: disable=too-many-locals
|
|
501
|
+
assert getKind(node) == "AsyncFunctionDef"
|
|
502
|
+
|
|
503
|
+
decorators = buildNodeList(
|
|
504
|
+
provider=provider, nodes=reversed(node.decorator_list), source_ref=source_ref
|
|
505
|
+
)
|
|
506
|
+
|
|
507
|
+
compilation_mode = decideFunctionCompilationMode(decorators)
|
|
508
|
+
|
|
509
|
+
onFunctionBodyParsing(provider=provider, function_name=node.name, body=node.body)
|
|
510
|
+
|
|
511
|
+
if compilation_mode != "compiled":
|
|
512
|
+
return _buildBytecodeOrSourceFunction(
|
|
513
|
+
provider=provider,
|
|
514
|
+
node=node,
|
|
515
|
+
compilation_mode=compilation_mode,
|
|
516
|
+
source_ref=source_ref,
|
|
517
|
+
)
|
|
518
|
+
|
|
519
|
+
function_provider = _getFunctionProvider(provider, node, source_ref)
|
|
520
|
+
|
|
521
|
+
function_statement_nodes, function_doc = extractDocFromBody(node)
|
|
522
|
+
|
|
523
|
+
function_kind, flags = detectFunctionBodyKind(
|
|
524
|
+
nodes=function_statement_nodes, start_value="Coroutine"
|
|
525
|
+
)
|
|
526
|
+
|
|
527
|
+
creator_function_body, _, code_object = buildFunctionWithParsing(
|
|
528
|
+
provider=function_provider,
|
|
529
|
+
function_kind=function_kind,
|
|
530
|
+
name=node.name,
|
|
531
|
+
function_doc=function_doc,
|
|
532
|
+
flags=(),
|
|
533
|
+
node=node,
|
|
534
|
+
source_ref=source_ref,
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
if function_kind == "Coroutine":
|
|
538
|
+
function_body = ExpressionCoroutineObjectBody(
|
|
539
|
+
provider=creator_function_body,
|
|
540
|
+
name=node.name,
|
|
541
|
+
code_object=code_object,
|
|
542
|
+
flags=flags,
|
|
543
|
+
auto_release=None,
|
|
544
|
+
source_ref=source_ref,
|
|
545
|
+
)
|
|
546
|
+
else:
|
|
547
|
+
function_body = ExpressionAsyncgenObjectBody(
|
|
548
|
+
provider=creator_function_body,
|
|
549
|
+
name=node.name,
|
|
550
|
+
code_object=code_object,
|
|
551
|
+
flags=flags,
|
|
552
|
+
auto_release=None,
|
|
553
|
+
source_ref=source_ref,
|
|
554
|
+
)
|
|
555
|
+
|
|
556
|
+
function_body.qualname_provider = provider
|
|
557
|
+
|
|
558
|
+
for variable in creator_function_body.getProvidedVariables():
|
|
559
|
+
function_body.getVariableForReference(variable.getName())
|
|
560
|
+
|
|
561
|
+
defaults = buildNodeTuple(
|
|
562
|
+
provider=provider, nodes=node.args.defaults, source_ref=source_ref
|
|
563
|
+
)
|
|
564
|
+
|
|
565
|
+
function_statements_body = buildFrameNode(
|
|
566
|
+
provider=function_body,
|
|
567
|
+
nodes=function_statement_nodes,
|
|
568
|
+
code_object=code_object,
|
|
569
|
+
source_ref=source_ref,
|
|
570
|
+
)
|
|
571
|
+
|
|
572
|
+
function_statements_body = _insertFinalReturnStatement(
|
|
573
|
+
function_statements_body=function_statements_body,
|
|
574
|
+
return_statement=StatementGeneratorReturnNone(source_ref=source_ref),
|
|
575
|
+
)
|
|
576
|
+
|
|
577
|
+
if function_statements_body.isStatementsFrame():
|
|
578
|
+
function_statements_body = makeStatementsSequenceFromStatement(
|
|
579
|
+
statement=function_statements_body
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
function_body.setChildBody(function_statements_body)
|
|
583
|
+
|
|
584
|
+
annotations = buildParameterAnnotations(function_provider, node, source_ref)
|
|
585
|
+
|
|
586
|
+
kw_defaults = buildParameterKwDefaults(
|
|
587
|
+
provider=function_provider,
|
|
588
|
+
node=node,
|
|
589
|
+
function_body=creator_function_body,
|
|
590
|
+
source_ref=source_ref,
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
if function_kind == "Coroutine":
|
|
594
|
+
creation_node = ExpressionMakeCoroutineObject(
|
|
595
|
+
coroutine_ref=ExpressionFunctionRef(
|
|
596
|
+
function_body=function_body, source_ref=source_ref
|
|
597
|
+
),
|
|
598
|
+
source_ref=source_ref,
|
|
599
|
+
)
|
|
600
|
+
else:
|
|
601
|
+
creation_node = ExpressionMakeAsyncgenObject(
|
|
602
|
+
asyncgen_ref=ExpressionFunctionRef(
|
|
603
|
+
function_body=function_body, source_ref=source_ref
|
|
604
|
+
),
|
|
605
|
+
source_ref=source_ref,
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
creator_function_body.setChildBody(
|
|
609
|
+
makeStatementsSequenceFromStatement(
|
|
610
|
+
statement=StatementReturn(expression=creation_node, source_ref=source_ref)
|
|
611
|
+
)
|
|
612
|
+
)
|
|
613
|
+
|
|
614
|
+
if python_version >= 0x3C0 and node.type_params:
|
|
615
|
+
type_params_tuple = ExpressionMakeTuple(
|
|
616
|
+
elements=buildNodeTuple(provider, node.type_params, source_ref),
|
|
617
|
+
source_ref=source_ref,
|
|
618
|
+
)
|
|
619
|
+
else:
|
|
620
|
+
type_params_tuple = None
|
|
621
|
+
|
|
622
|
+
function_creation = makeExpressionFunctionCreation(
|
|
623
|
+
function_ref=ExpressionFunctionRef(
|
|
624
|
+
function_body=creator_function_body, source_ref=source_ref
|
|
625
|
+
),
|
|
626
|
+
defaults=defaults,
|
|
627
|
+
kw_defaults=kw_defaults,
|
|
628
|
+
annotations=annotations,
|
|
629
|
+
type_params=type_params_tuple,
|
|
630
|
+
source_ref=source_ref,
|
|
631
|
+
)
|
|
632
|
+
|
|
633
|
+
function_creation = _maybeWrapWithAnnotations(
|
|
634
|
+
function_provider, node, function_creation, source_ref
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
decorated_function = function_creation
|
|
638
|
+
for decorator in decorators:
|
|
639
|
+
decorated_function = makeCallNode(
|
|
640
|
+
decorator, decorated_function, decorator.getSourceReference()
|
|
641
|
+
)
|
|
642
|
+
|
|
643
|
+
result = StatementAssignmentVariableName(
|
|
644
|
+
provider=provider,
|
|
645
|
+
variable_name=mangleName(node.name, provider),
|
|
646
|
+
source=decorated_function,
|
|
647
|
+
source_ref=source_ref,
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
function_body.qualname_setup = result.getVariableName()
|
|
651
|
+
|
|
652
|
+
# Share the non-local declarations. TODO: This may also apply to generators
|
|
653
|
+
# and async generators.
|
|
654
|
+
creator_function_body.non_local_declarations = function_body.non_local_declarations
|
|
655
|
+
|
|
656
|
+
return result
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
def buildParameterKwDefaults(provider, node, function_body, source_ref):
|
|
660
|
+
# Build keyword only arguments default values. We are hiding here, that it
|
|
661
|
+
# is a Python3 only feature.
|
|
662
|
+
|
|
663
|
+
if python_version >= 0x300:
|
|
664
|
+
kw_only_names = function_body.getParameters().getKwOnlyParameterNames()
|
|
665
|
+
|
|
666
|
+
if kw_only_names:
|
|
667
|
+
keys = []
|
|
668
|
+
values = []
|
|
669
|
+
|
|
670
|
+
for kw_only_name, kw_default in zip(kw_only_names, node.args.kw_defaults):
|
|
671
|
+
if kw_default is not None:
|
|
672
|
+
keys.append(kw_only_name)
|
|
673
|
+
values.append(buildNode(provider, kw_default, source_ref))
|
|
674
|
+
|
|
675
|
+
kw_defaults = makeDictCreationOrConstant2(
|
|
676
|
+
keys=keys, values=values, source_ref=source_ref
|
|
677
|
+
)
|
|
678
|
+
else:
|
|
679
|
+
kw_defaults = None
|
|
680
|
+
else:
|
|
681
|
+
kw_defaults = None
|
|
682
|
+
|
|
683
|
+
return kw_defaults
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
# The "python_source" flag marks functions that are generated from Python
|
|
687
|
+
# source rather than compiled C code, and the "python_closure" flag additionally
|
|
688
|
+
# marks those whose closures may be consumed by CPython, e.g. 'annotationlib'
|
|
689
|
+
# re-wrapping of deferred annotations, so their variables need real cells.
|
|
690
|
+
# Neither is specific to "annotate" functions.
|
|
691
|
+
_annotate_flags = frozenset(("annotate", "python_source", "python_closure"))
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
def makeDeferredAnnotateFunctionBody(provider, source_ref):
|
|
695
|
+
function_name = "__annotate__"
|
|
696
|
+
|
|
697
|
+
# Not using the CPython parameter name "format" here, since following
|
|
698
|
+
# annotation values may reference a variable of that name, which would
|
|
699
|
+
# wrongly resolve to the parameter. The parameter is only ever passed
|
|
700
|
+
# positionally by "annotationlib" and the C API, so its name is internal,
|
|
701
|
+
# and ".0" cannot be used in annotations at all.
|
|
702
|
+
format_arg_name = ".0"
|
|
703
|
+
|
|
704
|
+
parameters = ParameterSpec(
|
|
705
|
+
ps_name=function_name,
|
|
706
|
+
ps_normal_args=(format_arg_name,),
|
|
707
|
+
ps_list_star_arg=None,
|
|
708
|
+
ps_dict_star_arg=None,
|
|
709
|
+
ps_default_count=0,
|
|
710
|
+
ps_kw_only_args=(),
|
|
711
|
+
ps_pos_only_args=(),
|
|
712
|
+
)
|
|
713
|
+
parent_module = provider.getParentModule()
|
|
714
|
+
code_object = CodeObjectSpec(
|
|
715
|
+
co_name=function_name,
|
|
716
|
+
co_qualname=function_name,
|
|
717
|
+
co_kind="Function",
|
|
718
|
+
co_varnames=parameters.getParameterNames(),
|
|
719
|
+
co_freevars=(),
|
|
720
|
+
co_argcount=parameters.getArgumentCount(),
|
|
721
|
+
co_posonlyargcount=parameters.getPosOnlyParameterCount(),
|
|
722
|
+
co_kwonlyargcount=parameters.getKwOnlyParameterCount(),
|
|
723
|
+
co_has_starlist=parameters.getStarListArgumentName() is not None,
|
|
724
|
+
co_has_stardict=parameters.getStarDictArgumentName() is not None,
|
|
725
|
+
co_filename=parent_module.getRunTimeFilename(),
|
|
726
|
+
co_lineno=source_ref.getLineNumber(),
|
|
727
|
+
future_spec=parent_module.getFutureSpec(),
|
|
728
|
+
)
|
|
729
|
+
|
|
730
|
+
outer_body = ExpressionFunctionBody(
|
|
731
|
+
provider=provider,
|
|
732
|
+
name=function_name,
|
|
733
|
+
code_object=code_object,
|
|
734
|
+
flags=_annotate_flags,
|
|
735
|
+
doc=None,
|
|
736
|
+
parameters=parameters,
|
|
737
|
+
auto_release=None,
|
|
738
|
+
code_prefix="function",
|
|
739
|
+
source_ref=source_ref,
|
|
740
|
+
)
|
|
741
|
+
|
|
742
|
+
return_statement = StatementReturn(
|
|
743
|
+
expression=makeConstantRefNode(
|
|
744
|
+
constant=None, source_ref=source_ref, user_provided=False
|
|
745
|
+
),
|
|
746
|
+
source_ref=source_ref,
|
|
747
|
+
)
|
|
748
|
+
|
|
749
|
+
body = makeStatementConditional(
|
|
750
|
+
condition=ExpressionComparisonGt(
|
|
751
|
+
ExpressionVariableNameRef(
|
|
752
|
+
outer_body, format_arg_name, source_ref=source_ref
|
|
753
|
+
),
|
|
754
|
+
ExpressionConstantIntRef(2, source_ref=source_ref),
|
|
755
|
+
source_ref,
|
|
756
|
+
),
|
|
757
|
+
yes_branch=StatementRaiseException(
|
|
758
|
+
exception_type=ExpressionBuiltinExceptionRef(
|
|
759
|
+
"NotImplementedError", source_ref=source_ref
|
|
760
|
+
),
|
|
761
|
+
exception_value=None,
|
|
762
|
+
exception_cause=None,
|
|
763
|
+
exception_trace=None,
|
|
764
|
+
source_ref=source_ref,
|
|
765
|
+
),
|
|
766
|
+
no_branch=return_statement,
|
|
767
|
+
source_ref=source_ref,
|
|
768
|
+
)
|
|
769
|
+
|
|
770
|
+
# The annotate function can reference closure variables in its annotation
|
|
771
|
+
# values, so it must have a frame for unbound closure and local errors, and
|
|
772
|
+
# for "f_locals" of the annotate function to be correct.
|
|
773
|
+
body = StatementsFrameFunction(
|
|
774
|
+
statements=(body,),
|
|
775
|
+
code_object=code_object,
|
|
776
|
+
owner_code_name=outer_body.getCodeName(),
|
|
777
|
+
needs_frame_locals=decideNeedsFrameLocalsProxy(
|
|
778
|
+
module_name=outer_body.getParentModule().getFullName(),
|
|
779
|
+
code_qualname=code_object.getCodeObjectQualname(),
|
|
780
|
+
),
|
|
781
|
+
source_ref=source_ref,
|
|
782
|
+
)
|
|
783
|
+
|
|
784
|
+
outer_body.setChildBody(makeStatementsSequenceFromStatement(statement=body))
|
|
785
|
+
return outer_body, return_statement
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
def makeDeferredAnnotationsReturnExpression(outer_body, annotations, source_ref):
|
|
789
|
+
"""Build the annotations dictionary return expression.
|
|
790
|
+
|
|
791
|
+
Notes:
|
|
792
|
+
Unconditionally executed annotations become a simple dictionary, while
|
|
793
|
+
conditionally executed ones (PEP 649) are only included if their index
|
|
794
|
+
was registered in the "__conditional_annotations__" set of the class or
|
|
795
|
+
module body when the statement executed.
|
|
796
|
+
|
|
797
|
+
Args:
|
|
798
|
+
outer_body: Function body node of the annotation function.
|
|
799
|
+
annotations: Sequence of (key, value_node, conditional_index) tuples.
|
|
800
|
+
source_ref: Source reference to use.
|
|
801
|
+
|
|
802
|
+
Returns:
|
|
803
|
+
Expression for the annotations dictionary.
|
|
804
|
+
"""
|
|
805
|
+
if all(conditional_index is None for _, _, conditional_index in annotations):
|
|
806
|
+
keys = []
|
|
807
|
+
values = []
|
|
808
|
+
|
|
809
|
+
for key, value, _ in annotations:
|
|
810
|
+
keys.append(key)
|
|
811
|
+
values.append(value)
|
|
812
|
+
|
|
813
|
+
return makeDictCreationOrConstant2(
|
|
814
|
+
keys=keys, values=values, source_ref=source_ref
|
|
815
|
+
)
|
|
816
|
+
|
|
817
|
+
result = makeConstantRefNode(
|
|
818
|
+
constant={}, source_ref=source_ref, user_provided=False
|
|
819
|
+
)
|
|
820
|
+
|
|
821
|
+
for key, value, conditional_index in annotations:
|
|
822
|
+
annotations_dict = makeExpressionMakeDict(
|
|
823
|
+
pairs=(makeExpressionKeyValuePairConstantKey(key=key, value=value),),
|
|
824
|
+
source_ref=source_ref,
|
|
825
|
+
)
|
|
826
|
+
|
|
827
|
+
if conditional_index is not None:
|
|
828
|
+
annotations_dict = ExpressionConditional(
|
|
829
|
+
condition=makeComparisonExpression(
|
|
830
|
+
left=makeConstantRefNode(
|
|
831
|
+
constant=conditional_index,
|
|
832
|
+
source_ref=source_ref,
|
|
833
|
+
user_provided=False,
|
|
834
|
+
),
|
|
835
|
+
right=ExpressionVariableNameRef(
|
|
836
|
+
provider=outer_body,
|
|
837
|
+
variable_name="__conditional_annotations__",
|
|
838
|
+
source_ref=source_ref,
|
|
839
|
+
),
|
|
840
|
+
comparator="In",
|
|
841
|
+
source_ref=source_ref,
|
|
842
|
+
),
|
|
843
|
+
expression_yes=annotations_dict,
|
|
844
|
+
expression_no=makeConstantRefNode(
|
|
845
|
+
constant={}, source_ref=source_ref, user_provided=False
|
|
846
|
+
),
|
|
847
|
+
source_ref=source_ref,
|
|
848
|
+
)
|
|
849
|
+
|
|
850
|
+
result = makeBinaryOperationNode(
|
|
851
|
+
operator="BitOr",
|
|
852
|
+
left=result,
|
|
853
|
+
right=annotations_dict,
|
|
854
|
+
source_ref=source_ref,
|
|
855
|
+
)
|
|
856
|
+
|
|
857
|
+
return result
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
def buildParameterAnnotations(provider, node, source_ref):
|
|
861
|
+
# Too many branches, because there is too many cases, pylint: disable=too-many-branches,too-many-locals,too-many-statements
|
|
862
|
+
|
|
863
|
+
# The ast uses funny names a bunch.
|
|
864
|
+
# spell-checker: ignore elts,kwargannotation,kwonlyargs,posonlyargs,vararg
|
|
865
|
+
# spell-checker: ignore varargannotation
|
|
866
|
+
|
|
867
|
+
# Build annotations. We are hiding here, that it is a Python3 only feature.
|
|
868
|
+
if not getFutureSpec().use_annotations:
|
|
869
|
+
return None
|
|
870
|
+
|
|
871
|
+
use_deferred = python_version >= 0x3E0 and not isExperimental(
|
|
872
|
+
"no-deferred-annotation"
|
|
873
|
+
)
|
|
874
|
+
|
|
875
|
+
if use_deferred:
|
|
876
|
+
annotation_specs = []
|
|
877
|
+
|
|
878
|
+
def addAnnotation(key, ast_node):
|
|
879
|
+
annotation_specs.append((mangleName(key, provider), ast_node, False))
|
|
880
|
+
|
|
881
|
+
def addStarredAnnotation(key, ast_node):
|
|
882
|
+
annotation_specs.append((mangleName(key, provider), ast_node, True))
|
|
883
|
+
|
|
884
|
+
else:
|
|
885
|
+
keys = []
|
|
886
|
+
values = []
|
|
887
|
+
|
|
888
|
+
def addAnnotation(key, value):
|
|
889
|
+
keys.append(mangleName(key, provider))
|
|
890
|
+
values.append(value)
|
|
891
|
+
|
|
892
|
+
def _buildAnnotationValue(annot_provider, ast_node, is_starred):
|
|
893
|
+
if is_starred:
|
|
894
|
+
value = buildAnnotationNode(annot_provider, ast_node, source_ref)
|
|
895
|
+
return ExpressionBuiltinNext1(
|
|
896
|
+
value=ExpressionBuiltinIterForUnpack(value, source_ref),
|
|
897
|
+
source_ref=source_ref,
|
|
898
|
+
)
|
|
899
|
+
else:
|
|
900
|
+
return buildAnnotationNode(annot_provider, ast_node, source_ref)
|
|
901
|
+
|
|
902
|
+
def extractArgAnnotation(arg):
|
|
903
|
+
if getKind(arg) == "Name":
|
|
904
|
+
assert arg.annotation is None
|
|
905
|
+
elif getKind(arg) == "arg":
|
|
906
|
+
if arg.annotation is not None:
|
|
907
|
+
if python_version >= 0x3B0 and getKind(arg.annotation) == "Starred":
|
|
908
|
+
if use_deferred:
|
|
909
|
+
addStarredAnnotation(arg.arg, arg.annotation.value)
|
|
910
|
+
else:
|
|
911
|
+
addAnnotation(
|
|
912
|
+
key=arg.arg,
|
|
913
|
+
value=_buildAnnotationValue(
|
|
914
|
+
provider, arg.annotation.value, True
|
|
915
|
+
),
|
|
916
|
+
)
|
|
917
|
+
else:
|
|
918
|
+
if use_deferred:
|
|
919
|
+
addAnnotation(arg.arg, arg.annotation)
|
|
920
|
+
else:
|
|
921
|
+
addAnnotation(
|
|
922
|
+
key=arg.arg,
|
|
923
|
+
value=_buildAnnotationValue(
|
|
924
|
+
provider, arg.annotation, False
|
|
925
|
+
),
|
|
926
|
+
)
|
|
927
|
+
elif getKind(arg) == "Tuple":
|
|
928
|
+
for sub_arg in arg.elts:
|
|
929
|
+
extractArgAnnotation(sub_arg)
|
|
930
|
+
else:
|
|
931
|
+
assert False, getKind(arg)
|
|
932
|
+
|
|
933
|
+
if python_version >= 0x380:
|
|
934
|
+
for arg in node.args.posonlyargs:
|
|
935
|
+
extractArgAnnotation(arg)
|
|
936
|
+
|
|
937
|
+
for arg in node.args.args:
|
|
938
|
+
extractArgAnnotation(arg)
|
|
939
|
+
|
|
940
|
+
for arg in node.args.kwonlyargs:
|
|
941
|
+
extractArgAnnotation(arg)
|
|
942
|
+
|
|
943
|
+
if python_version < 0x300:
|
|
944
|
+
if node.args.varargannotation is not None:
|
|
945
|
+
if use_deferred:
|
|
946
|
+
addAnnotation(node.args.vararg, node.args.varargannotation)
|
|
947
|
+
else:
|
|
948
|
+
addAnnotation(
|
|
949
|
+
key=node.args.vararg,
|
|
950
|
+
value=buildNode(provider, node.args.varargannotation, source_ref),
|
|
951
|
+
)
|
|
952
|
+
|
|
953
|
+
if node.args.kwargannotation is not None:
|
|
954
|
+
if use_deferred:
|
|
955
|
+
addAnnotation(node.args.kwarg, node.args.kwargannotation)
|
|
956
|
+
else:
|
|
957
|
+
addAnnotation(
|
|
958
|
+
key=node.args.kwarg,
|
|
959
|
+
value=buildNode(provider, node.args.kwargannotation, source_ref),
|
|
960
|
+
)
|
|
961
|
+
else:
|
|
962
|
+
if node.args.vararg is not None:
|
|
963
|
+
extractArgAnnotation(node.args.vararg)
|
|
964
|
+
if node.args.kwarg is not None:
|
|
965
|
+
extractArgAnnotation(node.args.kwarg)
|
|
966
|
+
|
|
967
|
+
# Return value annotation (not there for lambdas)
|
|
968
|
+
if hasattr(node, "returns") and node.returns is not None:
|
|
969
|
+
if use_deferred:
|
|
970
|
+
addAnnotation("return", node.returns)
|
|
971
|
+
else:
|
|
972
|
+
addAnnotation(
|
|
973
|
+
key="return",
|
|
974
|
+
value=buildAnnotationNode(provider, node.returns, source_ref),
|
|
975
|
+
)
|
|
976
|
+
|
|
977
|
+
if use_deferred:
|
|
978
|
+
if annotation_specs:
|
|
979
|
+
outer_body, return_statement = makeDeferredAnnotateFunctionBody(
|
|
980
|
+
provider=provider,
|
|
981
|
+
source_ref=source_ref,
|
|
982
|
+
)
|
|
983
|
+
|
|
984
|
+
keys = []
|
|
985
|
+
values = []
|
|
986
|
+
for key, ast_node, is_starred in annotation_specs:
|
|
987
|
+
keys.append(key)
|
|
988
|
+
values.append(_buildAnnotationValue(outer_body, ast_node, is_starred))
|
|
989
|
+
|
|
990
|
+
annotations = makeDictCreationOrConstant2(
|
|
991
|
+
keys=keys, values=values, source_ref=source_ref
|
|
992
|
+
)
|
|
993
|
+
return_statement.subnode_expression = annotations
|
|
994
|
+
annotations.parent = return_statement
|
|
995
|
+
|
|
996
|
+
return makeExpressionFunctionCreation(
|
|
997
|
+
function_ref=ExpressionFunctionRef(
|
|
998
|
+
function_body=outer_body,
|
|
999
|
+
source_ref=source_ref,
|
|
1000
|
+
),
|
|
1001
|
+
defaults=(),
|
|
1002
|
+
kw_defaults=None,
|
|
1003
|
+
annotations=None,
|
|
1004
|
+
type_params=None,
|
|
1005
|
+
source_ref=source_ref,
|
|
1006
|
+
)
|
|
1007
|
+
else:
|
|
1008
|
+
return None
|
|
1009
|
+
else:
|
|
1010
|
+
if keys:
|
|
1011
|
+
return makeDictCreationOrConstant2(
|
|
1012
|
+
keys=keys,
|
|
1013
|
+
values=values,
|
|
1014
|
+
source_ref=source_ref,
|
|
1015
|
+
)
|
|
1016
|
+
else:
|
|
1017
|
+
return None
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
def _wrapFunctionWithSpecialNestedArgs(
|
|
1021
|
+
name, outer_body, parameters, special_args, source_ref
|
|
1022
|
+
):
|
|
1023
|
+
inner_name = name.strip("<>") + "$inner"
|
|
1024
|
+
iter_vars = []
|
|
1025
|
+
|
|
1026
|
+
values = []
|
|
1027
|
+
|
|
1028
|
+
statements = []
|
|
1029
|
+
|
|
1030
|
+
def unpackFrom(source, arg_names):
|
|
1031
|
+
accesses = []
|
|
1032
|
+
|
|
1033
|
+
sub_special_index = 0
|
|
1034
|
+
|
|
1035
|
+
iter_var = outer_body.allocateTempVariable(
|
|
1036
|
+
temp_scope=None, name="arg_iter_%d" % len(iter_vars), temp_type="object"
|
|
1037
|
+
)
|
|
1038
|
+
iter_vars.append(iter_var)
|
|
1039
|
+
|
|
1040
|
+
statements.append(
|
|
1041
|
+
makeStatementAssignmentVariable(
|
|
1042
|
+
variable=iter_var,
|
|
1043
|
+
source=ExpressionBuiltinIter1(value=source, source_ref=source_ref),
|
|
1044
|
+
source_ref=source_ref,
|
|
1045
|
+
)
|
|
1046
|
+
)
|
|
1047
|
+
|
|
1048
|
+
for element_index, arg_name in enumerate(arg_names):
|
|
1049
|
+
if getKind(arg_name) == "Name":
|
|
1050
|
+
arg_var = outer_body.createProvidedVariable(arg_name.id)
|
|
1051
|
+
outer_body.getLocalsScope().registerProvidedVariable(arg_var)
|
|
1052
|
+
|
|
1053
|
+
statements.append(
|
|
1054
|
+
makeStatementAssignmentVariable(
|
|
1055
|
+
variable=arg_var,
|
|
1056
|
+
source=ExpressionSpecialUnpack(
|
|
1057
|
+
value=ExpressionTempVariableRef(
|
|
1058
|
+
variable=iter_var, source_ref=source_ref
|
|
1059
|
+
),
|
|
1060
|
+
count=element_index + 1,
|
|
1061
|
+
expected=len(arg_names),
|
|
1062
|
+
starred=False,
|
|
1063
|
+
source_ref=source_ref,
|
|
1064
|
+
),
|
|
1065
|
+
source_ref=source_ref,
|
|
1066
|
+
)
|
|
1067
|
+
)
|
|
1068
|
+
|
|
1069
|
+
accesses.append(
|
|
1070
|
+
ExpressionVariableRef(variable=arg_var, source_ref=source_ref)
|
|
1071
|
+
)
|
|
1072
|
+
elif getKind(arg_name) == "Tuple":
|
|
1073
|
+
accesses.extend(
|
|
1074
|
+
unpackFrom(
|
|
1075
|
+
source=ExpressionSpecialUnpack(
|
|
1076
|
+
value=ExpressionTempVariableRef(
|
|
1077
|
+
variable=iter_var, source_ref=source_ref
|
|
1078
|
+
),
|
|
1079
|
+
count=element_index + 1,
|
|
1080
|
+
expected=len(arg_names),
|
|
1081
|
+
starred=False,
|
|
1082
|
+
source_ref=source_ref,
|
|
1083
|
+
),
|
|
1084
|
+
arg_names=arg_name.elts,
|
|
1085
|
+
)
|
|
1086
|
+
)
|
|
1087
|
+
|
|
1088
|
+
sub_special_index += 1
|
|
1089
|
+
else:
|
|
1090
|
+
assert False, arg_name
|
|
1091
|
+
|
|
1092
|
+
statements.append(
|
|
1093
|
+
StatementSpecialUnpackCheck(
|
|
1094
|
+
iterator=ExpressionTempVariableRef(
|
|
1095
|
+
variable=iter_var, source_ref=source_ref
|
|
1096
|
+
),
|
|
1097
|
+
count=len(arg_names),
|
|
1098
|
+
source_ref=source_ref,
|
|
1099
|
+
)
|
|
1100
|
+
)
|
|
1101
|
+
|
|
1102
|
+
return accesses
|
|
1103
|
+
|
|
1104
|
+
for arg_name in parameters.getParameterNames():
|
|
1105
|
+
if arg_name.startswith("."):
|
|
1106
|
+
source = ExpressionVariableNameRef(
|
|
1107
|
+
provider=outer_body, variable_name=arg_name, source_ref=source_ref
|
|
1108
|
+
)
|
|
1109
|
+
|
|
1110
|
+
values.extend(unpackFrom(source, special_args[arg_name]))
|
|
1111
|
+
else:
|
|
1112
|
+
values.append(
|
|
1113
|
+
ExpressionVariableNameRef(
|
|
1114
|
+
provider=outer_body, variable_name=arg_name, source_ref=source_ref
|
|
1115
|
+
)
|
|
1116
|
+
)
|
|
1117
|
+
|
|
1118
|
+
code_body = ExpressionOutlineFunction(
|
|
1119
|
+
provider=outer_body, name=inner_name, source_ref=source_ref
|
|
1120
|
+
)
|
|
1121
|
+
|
|
1122
|
+
statements.append(StatementReturn(expression=code_body, source_ref=source_ref))
|
|
1123
|
+
|
|
1124
|
+
outer_body.setChildBody(
|
|
1125
|
+
makeStatementsSequenceFromStatement(
|
|
1126
|
+
statement=makeTryFinallyReleaseStatement(
|
|
1127
|
+
provider=outer_body,
|
|
1128
|
+
tried=statements,
|
|
1129
|
+
variables=tuple(
|
|
1130
|
+
sorted(
|
|
1131
|
+
outer_body.getTempVariables(None),
|
|
1132
|
+
key=lambda variable: variable.getName(),
|
|
1133
|
+
)
|
|
1134
|
+
),
|
|
1135
|
+
source_ref=source_ref,
|
|
1136
|
+
)
|
|
1137
|
+
)
|
|
1138
|
+
)
|
|
1139
|
+
|
|
1140
|
+
return code_body
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
def buildFunctionWithParsing(
|
|
1144
|
+
provider, function_kind, name, function_doc, flags, node, source_ref
|
|
1145
|
+
):
|
|
1146
|
+
# This contains a complex re-formulation for nested parameter functions.
|
|
1147
|
+
# pylint: disable=too-many-locals
|
|
1148
|
+
|
|
1149
|
+
kind = getKind(node)
|
|
1150
|
+
assert kind in ("FunctionDef", "Lambda", "AsyncFunctionDef"), (
|
|
1151
|
+
"unsupported for kind " + kind
|
|
1152
|
+
)
|
|
1153
|
+
|
|
1154
|
+
def extractArg(arg):
|
|
1155
|
+
if arg is None:
|
|
1156
|
+
return None
|
|
1157
|
+
elif type(arg) is str:
|
|
1158
|
+
arg_name = arg
|
|
1159
|
+
elif getKind(arg) == "Name":
|
|
1160
|
+
arg_name = arg.id
|
|
1161
|
+
elif getKind(arg) == "arg":
|
|
1162
|
+
arg_name = arg.arg
|
|
1163
|
+
elif getKind(arg) == "Tuple":
|
|
1164
|
+
# These are to be re-formulated on the outside.
|
|
1165
|
+
assert False
|
|
1166
|
+
else:
|
|
1167
|
+
assert False, getKind(arg)
|
|
1168
|
+
|
|
1169
|
+
if python_version >= 0x270:
|
|
1170
|
+
checkDebugNameAssignment(name=arg_name, source_ref=source_ref)
|
|
1171
|
+
|
|
1172
|
+
return mangleName(arg_name, provider)
|
|
1173
|
+
|
|
1174
|
+
special_args = {}
|
|
1175
|
+
|
|
1176
|
+
def extractNormalArgs(args):
|
|
1177
|
+
normal_args = []
|
|
1178
|
+
|
|
1179
|
+
for arg in args:
|
|
1180
|
+
if type(arg) is not str and getKind(arg) == "Tuple":
|
|
1181
|
+
special_arg_name = ".%d" % (len(special_args) + 1)
|
|
1182
|
+
|
|
1183
|
+
special_args[special_arg_name] = arg.elts
|
|
1184
|
+
normal_args.append(special_arg_name)
|
|
1185
|
+
else:
|
|
1186
|
+
normal_args.append(extractArg(arg))
|
|
1187
|
+
|
|
1188
|
+
return normal_args
|
|
1189
|
+
|
|
1190
|
+
parameters = ParameterSpec(
|
|
1191
|
+
ps_name=name,
|
|
1192
|
+
ps_normal_args=extractNormalArgs(node.args.args),
|
|
1193
|
+
ps_pos_only_args=(
|
|
1194
|
+
[extractArg(arg) for arg in node.args.posonlyargs]
|
|
1195
|
+
if python_version >= 0x380
|
|
1196
|
+
else ()
|
|
1197
|
+
),
|
|
1198
|
+
ps_kw_only_args=(
|
|
1199
|
+
[extractArg(arg) for arg in node.args.kwonlyargs]
|
|
1200
|
+
if python_version >= 0x300
|
|
1201
|
+
else ()
|
|
1202
|
+
),
|
|
1203
|
+
ps_list_star_arg=extractArg(node.args.vararg),
|
|
1204
|
+
ps_dict_star_arg=extractArg(node.args.kwarg),
|
|
1205
|
+
ps_default_count=len(node.args.defaults),
|
|
1206
|
+
)
|
|
1207
|
+
|
|
1208
|
+
message = parameters.checkParametersValid()
|
|
1209
|
+
|
|
1210
|
+
if message is not None:
|
|
1211
|
+
raiseSyntaxError(message, source_ref.atColumnNumber(node.col_offset))
|
|
1212
|
+
|
|
1213
|
+
parent_module = provider.getParentModule()
|
|
1214
|
+
|
|
1215
|
+
code_object = CodeObjectSpec(
|
|
1216
|
+
co_name=name,
|
|
1217
|
+
co_qualname=provider.getChildQualname(name),
|
|
1218
|
+
co_kind=function_kind,
|
|
1219
|
+
co_varnames=parameters.getParameterNames(),
|
|
1220
|
+
co_freevars=(),
|
|
1221
|
+
co_argcount=parameters.getArgumentCount(),
|
|
1222
|
+
co_posonlyargcount=parameters.getPosOnlyParameterCount(),
|
|
1223
|
+
co_kwonlyargcount=parameters.getKwOnlyParameterCount(),
|
|
1224
|
+
co_has_starlist=parameters.getStarListArgumentName() is not None,
|
|
1225
|
+
co_has_stardict=parameters.getStarDictArgumentName() is not None,
|
|
1226
|
+
co_filename=parent_module.getRunTimeFilename(),
|
|
1227
|
+
co_lineno=source_ref.getLineNumber(),
|
|
1228
|
+
future_spec=parent_module.getFutureSpec(),
|
|
1229
|
+
)
|
|
1230
|
+
|
|
1231
|
+
outer_body = ExpressionFunctionBody(
|
|
1232
|
+
provider=provider,
|
|
1233
|
+
name=name,
|
|
1234
|
+
code_object=code_object,
|
|
1235
|
+
flags=flags,
|
|
1236
|
+
doc=function_doc,
|
|
1237
|
+
parameters=parameters,
|
|
1238
|
+
auto_release=None,
|
|
1239
|
+
code_prefix="function",
|
|
1240
|
+
source_ref=source_ref,
|
|
1241
|
+
)
|
|
1242
|
+
|
|
1243
|
+
# Wrap if necessary for special nested arguments.
|
|
1244
|
+
if special_args:
|
|
1245
|
+
code_body = _wrapFunctionWithSpecialNestedArgs(
|
|
1246
|
+
name=name,
|
|
1247
|
+
outer_body=outer_body,
|
|
1248
|
+
parameters=parameters,
|
|
1249
|
+
special_args=special_args,
|
|
1250
|
+
source_ref=source_ref,
|
|
1251
|
+
)
|
|
1252
|
+
|
|
1253
|
+
else:
|
|
1254
|
+
code_body = outer_body
|
|
1255
|
+
|
|
1256
|
+
return outer_body, code_body, code_object
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
def addFunctionVariableReleases(function):
|
|
1260
|
+
assert function.isExpressionFunctionBodyBase()
|
|
1261
|
+
|
|
1262
|
+
release_variables = []
|
|
1263
|
+
|
|
1264
|
+
# We attach everything to the function definition source location.
|
|
1265
|
+
source_ref = function.getSourceReference()
|
|
1266
|
+
|
|
1267
|
+
for variable in function.getLocalVariables():
|
|
1268
|
+
# Shared variables are freed by function attachment.
|
|
1269
|
+
if variable.getOwner() is not function:
|
|
1270
|
+
continue
|
|
1271
|
+
|
|
1272
|
+
release_variables.append(variable)
|
|
1273
|
+
|
|
1274
|
+
if release_variables:
|
|
1275
|
+
body = function.subnode_body
|
|
1276
|
+
|
|
1277
|
+
if body is not None and body.isStatementsFrame():
|
|
1278
|
+
body = makeStatementsSequenceFromStatement(statement=body)
|
|
1279
|
+
|
|
1280
|
+
body = makeTryFinallyReleaseStatement(
|
|
1281
|
+
provider=function,
|
|
1282
|
+
tried=body,
|
|
1283
|
+
variables=release_variables,
|
|
1284
|
+
source_ref=source_ref,
|
|
1285
|
+
)
|
|
1286
|
+
|
|
1287
|
+
function.setChildBody(makeStatementsSequenceFromStatement(statement=body))
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
# Part of "Pforge", an optimizing Python compiler that is compatible and
|
|
1291
|
+
# integrates with CPython, but also works on its own.
|
|
1292
|
+
#
|
|
1293
|
+
# Licensed under the GNU Affero General Public License, Version 3 (the "License");
|
|
1294
|
+
# you may not use this file except in compliance with the License.
|
|
1295
|
+
# You may obtain a copy of the License at
|
|
1296
|
+
#
|
|
1297
|
+
# https://www.gnu.org/licenses/agpl-3.0.txt
|
|
1298
|
+
#
|
|
1299
|
+
# See also: "Pforge Runtime Library Exception, Version 1.0" in file
|
|
1300
|
+
# "LICENSE-RUNTIME.txt" for additional permissions granted under Section 7.
|
|
1301
|
+
#
|
|
1302
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
1303
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
1304
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1305
|
+
# See the License for the specific language governing permissions and
|
|
1306
|
+
# limitations under the License.
|