Nuitka-winsvc 2.7.7__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- nuitka/Builtins.py +259 -0
- nuitka/BytecodeCaching.py +184 -0
- nuitka/Bytecodes.py +109 -0
- nuitka/CacheCleanup.py +54 -0
- nuitka/Constants.py +425 -0
- nuitka/Errors.py +93 -0
- nuitka/HardImportRegistry.py +408 -0
- nuitka/MainControl.py +1201 -0
- nuitka/ModuleRegistry.py +364 -0
- nuitka/OptionParsing.py +2473 -0
- nuitka/Options.py +2948 -0
- nuitka/OutputDirectories.py +201 -0
- nuitka/PostProcessing.py +551 -0
- nuitka/Progress.py +252 -0
- nuitka/PythonFlavors.py +426 -0
- nuitka/PythonOperators.py +146 -0
- nuitka/PythonVersions.py +513 -0
- nuitka/Serialization.py +291 -0
- nuitka/SourceCodeReferences.py +176 -0
- nuitka/Tracing.py +579 -0
- nuitka/TreeXML.py +141 -0
- nuitka/Variables.py +515 -0
- nuitka/Version.py +88 -0
- nuitka/__init__.py +19 -0
- nuitka/__main__.py +224 -0
- nuitka/__past__.py +217 -0
- nuitka/build/Backend.scons +1111 -0
- nuitka/build/CCompilerVersion.scons +281 -0
- nuitka/build/DataComposerInterface.py +116 -0
- nuitka/build/Offsets.scons +626 -0
- nuitka/build/Onefile.scons +564 -0
- nuitka/build/SconsCaching.py +451 -0
- nuitka/build/SconsCompilerSettings.py +1133 -0
- nuitka/build/SconsHacks.py +215 -0
- nuitka/build/SconsInterface.py +664 -0
- nuitka/build/SconsProgress.py +100 -0
- nuitka/build/SconsSpawn.py +436 -0
- nuitka/build/SconsUtils.py +939 -0
- nuitka/build/__init__.py +19 -0
- nuitka/build/include/nuitka/allocator.h +450 -0
- nuitka/build/include/nuitka/builtins.h +97 -0
- nuitka/build/include/nuitka/calling.h +123 -0
- nuitka/build/include/nuitka/checkers.h +39 -0
- nuitka/build/include/nuitka/checksum_tools.h +28 -0
- nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
- nuitka/build/include/nuitka/compiled_cell.h +64 -0
- nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
- nuitka/build/include/nuitka/compiled_frame.h +502 -0
- nuitka/build/include/nuitka/compiled_function.h +170 -0
- nuitka/build/include/nuitka/compiled_generator.h +287 -0
- nuitka/build/include/nuitka/compiled_method.h +54 -0
- nuitka/build/include/nuitka/constants.h +251 -0
- nuitka/build/include/nuitka/constants_blob.h +34 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/environment_variables.h +30 -0
- nuitka/build/include/nuitka/environment_variables_system.h +51 -0
- nuitka/build/include/nuitka/exception_groups.h +167 -0
- nuitka/build/include/nuitka/exceptions.h +1458 -0
- nuitka/build/include/nuitka/filesystem_paths.h +117 -0
- nuitka/build/include/nuitka/freelists.h +92 -0
- nuitka/build/include/nuitka/hedley.h +1774 -0
- nuitka/build/include/nuitka/helper/attributes.h +90 -0
- nuitka/build/include/nuitka/helper/boolean.h +86 -0
- nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
- nuitka/build/include/nuitka/helper/bytes.h +28 -0
- nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_eq.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
- nuitka/build/include/nuitka/helper/complex.h +46 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
- nuitka/build/include/nuitka/helper/floats.h +32 -0
- nuitka/build/include/nuitka/helper/import_hard.h +121 -0
- nuitka/build/include/nuitka/helper/indexes.h +47 -0
- nuitka/build/include/nuitka/helper/ints.h +165 -0
- nuitka/build/include/nuitka/helper/iterators.h +376 -0
- nuitka/build/include/nuitka/helper/lists.h +94 -0
- nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
- nuitka/build/include/nuitka/helper/mappings.h +39 -0
- nuitka/build/include/nuitka/helper/operations.h +114 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
- nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
- nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
- nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
- nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
- nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
- nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
- nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
- nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
- nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
- nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
- nuitka/build/include/nuitka/helper/raising.h +114 -0
- nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
- nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
- nuitka/build/include/nuitka/helper/sequences.h +33 -0
- nuitka/build/include/nuitka/helper/sets.h +25 -0
- nuitka/build/include/nuitka/helper/slices.h +314 -0
- nuitka/build/include/nuitka/helper/strings.h +30 -0
- nuitka/build/include/nuitka/helper/subscripts.h +390 -0
- nuitka/build/include/nuitka/helper/tuples.h +187 -0
- nuitka/build/include/nuitka/helpers.h +417 -0
- nuitka/build/include/nuitka/importing.h +149 -0
- nuitka/build/include/nuitka/incbin.h +402 -0
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +626 -0
- nuitka/build/include/nuitka/printing.h +84 -0
- nuitka/build/include/nuitka/python_pgo.h +57 -0
- nuitka/build/include/nuitka/safe_string_ops.h +57 -0
- nuitka/build/include/nuitka/threading.h +142 -0
- nuitka/build/include/nuitka/tracing.h +82 -0
- nuitka/build/include/nuitka/type_aliases.h +30 -0
- nuitka/build/include/nuitka/unfreezing.h +91 -0
- nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
- nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
- nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
- nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
- nuitka/build/inline_copy/bin/scons.py +58 -0
- nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
- nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
- nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
- nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
- nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
- nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
- nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
- nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
- nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
- nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
- nuitka/build/inline_copy/glob2/LICENSE +27 -0
- nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
- nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
- nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
- nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
- nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
- nuitka/build/inline_copy/jinja2/README.rst +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
- nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
- nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
- nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
- nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
- nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
- nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
- nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
- nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
- nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
- nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
- nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
- nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
- nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
- nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
- nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
- nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
- nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
- nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
- nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
- nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
- nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
- nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
- nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
- nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
- nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
- nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
- nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
- nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
- nuitka/build/inline_copy/pefile/pefile.py +8034 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
- nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +484 -0
- nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
- nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
- nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
- nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
- nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
- nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
- nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
- nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
- nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
- nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
- nuitka/build/inline_copy/yaml/LICENSE +20 -0
- nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
- nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
- nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
- nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
- nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
- nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
- nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
- nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
- nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
- nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
- nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
- nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
- nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
- nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
- nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
- nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
- nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
- nuitka/build/inline_copy/zlib/LICENSE +22 -0
- nuitka/build/inline_copy/zlib/crc32.c +1049 -0
- nuitka/build/inline_copy/zlib/crc32.h +9446 -0
- nuitka/build/inline_copy/zlib/zconf.h +551 -0
- nuitka/build/inline_copy/zlib/zlib.h +1938 -0
- nuitka/build/inline_copy/zlib/zutil.h +275 -0
- nuitka/build/inline_copy/zstd/LICENSE.txt +30 -0
- nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
- nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
- nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
- nuitka/build/inline_copy/zstd/common/debug.h +107 -0
- nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
- nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
- nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
- nuitka/build/inline_copy/zstd/common/fse.h +715 -0
- nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
- nuitka/build/inline_copy/zstd/common/huf.h +361 -0
- nuitka/build/inline_copy/zstd/common/mem.h +426 -0
- nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
- nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
- nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
- nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
- nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
- nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
- nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
- nuitka/build/inline_copy/zstd/zstd.h +2391 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
- nuitka/build/static_src/CompiledCellType.c +300 -0
- nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
- nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
- nuitka/build/static_src/CompiledFrameType.c +1337 -0
- nuitka/build/static_src/CompiledFunctionType.c +3320 -0
- nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
- nuitka/build/static_src/CompiledMethodType.c +614 -0
- nuitka/build/static_src/GenerateHeadersMain.c +30 -0
- nuitka/build/static_src/HelpersAllocator.c +939 -0
- nuitka/build/static_src/HelpersAttributes.c +1241 -0
- nuitka/build/static_src/HelpersBuiltin.c +901 -0
- nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
- nuitka/build/static_src/HelpersBytes.c +107 -0
- nuitka/build/static_src/HelpersCalling.c +397 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
- nuitka/build/static_src/HelpersChecksumTools.c +59 -0
- nuitka/build/static_src/HelpersClasses.c +91 -0
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +12070 -0
- nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
- nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
- nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
- nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
- nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
- nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
- nuitka/build/static_src/HelpersConsole.c +124 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
- nuitka/build/static_src/HelpersDeepcopy.c +636 -0
- nuitka/build/static_src/HelpersDictionaries.c +1739 -0
- nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
- nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
- nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
- nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
- nuitka/build/static_src/HelpersExceptions.c +298 -0
- nuitka/build/static_src/HelpersFiles.c +353 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
- nuitka/build/static_src/HelpersFloats.c +92 -0
- nuitka/build/static_src/HelpersHeapStorage.c +68 -0
- nuitka/build/static_src/HelpersImport.c +506 -0
- nuitka/build/static_src/HelpersImportHard.c +526 -0
- nuitka/build/static_src/HelpersJitSources.c +48 -0
- nuitka/build/static_src/HelpersLists.c +899 -0
- nuitka/build/static_src/HelpersListsGenerated.c +564 -0
- nuitka/build/static_src/HelpersMappings.c +46 -0
- nuitka/build/static_src/HelpersMatching.c +192 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
- nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
- nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
- nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
- nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
- nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
- nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
- nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
- nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
- nuitka/build/static_src/HelpersProfiling.c +104 -0
- nuitka/build/static_src/HelpersPythonPgo.c +113 -0
- nuitka/build/static_src/HelpersRaising.c +447 -0
- nuitka/build/static_src/HelpersSafeStrings.c +185 -0
- nuitka/build/static_src/HelpersSequences.c +134 -0
- nuitka/build/static_src/HelpersSlices.c +73 -0
- nuitka/build/static_src/HelpersStrings.c +998 -0
- nuitka/build/static_src/HelpersTuples.c +148 -0
- nuitka/build/static_src/HelpersTypes.c +329 -0
- nuitka/build/static_src/InspectPatcher.c +439 -0
- nuitka/build/static_src/MainProgram.c +2060 -0
- nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
- nuitka/build/static_src/OnefileBootstrap.c +1580 -0
- nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
- nuitka/code_generation/AsyncgenCodes.py +186 -0
- nuitka/code_generation/AttributeCodes.py +357 -0
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
- nuitka/code_generation/BranchCodes.py +67 -0
- nuitka/code_generation/BuiltinCodes.py +529 -0
- nuitka/code_generation/CallCodes.py +1186 -0
- nuitka/code_generation/ClassCodes.py +156 -0
- nuitka/code_generation/CodeGeneration.py +1078 -0
- nuitka/code_generation/CodeHelperSelection.py +81 -0
- nuitka/code_generation/CodeHelpers.py +455 -0
- nuitka/code_generation/CodeObjectCodes.py +165 -0
- nuitka/code_generation/ComparisonCodes.py +569 -0
- nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
- nuitka/code_generation/ConditionalCodes.py +236 -0
- nuitka/code_generation/ConstantCodes.py +243 -0
- nuitka/code_generation/Contexts.py +1248 -0
- nuitka/code_generation/CoroutineCodes.py +253 -0
- nuitka/code_generation/CtypesCodes.py +46 -0
- nuitka/code_generation/DictCodes.py +918 -0
- nuitka/code_generation/Emission.py +75 -0
- nuitka/code_generation/ErrorCodes.py +281 -0
- nuitka/code_generation/EvalCodes.py +444 -0
- nuitka/code_generation/ExceptionCodes.py +337 -0
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
- nuitka/code_generation/ExpressionCodes.py +61 -0
- nuitka/code_generation/FrameCodes.py +518 -0
- nuitka/code_generation/FunctionCodes.py +858 -0
- nuitka/code_generation/GeneratorCodes.py +218 -0
- nuitka/code_generation/GlobalConstants.py +249 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
- nuitka/code_generation/IdCodes.py +53 -0
- nuitka/code_generation/ImportCodes.py +468 -0
- nuitka/code_generation/Indentation.py +45 -0
- nuitka/code_generation/IndexCodes.py +50 -0
- nuitka/code_generation/InjectCCodes.py +28 -0
- nuitka/code_generation/IntegerCodes.py +110 -0
- nuitka/code_generation/IteratorCodes.py +378 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/LabelCodes.py +68 -0
- nuitka/code_generation/LineNumberCodes.py +91 -0
- nuitka/code_generation/ListCodes.py +502 -0
- nuitka/code_generation/LoaderCodes.py +193 -0
- nuitka/code_generation/LocalsDictCodes.py +359 -0
- nuitka/code_generation/LoopCodes.py +88 -0
- nuitka/code_generation/MatchCodes.py +67 -0
- nuitka/code_generation/ModuleCodes.py +247 -0
- nuitka/code_generation/Namify.py +260 -0
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +398 -0
- nuitka/code_generation/PackageResourceCodes.py +986 -0
- nuitka/code_generation/PrintCodes.py +93 -0
- nuitka/code_generation/PythonAPICodes.py +215 -0
- nuitka/code_generation/RaisingCodes.py +481 -0
- nuitka/code_generation/Reports.py +115 -0
- nuitka/code_generation/ReturnCodes.py +143 -0
- nuitka/code_generation/SetCodes.py +196 -0
- nuitka/code_generation/SliceCodes.py +465 -0
- nuitka/code_generation/StringCodes.py +303 -0
- nuitka/code_generation/SubscriptCodes.py +263 -0
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TryCodes.py +326 -0
- nuitka/code_generation/TupleCodes.py +115 -0
- nuitka/code_generation/TypeAliasCodes.py +120 -0
- nuitka/code_generation/VariableCodes.py +519 -0
- nuitka/code_generation/VariableDeclarations.py +279 -0
- nuitka/code_generation/YieldCodes.py +253 -0
- nuitka/code_generation/__init__.py +19 -0
- nuitka/code_generation/c_types/CTypeBases.py +177 -0
- nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
- nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
- nuitka/code_generation/c_types/CTypeVoids.py +92 -0
- nuitka/code_generation/c_types/__init__.py +19 -0
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
- nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
- nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
- nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
- nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
- nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
- nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
- nuitka/code_generation/templates/__init__.py +19 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
- nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
- nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
- nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
- nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
- nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
- nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
- nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
- nuitka/containers/Namedtuples.py +51 -0
- nuitka/containers/OrderedDicts.py +191 -0
- nuitka/containers/OrderedSets.py +123 -0
- nuitka/containers/OrderedSetsFallback.py +139 -0
- nuitka/containers/__init__.py +19 -0
- nuitka/distutils/Build.py +76 -0
- nuitka/distutils/DistutilCommands.py +438 -0
- nuitka/distutils/__init__.py +19 -0
- nuitka/finalizations/Finalization.py +35 -0
- nuitka/finalizations/FinalizeMarkups.py +136 -0
- nuitka/finalizations/__init__.py +19 -0
- nuitka/freezer/DependsExe.py +257 -0
- nuitka/freezer/DllDependenciesCommon.py +97 -0
- nuitka/freezer/DllDependenciesMacOS.py +444 -0
- nuitka/freezer/DllDependenciesPosix.py +242 -0
- nuitka/freezer/DllDependenciesWin32.py +315 -0
- nuitka/freezer/ImportDetection.py +359 -0
- nuitka/freezer/IncludedDataFiles.py +689 -0
- nuitka/freezer/IncludedEntryPoints.py +376 -0
- nuitka/freezer/Onefile.py +296 -0
- nuitka/freezer/Standalone.py +520 -0
- nuitka/freezer/__init__.py +19 -0
- nuitka/importing/IgnoreListing.py +449 -0
- nuitka/importing/ImportCache.py +95 -0
- nuitka/importing/ImportResolving.py +186 -0
- nuitka/importing/Importing.py +1200 -0
- nuitka/importing/PreloadedPackages.py +164 -0
- nuitka/importing/Recursion.py +611 -0
- nuitka/importing/StandardLibrary.py +429 -0
- nuitka/importing/__init__.py +19 -0
- nuitka/nodes/AsyncgenNodes.py +107 -0
- nuitka/nodes/AttributeLookupNodes.py +124 -0
- nuitka/nodes/AttributeNodes.py +386 -0
- nuitka/nodes/AttributeNodesGenerated.py +10734 -0
- nuitka/nodes/BuiltinAllNodes.py +115 -0
- nuitka/nodes/BuiltinAnyNodes.py +124 -0
- nuitka/nodes/BuiltinComplexNodes.py +83 -0
- nuitka/nodes/BuiltinDecodingNodes.py +52 -0
- nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
- nuitka/nodes/BuiltinDictNodes.py +140 -0
- nuitka/nodes/BuiltinFormatNodes.py +159 -0
- nuitka/nodes/BuiltinHashNodes.py +63 -0
- nuitka/nodes/BuiltinInputNodes.py +39 -0
- nuitka/nodes/BuiltinIntegerNodes.py +170 -0
- nuitka/nodes/BuiltinIteratorNodes.py +391 -0
- nuitka/nodes/BuiltinLenNodes.py +61 -0
- nuitka/nodes/BuiltinNextNodes.py +111 -0
- nuitka/nodes/BuiltinOpenNodes.py +148 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
- nuitka/nodes/BuiltinRangeNodes.py +690 -0
- nuitka/nodes/BuiltinRefNodes.py +314 -0
- nuitka/nodes/BuiltinSumNodes.py +104 -0
- nuitka/nodes/BuiltinTypeNodes.py +454 -0
- nuitka/nodes/BuiltinVarsNodes.py +44 -0
- nuitka/nodes/BytesNodes.py +829 -0
- nuitka/nodes/CallNodes.py +217 -0
- nuitka/nodes/Checkers.py +55 -0
- nuitka/nodes/ChildrenHavingMixins.py +21576 -0
- nuitka/nodes/ClassNodes.py +286 -0
- nuitka/nodes/CodeObjectSpecs.py +230 -0
- nuitka/nodes/ComparisonNodes.py +687 -0
- nuitka/nodes/ConditionalNodes.py +884 -0
- nuitka/nodes/ConstantRefNodes.py +1717 -0
- nuitka/nodes/ContainerMakingNodes.py +408 -0
- nuitka/nodes/ContainerOperationNodes.py +87 -0
- nuitka/nodes/CoroutineNodes.py +144 -0
- nuitka/nodes/CtypesNodes.py +51 -0
- nuitka/nodes/DictionaryNodes.py +1513 -0
- nuitka/nodes/ExceptionNodes.py +393 -0
- nuitka/nodes/ExecEvalNodes.py +229 -0
- nuitka/nodes/ExpressionBases.py +1301 -0
- nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
- nuitka/nodes/ExpressionShapeMixins.py +886 -0
- nuitka/nodes/FrameNodes.py +413 -0
- nuitka/nodes/FunctionAttributeNodes.py +102 -0
- nuitka/nodes/FunctionNodes.py +1303 -0
- nuitka/nodes/FutureSpecs.py +224 -0
- nuitka/nodes/GeneratorNodes.py +201 -0
- nuitka/nodes/GlobalsLocalsNodes.py +209 -0
- nuitka/nodes/HardImportNodesGenerated.py +3599 -0
- nuitka/nodes/ImportHardNodes.py +185 -0
- nuitka/nodes/ImportNodes.py +1366 -0
- nuitka/nodes/IndicatorMixins.py +79 -0
- nuitka/nodes/InjectCNodes.py +51 -0
- nuitka/nodes/IterationHandles.py +407 -0
- nuitka/nodes/KeyValuePairNodes.py +378 -0
- nuitka/nodes/ListOperationNodes.py +525 -0
- nuitka/nodes/LocalsDictNodes.py +717 -0
- nuitka/nodes/LocalsScopes.py +505 -0
- nuitka/nodes/LoopNodes.py +445 -0
- nuitka/nodes/MatchNodes.py +60 -0
- nuitka/nodes/ModuleAttributeNodes.py +180 -0
- nuitka/nodes/ModuleNodes.py +1137 -0
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/NodeBases.py +890 -0
- nuitka/nodes/NodeMakingHelpers.py +481 -0
- nuitka/nodes/NodeMetaClasses.py +172 -0
- nuitka/nodes/OperatorNodes.py +944 -0
- nuitka/nodes/OperatorNodesUnary.py +403 -0
- nuitka/nodes/OsSysNodes.py +215 -0
- nuitka/nodes/OutlineNodes.py +372 -0
- nuitka/nodes/PackageMetadataNodes.py +982 -0
- nuitka/nodes/PackageResourceNodes.py +424 -0
- nuitka/nodes/PrintNodes.py +105 -0
- nuitka/nodes/ReturnNodes.py +255 -0
- nuitka/nodes/SideEffectNodes.py +139 -0
- nuitka/nodes/SliceNodes.py +386 -0
- nuitka/nodes/StatementBasesGenerated.py +3419 -0
- nuitka/nodes/StatementNodes.py +316 -0
- nuitka/nodes/StrNodes.py +919 -0
- nuitka/nodes/StringConcatenationNodes.py +103 -0
- nuitka/nodes/SubscriptNodes.py +245 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TryNodes.py +519 -0
- nuitka/nodes/TypeMatchNodes.py +65 -0
- nuitka/nodes/TypeNodes.py +390 -0
- nuitka/nodes/VariableAssignNodes.py +1177 -0
- nuitka/nodes/VariableDelNodes.py +320 -0
- nuitka/nodes/VariableNameNodes.py +153 -0
- nuitka/nodes/VariableRefNodes.py +895 -0
- nuitka/nodes/VariableReleaseNodes.py +153 -0
- nuitka/nodes/YieldNodes.py +121 -0
- nuitka/nodes/__init__.py +19 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
- nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +255 -0
- nuitka/nodes/shapes/StandardShapes.py +1384 -0
- nuitka/nodes/shapes/__init__.py +19 -0
- nuitka/optimizations/BytecodeDemotion.py +105 -0
- nuitka/optimizations/FunctionInlining.py +110 -0
- nuitka/optimizations/Graphs.py +70 -0
- nuitka/optimizations/Optimization.py +363 -0
- nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
- nuitka/optimizations/Tags.py +76 -0
- nuitka/optimizations/TraceCollections.py +1257 -0
- nuitka/optimizations/ValueTraces.py +980 -0
- nuitka/optimizations/__init__.py +19 -0
- nuitka/pgo/PGO.py +160 -0
- nuitka/pgo/__init__.py +19 -0
- nuitka/plugins/PluginBase.py +1924 -0
- nuitka/plugins/Plugins.py +2007 -0
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/__init__.py +19 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
- nuitka/plugins/standard/DataFilesPlugin.py +311 -0
- nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
- nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
- nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
- nuitka/plugins/standard/DillPlugin.py +137 -0
- nuitka/plugins/standard/DllFilesPlugin.py +527 -0
- nuitka/plugins/standard/EnumPlugin.py +64 -0
- nuitka/plugins/standard/EventletPlugin.py +57 -0
- nuitka/plugins/standard/GeventPlugin.py +64 -0
- nuitka/plugins/standard/GiPlugin.py +118 -0
- nuitka/plugins/standard/GlfwPlugin.py +138 -0
- nuitka/plugins/standard/ImplicitImports.py +845 -0
- nuitka/plugins/standard/KivyPlugin.py +141 -0
- nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
- nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
- nuitka/plugins/standard/NumpyPlugin.py +35 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
- nuitka/plugins/standard/PbrPlugin.py +62 -0
- nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
- nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
- nuitka/plugins/standard/PmwPlugin.py +248 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
- nuitka/plugins/standard/PywebViewPlugin.py +81 -0
- nuitka/plugins/standard/SpacyPlugin.py +137 -0
- nuitka/plugins/standard/TensorflowPlugin.py +35 -0
- nuitka/plugins/standard/TkinterPlugin.py +416 -0
- nuitka/plugins/standard/TorchPlugin.py +35 -0
- nuitka/plugins/standard/TransformersPlugin.py +121 -0
- nuitka/plugins/standard/TrioPlugin.py +33 -0
- nuitka/plugins/standard/UpxPlugin.py +174 -0
- nuitka/plugins/standard/__init__.py +19 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
- nuitka/reports/CompilationReportReader.py +83 -0
- nuitka/reports/LicenseReport.rst.j2 +41 -0
- nuitka/reports/Reports.py +961 -0
- nuitka/reports/__init__.py +19 -0
- nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
- nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
- nuitka/specs/BuiltinListOperationSpecs.py +80 -0
- nuitka/specs/BuiltinParameterSpecs.py +831 -0
- nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
- nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
- nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
- nuitka/specs/HardImportSpecs.py +236 -0
- nuitka/specs/ParameterSpecs.py +630 -0
- nuitka/specs/__init__.py +19 -0
- nuitka/tools/Basics.py +55 -0
- nuitka/tools/__init__.py +19 -0
- nuitka/tools/commercial/__init__.py +21 -0
- nuitka/tools/data_composer/DataComposer.py +593 -0
- nuitka/tools/data_composer/__init__.py +19 -0
- nuitka/tools/data_composer/__main__.py +41 -0
- nuitka/tools/environments/CreateEnvironment.py +69 -0
- nuitka/tools/environments/Virtualenv.py +158 -0
- nuitka/tools/environments/__init__.py +19 -0
- nuitka/tools/general/__init__.py +19 -0
- nuitka/tools/general/dll_report/__init__.py +19 -0
- nuitka/tools/general/dll_report/__main__.py +83 -0
- nuitka/tools/general/find_module/FindModuleCode.py +127 -0
- nuitka/tools/general/find_module/__init__.py +19 -0
- nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
- nuitka/tools/general/generate_header/__init__.py +19 -0
- nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
- nuitka/tools/onefile_compressor/__init__.py +19 -0
- nuitka/tools/onefile_compressor/__main__.py +41 -0
- nuitka/tools/podman/Podman.py +55 -0
- nuitka/tools/podman/__init__.py +19 -0
- nuitka/tools/podman/__main__.py +425 -0
- nuitka/tools/profiler/__init__.py +19 -0
- nuitka/tools/profiler/__main__.py +93 -0
- nuitka/tools/scanning/DisplayDistributions.py +39 -0
- nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
- nuitka/tools/scanning/DisplayPackageData.py +73 -0
- nuitka/tools/scanning/__init__.py +19 -0
- nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
- nuitka/tools/specialize/Common.py +380 -0
- nuitka/tools/specialize/SpecializeC.py +1483 -0
- nuitka/tools/specialize/SpecializePython.py +1151 -0
- nuitka/tools/specialize/__init__.py +19 -0
- nuitka/tools/testing/Common.py +2007 -0
- nuitka/tools/testing/Constructs.py +53 -0
- nuitka/tools/testing/DocTests.py +156 -0
- nuitka/tools/testing/OutputComparison.py +313 -0
- nuitka/tools/testing/Pythons.py +34 -0
- nuitka/tools/testing/RuntimeTracing.py +260 -0
- nuitka/tools/testing/SearchModes.py +208 -0
- nuitka/tools/testing/Valgrind.py +103 -0
- nuitka/tools/testing/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
- nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
- nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
- nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
- nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
- nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
- nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
- nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
- nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
- nuitka/tools/watch/AutoStage.py +145 -0
- nuitka/tools/watch/Common.py +55 -0
- nuitka/tools/watch/Conda.py +125 -0
- nuitka/tools/watch/GitHub.py +113 -0
- nuitka/tools/watch/Pacman.py +73 -0
- nuitka/tools/watch/Pipenv.py +145 -0
- nuitka/tools/watch/__init__.py +19 -0
- nuitka/tools/watch/__main__.py +615 -0
- nuitka/tree/Building.py +1459 -0
- nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
- nuitka/tree/Extractions.py +48 -0
- nuitka/tree/FutureSpecState.py +71 -0
- nuitka/tree/InternalModule.py +96 -0
- nuitka/tree/Operations.py +45 -0
- nuitka/tree/ReformulationAssertStatements.py +97 -0
- nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
- nuitka/tree/ReformulationBooleanExpressions.py +97 -0
- nuitka/tree/ReformulationCallExpressions.py +314 -0
- nuitka/tree/ReformulationClasses.py +407 -0
- nuitka/tree/ReformulationClasses3.py +1149 -0
- nuitka/tree/ReformulationComparisonExpressions.py +174 -0
- nuitka/tree/ReformulationContractionExpressions.py +676 -0
- nuitka/tree/ReformulationDictionaryCreation.py +304 -0
- nuitka/tree/ReformulationExecStatements.py +386 -0
- nuitka/tree/ReformulationForLoopStatements.py +215 -0
- nuitka/tree/ReformulationFunctionStatements.py +931 -0
- nuitka/tree/ReformulationImportStatements.py +333 -0
- nuitka/tree/ReformulationLambdaExpressions.py +185 -0
- nuitka/tree/ReformulationMatchStatements.py +797 -0
- nuitka/tree/ReformulationMultidist.py +80 -0
- nuitka/tree/ReformulationNamespacePackages.py +239 -0
- nuitka/tree/ReformulationPrintStatements.py +127 -0
- nuitka/tree/ReformulationSequenceCreation.py +438 -0
- nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
- nuitka/tree/ReformulationTryExceptStatements.py +418 -0
- nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
- nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
- nuitka/tree/ReformulationWithStatements.py +382 -0
- nuitka/tree/ReformulationYieldExpressions.py +133 -0
- nuitka/tree/SourceHandling.py +476 -0
- nuitka/tree/SyntaxErrors.py +143 -0
- nuitka/tree/TreeHelpers.py +720 -0
- nuitka/tree/VariableClosure.py +483 -0
- nuitka/tree/__init__.py +19 -0
- nuitka/utils/AppDirs.py +104 -0
- nuitka/utils/CStrings.py +208 -0
- nuitka/utils/CommandLineOptions.py +207 -0
- nuitka/utils/Distributions.py +728 -0
- nuitka/utils/Download.py +217 -0
- nuitka/utils/Execution.py +517 -0
- nuitka/utils/FileOperations.py +1587 -0
- nuitka/utils/Hashing.py +137 -0
- nuitka/utils/Images.py +79 -0
- nuitka/utils/Importing.py +335 -0
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +254 -0
- nuitka/utils/InstanceCounters.py +86 -0
- nuitka/utils/Jinja2.py +158 -0
- nuitka/utils/Json.py +40 -0
- nuitka/utils/MacOSApp.py +134 -0
- nuitka/utils/MemoryUsage.py +165 -0
- nuitka/utils/ModuleNames.py +317 -0
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/ReExecute.py +152 -0
- nuitka/utils/Rest.py +60 -0
- nuitka/utils/SharedLibraries.py +1014 -0
- nuitka/utils/Shebang.py +113 -0
- nuitka/utils/Signing.py +144 -0
- nuitka/utils/SlotMetaClasses.py +57 -0
- nuitka/utils/StaticLibraries.py +260 -0
- nuitka/utils/ThreadedExecutor.py +87 -0
- nuitka/utils/Timing.py +102 -0
- nuitka/utils/Utils.py +483 -0
- nuitka/utils/WindowsFileUsage.py +337 -0
- nuitka/utils/WindowsResources.py +652 -0
- nuitka/utils/Yaml.py +247 -0
- nuitka/utils/__init__.py +19 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
- nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
- nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
- nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
- nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
- nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
- nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,4290 @@
|
|
|
1
|
+
# Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
""" Shapes for Python built-in types.
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from nuitka.code_generation.c_types.CTypeNuitkaBooleans import (
|
|
9
|
+
CTypeNuitkaBoolEnum,
|
|
10
|
+
)
|
|
11
|
+
from nuitka.code_generation.c_types.CTypeNuitkaInts import (
|
|
12
|
+
CTypeNuitkaIntOrLongStruct,
|
|
13
|
+
)
|
|
14
|
+
from nuitka.code_generation.Reports import onMissingOperation
|
|
15
|
+
from nuitka.Constants import the_empty_unicode
|
|
16
|
+
from nuitka.Options import isExperimental
|
|
17
|
+
from nuitka.PythonVersions import python_version
|
|
18
|
+
|
|
19
|
+
from .ControlFlowDescriptions import (
|
|
20
|
+
ControlFlowDescriptionAddUnsupported,
|
|
21
|
+
ControlFlowDescriptionBitandUnsupported,
|
|
22
|
+
ControlFlowDescriptionBitorUnsupported,
|
|
23
|
+
ControlFlowDescriptionBitxorUnsupported,
|
|
24
|
+
ControlFlowDescriptionComparisonUnorderable,
|
|
25
|
+
ControlFlowDescriptionDivmodUnsupported,
|
|
26
|
+
ControlFlowDescriptionElementBasedEscape,
|
|
27
|
+
ControlFlowDescriptionFloorDivUnsupported,
|
|
28
|
+
ControlFlowDescriptionFormatError,
|
|
29
|
+
ControlFlowDescriptionFullEscape,
|
|
30
|
+
ControlFlowDescriptionLshiftUnsupported,
|
|
31
|
+
ControlFlowDescriptionMatmultUnsupported,
|
|
32
|
+
ControlFlowDescriptionModUnsupported,
|
|
33
|
+
ControlFlowDescriptionMulUnsupported,
|
|
34
|
+
ControlFlowDescriptionNoEscape,
|
|
35
|
+
ControlFlowDescriptionOldDivUnsupported,
|
|
36
|
+
ControlFlowDescriptionPowUnsupported,
|
|
37
|
+
ControlFlowDescriptionRshiftUnsupported,
|
|
38
|
+
ControlFlowDescriptionSubUnsupported,
|
|
39
|
+
ControlFlowDescriptionTrueDivUnsupported,
|
|
40
|
+
ControlFlowDescriptionValueErrorNoEscape,
|
|
41
|
+
ControlFlowDescriptionZeroDivisionNoEscape,
|
|
42
|
+
)
|
|
43
|
+
from .ShapeMixins import (
|
|
44
|
+
ShapeContainerImmutableMixin,
|
|
45
|
+
ShapeContainerMixin,
|
|
46
|
+
ShapeContainerMutableMixin,
|
|
47
|
+
ShapeIteratorMixin,
|
|
48
|
+
ShapeNotContainerMixin,
|
|
49
|
+
ShapeNotNumberMixin,
|
|
50
|
+
ShapeNumberMixin,
|
|
51
|
+
)
|
|
52
|
+
from .StandardShapes import (
|
|
53
|
+
ShapeBase,
|
|
54
|
+
ShapeLoopCompleteAlternative,
|
|
55
|
+
ShapeLoopInitialAlternative,
|
|
56
|
+
ShapeTypeUnknown,
|
|
57
|
+
operation_result_unknown,
|
|
58
|
+
tshape_unknown,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Updated later only, due to cyclic dependencies, make the dictionary
|
|
62
|
+
# available for reference use in class definition.
|
|
63
|
+
add_shapes_none = {}
|
|
64
|
+
sub_shapes_none = {}
|
|
65
|
+
mult_shapes_none = {}
|
|
66
|
+
floordiv_shapes_none = {}
|
|
67
|
+
truediv_shapes_none = {}
|
|
68
|
+
olddiv_shapes_none = {}
|
|
69
|
+
mod_shapes_none = {}
|
|
70
|
+
divmod_shapes_none = {}
|
|
71
|
+
pow_shapes_none = {}
|
|
72
|
+
bitor_shapes_none = {}
|
|
73
|
+
bitand_shapes_none = {}
|
|
74
|
+
bitxor_shapes_none = {}
|
|
75
|
+
lshift_shapes_none = {}
|
|
76
|
+
rshift_shapes_none = {}
|
|
77
|
+
matmult_shapes_none = {}
|
|
78
|
+
add_shapes_bool = {}
|
|
79
|
+
sub_shapes_bool = {}
|
|
80
|
+
mult_shapes_bool = {}
|
|
81
|
+
floordiv_shapes_bool = {}
|
|
82
|
+
truediv_shapes_bool = {}
|
|
83
|
+
olddiv_shapes_bool = {}
|
|
84
|
+
mod_shapes_bool = {}
|
|
85
|
+
divmod_shapes_bool = {}
|
|
86
|
+
pow_shapes_bool = {}
|
|
87
|
+
bitor_shapes_bool = {}
|
|
88
|
+
bitand_shapes_bool = {}
|
|
89
|
+
bitxor_shapes_bool = {}
|
|
90
|
+
lshift_shapes_bool = {}
|
|
91
|
+
rshift_shapes_bool = {}
|
|
92
|
+
matmult_shapes_bool = matmult_shapes_none
|
|
93
|
+
add_shapes_int = {}
|
|
94
|
+
sub_shapes_int = {}
|
|
95
|
+
mult_shapes_int = {}
|
|
96
|
+
floordiv_shapes_int = {}
|
|
97
|
+
truediv_shapes_int = {}
|
|
98
|
+
olddiv_shapes_int = {}
|
|
99
|
+
mod_shapes_int = {}
|
|
100
|
+
divmod_shapes_int = divmod_shapes_bool
|
|
101
|
+
pow_shapes_int = {}
|
|
102
|
+
bitor_shapes_int = {}
|
|
103
|
+
bitand_shapes_int = {}
|
|
104
|
+
bitxor_shapes_int = {}
|
|
105
|
+
lshift_shapes_int = {}
|
|
106
|
+
rshift_shapes_int = {}
|
|
107
|
+
matmult_shapes_int = matmult_shapes_none
|
|
108
|
+
add_shapes_long = {}
|
|
109
|
+
sub_shapes_long = {}
|
|
110
|
+
mult_shapes_long = {}
|
|
111
|
+
floordiv_shapes_long = {}
|
|
112
|
+
truediv_shapes_long = truediv_shapes_int
|
|
113
|
+
olddiv_shapes_long = {}
|
|
114
|
+
mod_shapes_long = {}
|
|
115
|
+
divmod_shapes_long = divmod_shapes_bool
|
|
116
|
+
pow_shapes_long = {}
|
|
117
|
+
bitor_shapes_long = {}
|
|
118
|
+
bitand_shapes_long = {}
|
|
119
|
+
bitxor_shapes_long = {}
|
|
120
|
+
lshift_shapes_long = {}
|
|
121
|
+
rshift_shapes_long = {}
|
|
122
|
+
matmult_shapes_long = matmult_shapes_none
|
|
123
|
+
add_shapes_intorlong = {}
|
|
124
|
+
sub_shapes_intorlong = {}
|
|
125
|
+
mult_shapes_intorlong = {}
|
|
126
|
+
floordiv_shapes_intorlong = {}
|
|
127
|
+
truediv_shapes_intorlong = {}
|
|
128
|
+
olddiv_shapes_intorlong = {}
|
|
129
|
+
mod_shapes_intorlong = {}
|
|
130
|
+
divmod_shapes_intorlong = {}
|
|
131
|
+
pow_shapes_intorlong = {}
|
|
132
|
+
bitor_shapes_intorlong = {}
|
|
133
|
+
bitand_shapes_intorlong = {}
|
|
134
|
+
bitxor_shapes_intorlong = {}
|
|
135
|
+
lshift_shapes_intorlong = {}
|
|
136
|
+
rshift_shapes_intorlong = {}
|
|
137
|
+
matmult_shapes_intorlong = matmult_shapes_none
|
|
138
|
+
add_shapes_float = {}
|
|
139
|
+
sub_shapes_float = {}
|
|
140
|
+
mult_shapes_float = {}
|
|
141
|
+
floordiv_shapes_float = {}
|
|
142
|
+
truediv_shapes_float = {}
|
|
143
|
+
olddiv_shapes_float = {}
|
|
144
|
+
mod_shapes_float = {}
|
|
145
|
+
divmod_shapes_float = divmod_shapes_bool
|
|
146
|
+
pow_shapes_float = {}
|
|
147
|
+
bitor_shapes_float = bitor_shapes_none
|
|
148
|
+
bitand_shapes_float = bitand_shapes_none
|
|
149
|
+
bitxor_shapes_float = bitxor_shapes_none
|
|
150
|
+
lshift_shapes_float = lshift_shapes_none
|
|
151
|
+
rshift_shapes_float = rshift_shapes_none
|
|
152
|
+
matmult_shapes_float = matmult_shapes_none
|
|
153
|
+
add_shapes_complex = {}
|
|
154
|
+
sub_shapes_complex = {}
|
|
155
|
+
mult_shapes_complex = {}
|
|
156
|
+
|
|
157
|
+
if python_version < 0x300:
|
|
158
|
+
floordiv_shapes_complex = {}
|
|
159
|
+
else:
|
|
160
|
+
floordiv_shapes_complex = floordiv_shapes_none
|
|
161
|
+
|
|
162
|
+
truediv_shapes_complex = {}
|
|
163
|
+
olddiv_shapes_complex = {}
|
|
164
|
+
mod_shapes_complex = {}
|
|
165
|
+
divmod_shapes_complex = divmod_shapes_bool
|
|
166
|
+
pow_shapes_complex = {}
|
|
167
|
+
bitor_shapes_complex = bitor_shapes_none
|
|
168
|
+
bitand_shapes_complex = bitand_shapes_none
|
|
169
|
+
bitxor_shapes_complex = bitxor_shapes_none
|
|
170
|
+
lshift_shapes_complex = lshift_shapes_none
|
|
171
|
+
rshift_shapes_complex = rshift_shapes_none
|
|
172
|
+
matmult_shapes_complex = matmult_shapes_none
|
|
173
|
+
add_shapes_tuple = {}
|
|
174
|
+
sub_shapes_tuple = sub_shapes_none
|
|
175
|
+
mult_shapes_tuple = {}
|
|
176
|
+
floordiv_shapes_tuple = floordiv_shapes_none
|
|
177
|
+
truediv_shapes_tuple = truediv_shapes_none
|
|
178
|
+
olddiv_shapes_tuple = olddiv_shapes_none
|
|
179
|
+
mod_shapes_tuple = mod_shapes_none
|
|
180
|
+
divmod_shapes_tuple = divmod_shapes_none
|
|
181
|
+
pow_shapes_tuple = pow_shapes_none
|
|
182
|
+
bitor_shapes_tuple = bitor_shapes_none
|
|
183
|
+
bitand_shapes_tuple = bitand_shapes_none
|
|
184
|
+
bitxor_shapes_tuple = bitxor_shapes_none
|
|
185
|
+
lshift_shapes_tuple = lshift_shapes_none
|
|
186
|
+
rshift_shapes_tuple = rshift_shapes_none
|
|
187
|
+
matmult_shapes_tuple = matmult_shapes_none
|
|
188
|
+
add_shapes_list = {}
|
|
189
|
+
iadd_shapes_list = {}
|
|
190
|
+
sub_shapes_list = sub_shapes_none
|
|
191
|
+
mult_shapes_list = {}
|
|
192
|
+
floordiv_shapes_list = floordiv_shapes_none
|
|
193
|
+
truediv_shapes_list = truediv_shapes_none
|
|
194
|
+
olddiv_shapes_list = olddiv_shapes_none
|
|
195
|
+
mod_shapes_list = mod_shapes_none
|
|
196
|
+
divmod_shapes_list = divmod_shapes_none
|
|
197
|
+
pow_shapes_list = pow_shapes_none
|
|
198
|
+
bitor_shapes_list = bitor_shapes_none
|
|
199
|
+
bitand_shapes_list = bitand_shapes_none
|
|
200
|
+
bitxor_shapes_list = bitxor_shapes_none
|
|
201
|
+
lshift_shapes_list = lshift_shapes_none
|
|
202
|
+
rshift_shapes_list = rshift_shapes_none
|
|
203
|
+
matmult_shapes_list = matmult_shapes_none
|
|
204
|
+
add_shapes_set = {}
|
|
205
|
+
sub_shapes_set = {}
|
|
206
|
+
mult_shapes_set = mult_shapes_none
|
|
207
|
+
floordiv_shapes_set = floordiv_shapes_none
|
|
208
|
+
truediv_shapes_set = truediv_shapes_none
|
|
209
|
+
olddiv_shapes_set = olddiv_shapes_none
|
|
210
|
+
mod_shapes_set = mod_shapes_none
|
|
211
|
+
divmod_shapes_set = divmod_shapes_none
|
|
212
|
+
pow_shapes_set = pow_shapes_none
|
|
213
|
+
bitor_shapes_set = {}
|
|
214
|
+
bitand_shapes_set = {}
|
|
215
|
+
bitxor_shapes_set = {}
|
|
216
|
+
lshift_shapes_set = lshift_shapes_none
|
|
217
|
+
rshift_shapes_set = rshift_shapes_none
|
|
218
|
+
matmult_shapes_set = matmult_shapes_none
|
|
219
|
+
add_shapes_frozenset = {}
|
|
220
|
+
sub_shapes_frozenset = {}
|
|
221
|
+
mult_shapes_frozenset = mult_shapes_none
|
|
222
|
+
floordiv_shapes_frozenset = floordiv_shapes_none
|
|
223
|
+
truediv_shapes_frozenset = truediv_shapes_none
|
|
224
|
+
olddiv_shapes_frozenset = olddiv_shapes_none
|
|
225
|
+
mod_shapes_frozenset = mod_shapes_none
|
|
226
|
+
divmod_shapes_frozenset = divmod_shapes_none
|
|
227
|
+
pow_shapes_frozenset = pow_shapes_none
|
|
228
|
+
bitor_shapes_frozenset = {}
|
|
229
|
+
bitand_shapes_frozenset = {}
|
|
230
|
+
bitxor_shapes_frozenset = {}
|
|
231
|
+
lshift_shapes_frozenset = lshift_shapes_none
|
|
232
|
+
rshift_shapes_frozenset = rshift_shapes_none
|
|
233
|
+
matmult_shapes_frozenset = matmult_shapes_none
|
|
234
|
+
add_shapes_dict = {}
|
|
235
|
+
sub_shapes_dict = sub_shapes_none
|
|
236
|
+
mult_shapes_dict = mult_shapes_none
|
|
237
|
+
floordiv_shapes_dict = floordiv_shapes_none
|
|
238
|
+
truediv_shapes_dict = truediv_shapes_none
|
|
239
|
+
olddiv_shapes_dict = olddiv_shapes_none
|
|
240
|
+
mod_shapes_dict = mod_shapes_none
|
|
241
|
+
divmod_shapes_dict = divmod_shapes_none
|
|
242
|
+
pow_shapes_dict = pow_shapes_none
|
|
243
|
+
bitor_shapes_dict = dict(bitor_shapes_none)
|
|
244
|
+
ibitor_shapes_dict = dict(bitor_shapes_none)
|
|
245
|
+
bitand_shapes_dict = bitand_shapes_none
|
|
246
|
+
bitxor_shapes_dict = bitxor_shapes_none
|
|
247
|
+
lshift_shapes_dict = lshift_shapes_none
|
|
248
|
+
rshift_shapes_dict = rshift_shapes_none
|
|
249
|
+
matmult_shapes_dict = matmult_shapes_none
|
|
250
|
+
add_shapes_str = {}
|
|
251
|
+
sub_shapes_str = sub_shapes_none
|
|
252
|
+
mult_shapes_str = {}
|
|
253
|
+
floordiv_shapes_str = floordiv_shapes_none
|
|
254
|
+
truediv_shapes_str = truediv_shapes_none
|
|
255
|
+
olddiv_shapes_str = olddiv_shapes_none
|
|
256
|
+
mod_shapes_str = {}
|
|
257
|
+
divmod_shapes_str = divmod_shapes_none
|
|
258
|
+
pow_shapes_str = pow_shapes_none
|
|
259
|
+
bitor_shapes_str = bitor_shapes_none
|
|
260
|
+
bitand_shapes_str = bitand_shapes_none
|
|
261
|
+
bitxor_shapes_str = bitxor_shapes_none
|
|
262
|
+
lshift_shapes_str = lshift_shapes_none
|
|
263
|
+
rshift_shapes_str = rshift_shapes_none
|
|
264
|
+
matmult_shapes_str = matmult_shapes_none
|
|
265
|
+
add_shapes_bytes = {}
|
|
266
|
+
sub_shapes_bytes = sub_shapes_none
|
|
267
|
+
mult_shapes_bytes = {}
|
|
268
|
+
floordiv_shapes_bytes = floordiv_shapes_none
|
|
269
|
+
truediv_shapes_bytes = truediv_shapes_none
|
|
270
|
+
olddiv_shapes_bytes = olddiv_shapes_none
|
|
271
|
+
mod_shapes_bytes = {}
|
|
272
|
+
divmod_shapes_bytes = divmod_shapes_none
|
|
273
|
+
pow_shapes_bytes = pow_shapes_none
|
|
274
|
+
bitor_shapes_bytes = bitor_shapes_none
|
|
275
|
+
bitand_shapes_bytes = bitand_shapes_none
|
|
276
|
+
bitxor_shapes_bytes = bitxor_shapes_none
|
|
277
|
+
lshift_shapes_bytes = lshift_shapes_none
|
|
278
|
+
rshift_shapes_bytes = rshift_shapes_none
|
|
279
|
+
matmult_shapes_bytes = matmult_shapes_none
|
|
280
|
+
add_shapes_bytearray = {}
|
|
281
|
+
sub_shapes_bytearray = sub_shapes_none
|
|
282
|
+
mult_shapes_bytearray = {}
|
|
283
|
+
floordiv_shapes_bytearray = floordiv_shapes_none
|
|
284
|
+
truediv_shapes_bytearray = truediv_shapes_none
|
|
285
|
+
olddiv_shapes_bytearray = olddiv_shapes_none
|
|
286
|
+
mod_shapes_bytearray = {}
|
|
287
|
+
divmod_shapes_bytearray = divmod_shapes_none
|
|
288
|
+
pow_shapes_bytearray = pow_shapes_none
|
|
289
|
+
bitor_shapes_bytearray = bitor_shapes_none
|
|
290
|
+
bitand_shapes_bytearray = bitand_shapes_none
|
|
291
|
+
bitxor_shapes_bytearray = bitxor_shapes_none
|
|
292
|
+
lshift_shapes_bytearray = lshift_shapes_none
|
|
293
|
+
rshift_shapes_bytearray = rshift_shapes_none
|
|
294
|
+
matmult_shapes_bytearray = matmult_shapes_none
|
|
295
|
+
add_shapes_unicode = {}
|
|
296
|
+
sub_shapes_unicode = sub_shapes_none
|
|
297
|
+
mult_shapes_unicode = {}
|
|
298
|
+
floordiv_shapes_unicode = floordiv_shapes_none
|
|
299
|
+
truediv_shapes_unicode = truediv_shapes_none
|
|
300
|
+
olddiv_shapes_unicode = olddiv_shapes_none
|
|
301
|
+
mod_shapes_unicode = {}
|
|
302
|
+
divmod_shapes_unicode = divmod_shapes_none
|
|
303
|
+
pow_shapes_unicode = pow_shapes_none
|
|
304
|
+
bitor_shapes_unicode = bitor_shapes_none
|
|
305
|
+
bitand_shapes_unicode = bitand_shapes_none
|
|
306
|
+
bitxor_shapes_unicode = bitxor_shapes_none
|
|
307
|
+
lshift_shapes_unicode = lshift_shapes_none
|
|
308
|
+
rshift_shapes_unicode = rshift_shapes_none
|
|
309
|
+
matmult_shapes_unicode = matmult_shapes_none
|
|
310
|
+
add_shapes_strorunicode = {}
|
|
311
|
+
sub_shapes_strorunicode = {}
|
|
312
|
+
mult_shapes_strorunicode = {}
|
|
313
|
+
floordiv_shapes_strorunicode = {}
|
|
314
|
+
truediv_shapes_strorunicode = {}
|
|
315
|
+
olddiv_shapes_strorunicode = {}
|
|
316
|
+
mod_shapes_strorunicode = {}
|
|
317
|
+
divmod_shapes_strorunicode = {}
|
|
318
|
+
pow_shapes_strorunicode = {}
|
|
319
|
+
bitor_shapes_strorunicode = {}
|
|
320
|
+
bitand_shapes_strorunicode = {}
|
|
321
|
+
bitxor_shapes_strorunicode = {}
|
|
322
|
+
lshift_shapes_strorunicode = {}
|
|
323
|
+
rshift_shapes_strorunicode = {}
|
|
324
|
+
matmult_shapes_strorunicode = matmult_shapes_none
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
def _getComparisonLtShapeGeneric(self, right_shape):
|
|
328
|
+
if type(right_shape) is ShapeLoopCompleteAlternative:
|
|
329
|
+
return right_shape.getComparisonLtLShape(self)
|
|
330
|
+
|
|
331
|
+
if type(right_shape) is ShapeLoopInitialAlternative:
|
|
332
|
+
return operation_result_unknown
|
|
333
|
+
|
|
334
|
+
onMissingOperation("Lt", self, right_shape)
|
|
335
|
+
return operation_result_unknown
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
def _getComparisonEqShapeGeneric(self, right_shape):
|
|
339
|
+
if type(right_shape) is ShapeLoopCompleteAlternative:
|
|
340
|
+
return right_shape.getComparisonEqLShape(self)
|
|
341
|
+
|
|
342
|
+
if type(right_shape) is ShapeLoopInitialAlternative:
|
|
343
|
+
return operation_result_unknown
|
|
344
|
+
|
|
345
|
+
onMissingOperation("Eq", self, right_shape)
|
|
346
|
+
return operation_result_unknown
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
class ShapeTypeNoneType(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
350
|
+
__slots__ = ()
|
|
351
|
+
|
|
352
|
+
typical_value = None
|
|
353
|
+
|
|
354
|
+
@staticmethod
|
|
355
|
+
def getTypeName():
|
|
356
|
+
return "NoneType"
|
|
357
|
+
|
|
358
|
+
@staticmethod
|
|
359
|
+
def hasShapeSlotHash():
|
|
360
|
+
return True
|
|
361
|
+
|
|
362
|
+
@staticmethod
|
|
363
|
+
def hasShapeTrustedAttributes():
|
|
364
|
+
return True
|
|
365
|
+
|
|
366
|
+
add_shapes = add_shapes_none
|
|
367
|
+
sub_shapes = sub_shapes_none
|
|
368
|
+
mult_shapes = mult_shapes_none
|
|
369
|
+
floordiv_shapes = floordiv_shapes_none
|
|
370
|
+
truediv_shapes = truediv_shapes_none
|
|
371
|
+
olddiv_shapes = olddiv_shapes_none
|
|
372
|
+
mod_shapes = mod_shapes_none
|
|
373
|
+
divmod_shapes = divmod_shapes_none
|
|
374
|
+
pow_shapes = pow_shapes_none
|
|
375
|
+
bitor_shapes = bitor_shapes_none
|
|
376
|
+
bitand_shapes = bitand_shapes_none
|
|
377
|
+
bitxor_shapes = bitxor_shapes_none
|
|
378
|
+
lshift_shapes = lshift_shapes_none
|
|
379
|
+
rshift_shapes = rshift_shapes_none
|
|
380
|
+
matmult_shapes = matmult_shapes_none
|
|
381
|
+
|
|
382
|
+
if python_version < 0x300:
|
|
383
|
+
|
|
384
|
+
def getComparisonLtShape(self, right_shape):
|
|
385
|
+
if right_shape is tshape_unknown:
|
|
386
|
+
return operation_result_unknown
|
|
387
|
+
|
|
388
|
+
if right_shape.getTypeName() is not None:
|
|
389
|
+
return operation_result_bool_noescape
|
|
390
|
+
|
|
391
|
+
if right_shape in (tshape_int_or_long, tshape_str_or_unicode):
|
|
392
|
+
return operation_result_bool_noescape
|
|
393
|
+
|
|
394
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
395
|
+
|
|
396
|
+
else:
|
|
397
|
+
|
|
398
|
+
def getComparisonLtShape(self, right_shape):
|
|
399
|
+
if right_shape is tshape_unknown:
|
|
400
|
+
return operation_result_unknown
|
|
401
|
+
|
|
402
|
+
if right_shape.getTypeName() is not None:
|
|
403
|
+
return operation_result_unorderable_comparison
|
|
404
|
+
|
|
405
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
406
|
+
|
|
407
|
+
def getComparisonEqShape(self, right_shape):
|
|
408
|
+
if right_shape is tshape_unknown:
|
|
409
|
+
return operation_result_unknown
|
|
410
|
+
|
|
411
|
+
if right_shape.getTypeName() is not None:
|
|
412
|
+
return operation_result_bool_noescape
|
|
413
|
+
|
|
414
|
+
return _getComparisonEqShapeGeneric(self, right_shape)
|
|
415
|
+
|
|
416
|
+
def getComparisonNeqShape(self, right_shape):
|
|
417
|
+
return self.getComparisonEqShape(right_shape)
|
|
418
|
+
|
|
419
|
+
@staticmethod
|
|
420
|
+
def getOperationUnaryReprEscape():
|
|
421
|
+
return ControlFlowDescriptionNoEscape
|
|
422
|
+
|
|
423
|
+
@staticmethod
|
|
424
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
425
|
+
return hasattr(None, attribute_name)
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
tshape_none = ShapeTypeNoneType()
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
class ShapeTypeBool(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
432
|
+
__slots__ = ()
|
|
433
|
+
|
|
434
|
+
typical_value = True
|
|
435
|
+
|
|
436
|
+
@staticmethod
|
|
437
|
+
def getTypeName():
|
|
438
|
+
return "bool"
|
|
439
|
+
|
|
440
|
+
@staticmethod
|
|
441
|
+
def getCType():
|
|
442
|
+
return CTypeNuitkaBoolEnum
|
|
443
|
+
|
|
444
|
+
add_shapes = add_shapes_bool
|
|
445
|
+
sub_shapes = sub_shapes_bool
|
|
446
|
+
mult_shapes = mult_shapes_bool
|
|
447
|
+
floordiv_shapes = floordiv_shapes_bool
|
|
448
|
+
truediv_shapes = truediv_shapes_bool
|
|
449
|
+
olddiv_shapes = olddiv_shapes_bool
|
|
450
|
+
mod_shapes = mod_shapes_bool
|
|
451
|
+
divmod_shapes = divmod_shapes_bool
|
|
452
|
+
pow_shapes = pow_shapes_bool
|
|
453
|
+
bitor_shapes = bitor_shapes_bool
|
|
454
|
+
bitand_shapes = bitand_shapes_bool
|
|
455
|
+
bitxor_shapes = bitxor_shapes_bool
|
|
456
|
+
lshift_shapes = lshift_shapes_bool
|
|
457
|
+
rshift_shapes = rshift_shapes_bool
|
|
458
|
+
matmult_shapes = matmult_shapes_bool
|
|
459
|
+
|
|
460
|
+
def getComparisonLtShape(self, right_shape):
|
|
461
|
+
if right_shape is tshape_unknown:
|
|
462
|
+
return operation_result_unknown
|
|
463
|
+
|
|
464
|
+
if right_shape in (
|
|
465
|
+
tshape_int,
|
|
466
|
+
tshape_long,
|
|
467
|
+
tshape_int_or_long,
|
|
468
|
+
tshape_bool,
|
|
469
|
+
tshape_float,
|
|
470
|
+
):
|
|
471
|
+
return operation_result_bool_noescape
|
|
472
|
+
|
|
473
|
+
if right_shape is tshape_int_or_long_derived:
|
|
474
|
+
return operation_result_unknown
|
|
475
|
+
|
|
476
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
477
|
+
|
|
478
|
+
@staticmethod
|
|
479
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
480
|
+
return hasattr(True, attribute_name)
|
|
481
|
+
|
|
482
|
+
def getOperationUnaryAddShape(self):
|
|
483
|
+
return tshape_int, ControlFlowDescriptionNoEscape
|
|
484
|
+
|
|
485
|
+
def getOperationUnarySubShape(self):
|
|
486
|
+
return tshape_int, ControlFlowDescriptionNoEscape
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
tshape_bool = ShapeTypeBool()
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
class ShapeTypeInt(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
493
|
+
__slots__ = ()
|
|
494
|
+
|
|
495
|
+
typical_value = 7
|
|
496
|
+
|
|
497
|
+
@staticmethod
|
|
498
|
+
def getTypeName():
|
|
499
|
+
return "int"
|
|
500
|
+
|
|
501
|
+
if isExperimental("optimize-dual-int"):
|
|
502
|
+
|
|
503
|
+
@staticmethod
|
|
504
|
+
def getCType():
|
|
505
|
+
return CTypeNuitkaIntOrLongStruct
|
|
506
|
+
|
|
507
|
+
helper_code = "INT" if python_version < 0x300 else "LONG"
|
|
508
|
+
|
|
509
|
+
add_shapes = add_shapes_int
|
|
510
|
+
sub_shapes = sub_shapes_int
|
|
511
|
+
mult_shapes = mult_shapes_int
|
|
512
|
+
floordiv_shapes = floordiv_shapes_int
|
|
513
|
+
truediv_shapes = truediv_shapes_int
|
|
514
|
+
olddiv_shapes = olddiv_shapes_int
|
|
515
|
+
mod_shapes = mod_shapes_int
|
|
516
|
+
divmod_shapes = divmod_shapes_int
|
|
517
|
+
pow_shapes = pow_shapes_int
|
|
518
|
+
bitor_shapes = bitor_shapes_int
|
|
519
|
+
bitand_shapes = bitand_shapes_int
|
|
520
|
+
bitxor_shapes = bitxor_shapes_int
|
|
521
|
+
lshift_shapes = lshift_shapes_int
|
|
522
|
+
rshift_shapes = rshift_shapes_int
|
|
523
|
+
matmult_shapes = matmult_shapes_int
|
|
524
|
+
|
|
525
|
+
def getComparisonLtShape(self, right_shape):
|
|
526
|
+
if right_shape is tshape_unknown:
|
|
527
|
+
return operation_result_unknown
|
|
528
|
+
|
|
529
|
+
if right_shape in (
|
|
530
|
+
tshape_int,
|
|
531
|
+
tshape_long,
|
|
532
|
+
tshape_int_or_long,
|
|
533
|
+
tshape_bool,
|
|
534
|
+
tshape_float,
|
|
535
|
+
):
|
|
536
|
+
return operation_result_bool_noescape
|
|
537
|
+
|
|
538
|
+
if right_shape in (
|
|
539
|
+
tshape_long_derived,
|
|
540
|
+
tshape_int_or_long_derived,
|
|
541
|
+
tshape_float_derived,
|
|
542
|
+
):
|
|
543
|
+
return operation_result_unknown
|
|
544
|
+
|
|
545
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
546
|
+
|
|
547
|
+
@staticmethod
|
|
548
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
549
|
+
return hasattr(7, attribute_name)
|
|
550
|
+
|
|
551
|
+
def getOperationUnaryAddShape(self):
|
|
552
|
+
return self, ControlFlowDescriptionNoEscape
|
|
553
|
+
|
|
554
|
+
def getOperationUnarySubShape(self):
|
|
555
|
+
return tshape_int_or_long, ControlFlowDescriptionNoEscape
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
tshape_int = ShapeTypeInt()
|
|
559
|
+
|
|
560
|
+
if python_version < 0x300:
|
|
561
|
+
_the_typical_long_value = long(7) # pylint: disable=I0021,undefined-variable
|
|
562
|
+
|
|
563
|
+
class ShapeTypeLong(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
564
|
+
__slots__ = ()
|
|
565
|
+
|
|
566
|
+
typical_value = _the_typical_long_value
|
|
567
|
+
|
|
568
|
+
@staticmethod
|
|
569
|
+
def getTypeName():
|
|
570
|
+
return "long"
|
|
571
|
+
|
|
572
|
+
helper_code = "LONG" if python_version < 0x300 else "INVALID"
|
|
573
|
+
|
|
574
|
+
add_shapes = add_shapes_long
|
|
575
|
+
sub_shapes = sub_shapes_long
|
|
576
|
+
mult_shapes = mult_shapes_long
|
|
577
|
+
floordiv_shapes = floordiv_shapes_long
|
|
578
|
+
truediv_shapes = truediv_shapes_long
|
|
579
|
+
olddiv_shapes = olddiv_shapes_long
|
|
580
|
+
mod_shapes = mod_shapes_long
|
|
581
|
+
divmod_shapes = divmod_shapes_long
|
|
582
|
+
pow_shapes = pow_shapes_long
|
|
583
|
+
bitor_shapes = bitor_shapes_long
|
|
584
|
+
bitand_shapes = bitand_shapes_long
|
|
585
|
+
bitxor_shapes = bitxor_shapes_long
|
|
586
|
+
lshift_shapes = lshift_shapes_long
|
|
587
|
+
rshift_shapes = rshift_shapes_long
|
|
588
|
+
matmult_shapes = matmult_shapes_long
|
|
589
|
+
|
|
590
|
+
def getComparisonLtShape(self, right_shape):
|
|
591
|
+
if right_shape is tshape_unknown:
|
|
592
|
+
return operation_result_unknown
|
|
593
|
+
|
|
594
|
+
if right_shape in (
|
|
595
|
+
tshape_int,
|
|
596
|
+
tshape_long,
|
|
597
|
+
tshape_int_or_long,
|
|
598
|
+
tshape_bool,
|
|
599
|
+
tshape_float,
|
|
600
|
+
):
|
|
601
|
+
return operation_result_bool_noescape
|
|
602
|
+
|
|
603
|
+
if right_shape in (tshape_long_derived, tshape_int_or_long_derived):
|
|
604
|
+
return operation_result_unknown
|
|
605
|
+
|
|
606
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
607
|
+
|
|
608
|
+
@staticmethod
|
|
609
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
610
|
+
return hasattr(_the_typical_long_value, attribute_name)
|
|
611
|
+
|
|
612
|
+
tshape_long = ShapeTypeLong()
|
|
613
|
+
|
|
614
|
+
class ShapeTypeLongDerived(ShapeTypeUnknown):
|
|
615
|
+
__slots__ = ()
|
|
616
|
+
|
|
617
|
+
@staticmethod
|
|
618
|
+
def getTypeName():
|
|
619
|
+
return None
|
|
620
|
+
|
|
621
|
+
tshape_long_derived = ShapeTypeLongDerived()
|
|
622
|
+
|
|
623
|
+
class ShapeTypeIntOrLong(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
624
|
+
__slots__ = ()
|
|
625
|
+
|
|
626
|
+
if isExperimental("optimize-dual-int"):
|
|
627
|
+
|
|
628
|
+
@staticmethod
|
|
629
|
+
def getCType():
|
|
630
|
+
return CTypeNuitkaIntOrLongStruct
|
|
631
|
+
|
|
632
|
+
@staticmethod
|
|
633
|
+
def emitAlternatives(emit):
|
|
634
|
+
emit(tshape_int)
|
|
635
|
+
emit(tshape_long)
|
|
636
|
+
|
|
637
|
+
add_shapes = add_shapes_intorlong
|
|
638
|
+
sub_shapes = sub_shapes_intorlong
|
|
639
|
+
mult_shapes = mult_shapes_intorlong
|
|
640
|
+
floordiv_shapes = floordiv_shapes_intorlong
|
|
641
|
+
truediv_shapes = truediv_shapes_intorlong
|
|
642
|
+
olddiv_shapes = olddiv_shapes_intorlong
|
|
643
|
+
mod_shapes = mod_shapes_intorlong
|
|
644
|
+
divmod_shapes = divmod_shapes_intorlong
|
|
645
|
+
pow_shapes = pow_shapes_intorlong
|
|
646
|
+
bitor_shapes = bitor_shapes_intorlong
|
|
647
|
+
bitand_shapes = bitand_shapes_intorlong
|
|
648
|
+
bitxor_shapes = bitxor_shapes_intorlong
|
|
649
|
+
lshift_shapes = lshift_shapes_intorlong
|
|
650
|
+
rshift_shapes = rshift_shapes_intorlong
|
|
651
|
+
matmult_shapes = matmult_shapes_intorlong
|
|
652
|
+
|
|
653
|
+
def getComparisonLtShape(self, right_shape):
|
|
654
|
+
if right_shape is tshape_unknown:
|
|
655
|
+
return operation_result_unknown
|
|
656
|
+
|
|
657
|
+
if right_shape in (
|
|
658
|
+
tshape_int,
|
|
659
|
+
tshape_long,
|
|
660
|
+
tshape_int_or_long,
|
|
661
|
+
tshape_bool,
|
|
662
|
+
tshape_float,
|
|
663
|
+
):
|
|
664
|
+
return operation_result_bool_noescape
|
|
665
|
+
|
|
666
|
+
if right_shape is tshape_int_or_long_derived:
|
|
667
|
+
return operation_result_unknown
|
|
668
|
+
|
|
669
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
670
|
+
|
|
671
|
+
@staticmethod
|
|
672
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
673
|
+
return hasattr(7, attribute_name) and hasattr(
|
|
674
|
+
_the_typical_long_value, attribute_name
|
|
675
|
+
)
|
|
676
|
+
|
|
677
|
+
tshape_int_or_long = ShapeTypeIntOrLong()
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
else:
|
|
681
|
+
tshape_long = None
|
|
682
|
+
tshape_long_derived = None
|
|
683
|
+
tshape_int_or_long = tshape_int
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
# TODO: Make this Python2 only, and use ShapeTypeIntDerived for Python3
|
|
687
|
+
class ShapeTypeIntOrLongDerived(ShapeTypeUnknown):
|
|
688
|
+
__slots__ = ()
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
tshape_int_or_long_derived = ShapeTypeIntOrLongDerived()
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
class ShapeTypeFloat(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
695
|
+
__slots__ = ()
|
|
696
|
+
|
|
697
|
+
typical_value = 0.1
|
|
698
|
+
|
|
699
|
+
@staticmethod
|
|
700
|
+
def getTypeName():
|
|
701
|
+
return "float"
|
|
702
|
+
|
|
703
|
+
helper_code = "FLOAT"
|
|
704
|
+
|
|
705
|
+
add_shapes = add_shapes_float
|
|
706
|
+
sub_shapes = sub_shapes_float
|
|
707
|
+
mult_shapes = mult_shapes_float
|
|
708
|
+
floordiv_shapes = floordiv_shapes_float
|
|
709
|
+
truediv_shapes = truediv_shapes_float
|
|
710
|
+
olddiv_shapes = olddiv_shapes_float
|
|
711
|
+
mod_shapes = mod_shapes_float
|
|
712
|
+
divmod_shapes = divmod_shapes_float
|
|
713
|
+
pow_shapes = pow_shapes_float
|
|
714
|
+
bitor_shapes = bitor_shapes_float
|
|
715
|
+
bitand_shapes = bitand_shapes_float
|
|
716
|
+
bitxor_shapes = bitxor_shapes_float
|
|
717
|
+
lshift_shapes = lshift_shapes_float
|
|
718
|
+
rshift_shapes = rshift_shapes_float
|
|
719
|
+
matmult_shapes = matmult_shapes_float
|
|
720
|
+
|
|
721
|
+
def getComparisonLtShape(self, right_shape):
|
|
722
|
+
if right_shape is tshape_unknown:
|
|
723
|
+
return operation_result_unknown
|
|
724
|
+
|
|
725
|
+
if right_shape in (
|
|
726
|
+
tshape_float,
|
|
727
|
+
tshape_long,
|
|
728
|
+
tshape_int,
|
|
729
|
+
tshape_int_or_long,
|
|
730
|
+
tshape_bool,
|
|
731
|
+
):
|
|
732
|
+
return operation_result_bool_noescape
|
|
733
|
+
|
|
734
|
+
if right_shape is tshape_float_derived:
|
|
735
|
+
return operation_result_unknown
|
|
736
|
+
|
|
737
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
tshape_float = ShapeTypeFloat()
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
class ShapeTypeFloatDerived(ShapeTypeUnknown):
|
|
744
|
+
__slots__ = ()
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
tshape_float_derived = ShapeTypeFloatDerived()
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
class ShapeTypeComplex(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
751
|
+
__slots__ = ()
|
|
752
|
+
|
|
753
|
+
typical_value = 0j
|
|
754
|
+
|
|
755
|
+
@staticmethod
|
|
756
|
+
def getTypeName():
|
|
757
|
+
return "complex"
|
|
758
|
+
|
|
759
|
+
add_shapes = add_shapes_complex
|
|
760
|
+
sub_shapes = sub_shapes_complex
|
|
761
|
+
mult_shapes = mult_shapes_complex
|
|
762
|
+
floordiv_shapes = floordiv_shapes_complex
|
|
763
|
+
truediv_shapes = truediv_shapes_complex
|
|
764
|
+
olddiv_shapes = olddiv_shapes_complex
|
|
765
|
+
mod_shapes = mod_shapes_complex
|
|
766
|
+
divmod_shapes = divmod_shapes_complex
|
|
767
|
+
pow_shapes = pow_shapes_complex
|
|
768
|
+
bitor_shapes = bitor_shapes_complex
|
|
769
|
+
bitand_shapes = bitand_shapes_complex
|
|
770
|
+
bitxor_shapes = bitxor_shapes_complex
|
|
771
|
+
lshift_shapes = lshift_shapes_complex
|
|
772
|
+
rshift_shapes = rshift_shapes_complex
|
|
773
|
+
matmult_shapes = matmult_shapes_complex
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
tshape_complex = ShapeTypeComplex()
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
class ShapeTypeTuple(ShapeContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
780
|
+
__slots__ = ()
|
|
781
|
+
|
|
782
|
+
typical_value = ()
|
|
783
|
+
|
|
784
|
+
@staticmethod
|
|
785
|
+
def getTypeName():
|
|
786
|
+
return "tuple"
|
|
787
|
+
|
|
788
|
+
helper_code = "TUPLE"
|
|
789
|
+
|
|
790
|
+
@staticmethod
|
|
791
|
+
def getShapeIter():
|
|
792
|
+
return tshape_tuple_iterator
|
|
793
|
+
|
|
794
|
+
@staticmethod
|
|
795
|
+
def hasShapeIndexLookup():
|
|
796
|
+
return True
|
|
797
|
+
|
|
798
|
+
add_shapes = add_shapes_tuple
|
|
799
|
+
sub_shapes = sub_shapes_tuple
|
|
800
|
+
mult_shapes = mult_shapes_tuple
|
|
801
|
+
floordiv_shapes = floordiv_shapes_tuple
|
|
802
|
+
truediv_shapes = truediv_shapes_tuple
|
|
803
|
+
olddiv_shapes = olddiv_shapes_tuple
|
|
804
|
+
mod_shapes = mod_shapes_tuple
|
|
805
|
+
divmod_shapes = divmod_shapes_tuple
|
|
806
|
+
pow_shapes = pow_shapes_tuple
|
|
807
|
+
bitor_shapes = bitor_shapes_tuple
|
|
808
|
+
bitand_shapes = bitand_shapes_tuple
|
|
809
|
+
bitxor_shapes = bitxor_shapes_tuple
|
|
810
|
+
lshift_shapes = lshift_shapes_tuple
|
|
811
|
+
rshift_shapes = rshift_shapes_tuple
|
|
812
|
+
matmult_shapes = matmult_shapes_tuple
|
|
813
|
+
|
|
814
|
+
def getComparisonLtShape(self, right_shape):
|
|
815
|
+
# Need to consider value shape for this.
|
|
816
|
+
return operation_result_unknown
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
tshape_tuple = ShapeTypeTuple()
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
class ShapeTypeNamedTuple(ShapeContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
823
|
+
__slots__ = ()
|
|
824
|
+
|
|
825
|
+
@staticmethod
|
|
826
|
+
def getTypeName():
|
|
827
|
+
return "namedtuple"
|
|
828
|
+
|
|
829
|
+
helper_code = "NAMEDTUPLE"
|
|
830
|
+
|
|
831
|
+
@staticmethod
|
|
832
|
+
def getShapeIter():
|
|
833
|
+
return tshape_tuple_iterator
|
|
834
|
+
|
|
835
|
+
@staticmethod
|
|
836
|
+
def hasShapeIndexLookup():
|
|
837
|
+
return True
|
|
838
|
+
|
|
839
|
+
# TODO: Unsupported operation would be different, account for that.
|
|
840
|
+
add_shapes = add_shapes_tuple
|
|
841
|
+
sub_shapes = sub_shapes_tuple
|
|
842
|
+
mult_shapes = mult_shapes_tuple
|
|
843
|
+
floordiv_shapes = floordiv_shapes_tuple
|
|
844
|
+
truediv_shapes = truediv_shapes_tuple
|
|
845
|
+
olddiv_shapes = olddiv_shapes_tuple
|
|
846
|
+
mod_shapes = mod_shapes_tuple
|
|
847
|
+
divmod_shapes = divmod_shapes_tuple
|
|
848
|
+
pow_shapes = pow_shapes_tuple
|
|
849
|
+
bitor_shapes = bitor_shapes_tuple
|
|
850
|
+
bitand_shapes = bitand_shapes_tuple
|
|
851
|
+
bitxor_shapes = bitxor_shapes_tuple
|
|
852
|
+
lshift_shapes = lshift_shapes_tuple
|
|
853
|
+
rshift_shapes = rshift_shapes_tuple
|
|
854
|
+
matmult_shapes = matmult_shapes_tuple
|
|
855
|
+
|
|
856
|
+
def getComparisonLtShape(self, right_shape):
|
|
857
|
+
# Need to consider value shape for this.
|
|
858
|
+
return operation_result_unknown
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
tshape_namedtuple = ShapeTypeNamedTuple()
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
class ShapeTypeTupleIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
865
|
+
__slots__ = ()
|
|
866
|
+
|
|
867
|
+
typical_value = iter(tshape_tuple.typical_value)
|
|
868
|
+
|
|
869
|
+
@staticmethod
|
|
870
|
+
def getTypeName():
|
|
871
|
+
return "tupleiterator" if python_version < 0x300 else "tuple_iterator"
|
|
872
|
+
|
|
873
|
+
@staticmethod
|
|
874
|
+
def getIteratedShape():
|
|
875
|
+
return tshape_tuple
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
tshape_tuple_iterator = ShapeTypeTupleIterator()
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
class ShapeTypeList(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):
|
|
882
|
+
__slots__ = ()
|
|
883
|
+
|
|
884
|
+
typical_value = []
|
|
885
|
+
|
|
886
|
+
@staticmethod
|
|
887
|
+
def getTypeName():
|
|
888
|
+
return "list"
|
|
889
|
+
|
|
890
|
+
helper_code = "LIST"
|
|
891
|
+
|
|
892
|
+
@staticmethod
|
|
893
|
+
def getShapeIter():
|
|
894
|
+
return tshape_list_iterator
|
|
895
|
+
|
|
896
|
+
@staticmethod
|
|
897
|
+
def hasShapeIndexLookup():
|
|
898
|
+
return True
|
|
899
|
+
|
|
900
|
+
add_shapes = add_shapes_list
|
|
901
|
+
sub_shapes = sub_shapes_list
|
|
902
|
+
mult_shapes = mult_shapes_list
|
|
903
|
+
floordiv_shapes = floordiv_shapes_list
|
|
904
|
+
truediv_shapes = truediv_shapes_list
|
|
905
|
+
olddiv_shapes = olddiv_shapes_list
|
|
906
|
+
mod_shapes = mod_shapes_list
|
|
907
|
+
divmod_shapes = divmod_shapes_list
|
|
908
|
+
pow_shapes = pow_shapes_list
|
|
909
|
+
bitor_shapes = bitor_shapes_list
|
|
910
|
+
bitand_shapes = bitand_shapes_list
|
|
911
|
+
bitxor_shapes = bitxor_shapes_list
|
|
912
|
+
lshift_shapes = lshift_shapes_list
|
|
913
|
+
rshift_shapes = rshift_shapes_list
|
|
914
|
+
matmult_shapes = matmult_shapes_list
|
|
915
|
+
|
|
916
|
+
iadd_shapes = iadd_shapes_list
|
|
917
|
+
|
|
918
|
+
def getComparisonLtShape(self, right_shape):
|
|
919
|
+
if right_shape is tshape_unknown:
|
|
920
|
+
return operation_result_unknown
|
|
921
|
+
|
|
922
|
+
# Need to consider value shape for this.
|
|
923
|
+
if right_shape in (tshape_list, tshape_tuple):
|
|
924
|
+
return operation_result_bool_element_based
|
|
925
|
+
|
|
926
|
+
if right_shape is tshape_xrange:
|
|
927
|
+
if python_version < 0x300:
|
|
928
|
+
return operation_result_bool_element_based
|
|
929
|
+
else:
|
|
930
|
+
# TODO: Actually unorderable, but this requires making a
|
|
931
|
+
# difference with "=="
|
|
932
|
+
return operation_result_unknown
|
|
933
|
+
|
|
934
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
tshape_list = ShapeTypeList()
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
class ShapeTypeListIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
941
|
+
__slots__ = ()
|
|
942
|
+
|
|
943
|
+
typical_value = iter(tshape_list.typical_value)
|
|
944
|
+
|
|
945
|
+
@staticmethod
|
|
946
|
+
def getTypeName():
|
|
947
|
+
return "listiterator" if python_version < 0x300 else "list_iterator"
|
|
948
|
+
|
|
949
|
+
@staticmethod
|
|
950
|
+
def hasShapeIndexLookup():
|
|
951
|
+
return False
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
tshape_list_iterator = ShapeTypeListIterator()
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
class ShapeTypeSet(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):
|
|
958
|
+
__slots__ = ()
|
|
959
|
+
|
|
960
|
+
typical_value = set()
|
|
961
|
+
|
|
962
|
+
@staticmethod
|
|
963
|
+
def getTypeName():
|
|
964
|
+
return "set"
|
|
965
|
+
|
|
966
|
+
@staticmethod
|
|
967
|
+
def getShapeIter():
|
|
968
|
+
return tshape_set_iterator
|
|
969
|
+
|
|
970
|
+
@staticmethod
|
|
971
|
+
def hasShapeIndexLookup():
|
|
972
|
+
return False
|
|
973
|
+
|
|
974
|
+
add_shapes = add_shapes_set
|
|
975
|
+
sub_shapes = sub_shapes_set
|
|
976
|
+
mult_shapes = mult_shapes_set
|
|
977
|
+
floordiv_shapes = floordiv_shapes_set
|
|
978
|
+
truediv_shapes = truediv_shapes_set
|
|
979
|
+
olddiv_shapes = olddiv_shapes_set
|
|
980
|
+
mod_shapes = mod_shapes_set
|
|
981
|
+
divmod_shapes = divmod_shapes_set
|
|
982
|
+
pow_shapes = pow_shapes_set
|
|
983
|
+
bitor_shapes = bitor_shapes_set
|
|
984
|
+
bitand_shapes = bitand_shapes_set
|
|
985
|
+
bitxor_shapes = bitxor_shapes_set
|
|
986
|
+
lshift_shapes = lshift_shapes_set
|
|
987
|
+
rshift_shapes = rshift_shapes_set
|
|
988
|
+
matmult_shapes = matmult_shapes_set
|
|
989
|
+
|
|
990
|
+
def getComparisonLtShape(self, right_shape):
|
|
991
|
+
# Need to consider value shape for this.
|
|
992
|
+
return operation_result_unknown
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
tshape_set = ShapeTypeSet()
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
class ShapeTypeSetIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
999
|
+
__slots__ = ()
|
|
1000
|
+
|
|
1001
|
+
typical_value = iter(tshape_set.typical_value)
|
|
1002
|
+
|
|
1003
|
+
@staticmethod
|
|
1004
|
+
def getTypeName():
|
|
1005
|
+
return "setiterator" if python_version < 0x300 else "set_iterator"
|
|
1006
|
+
|
|
1007
|
+
@staticmethod
|
|
1008
|
+
def hasShapeIndexLookup():
|
|
1009
|
+
return False
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
tshape_set_iterator = ShapeTypeSetIterator()
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
class ShapeTypeFrozenset(ShapeContainerImmutableMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1016
|
+
__slots__ = ()
|
|
1017
|
+
|
|
1018
|
+
typical_value = frozenset()
|
|
1019
|
+
|
|
1020
|
+
@staticmethod
|
|
1021
|
+
def getTypeName():
|
|
1022
|
+
return "frozenset"
|
|
1023
|
+
|
|
1024
|
+
@staticmethod
|
|
1025
|
+
def getShapeIter():
|
|
1026
|
+
return tshape_set_iterator
|
|
1027
|
+
|
|
1028
|
+
@staticmethod
|
|
1029
|
+
def hasShapeIndexLookup():
|
|
1030
|
+
return False
|
|
1031
|
+
|
|
1032
|
+
add_shapes = add_shapes_frozenset
|
|
1033
|
+
sub_shapes = sub_shapes_frozenset
|
|
1034
|
+
mult_shapes = mult_shapes_frozenset
|
|
1035
|
+
floordiv_shapes = floordiv_shapes_frozenset
|
|
1036
|
+
truediv_shapes = truediv_shapes_frozenset
|
|
1037
|
+
olddiv_shapes = olddiv_shapes_frozenset
|
|
1038
|
+
mod_shapes = mod_shapes_frozenset
|
|
1039
|
+
divmod_shapes = divmod_shapes_frozenset
|
|
1040
|
+
pow_shapes = pow_shapes_frozenset
|
|
1041
|
+
bitor_shapes = bitor_shapes_frozenset
|
|
1042
|
+
bitand_shapes = bitand_shapes_frozenset
|
|
1043
|
+
bitxor_shapes = bitxor_shapes_frozenset
|
|
1044
|
+
lshift_shapes = lshift_shapes_frozenset
|
|
1045
|
+
rshift_shapes = rshift_shapes_frozenset
|
|
1046
|
+
matmult_shapes = matmult_shapes_frozenset
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
tshape_frozenset = ShapeTypeFrozenset()
|
|
1050
|
+
|
|
1051
|
+
_the_empty_dict = {}
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
class ShapeTypeDict(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1055
|
+
__slots__ = ()
|
|
1056
|
+
|
|
1057
|
+
typical_value = _the_empty_dict
|
|
1058
|
+
|
|
1059
|
+
@staticmethod
|
|
1060
|
+
def getTypeName():
|
|
1061
|
+
return "dict"
|
|
1062
|
+
|
|
1063
|
+
@staticmethod
|
|
1064
|
+
def getShapeIter():
|
|
1065
|
+
return tshape_dict_iterator
|
|
1066
|
+
|
|
1067
|
+
@staticmethod
|
|
1068
|
+
def hasShapeIndexLookup():
|
|
1069
|
+
return False
|
|
1070
|
+
|
|
1071
|
+
add_shapes = add_shapes_dict
|
|
1072
|
+
sub_shapes = sub_shapes_dict
|
|
1073
|
+
mult_shapes = mult_shapes_dict
|
|
1074
|
+
floordiv_shapes = floordiv_shapes_dict
|
|
1075
|
+
truediv_shapes = truediv_shapes_dict
|
|
1076
|
+
olddiv_shapes = olddiv_shapes_dict
|
|
1077
|
+
mod_shapes = mod_shapes_dict
|
|
1078
|
+
divmod_shapes = divmod_shapes_dict
|
|
1079
|
+
pow_shapes = pow_shapes_dict
|
|
1080
|
+
bitor_shapes = bitor_shapes_dict
|
|
1081
|
+
bitand_shapes = bitand_shapes_dict
|
|
1082
|
+
bitxor_shapes = bitxor_shapes_dict
|
|
1083
|
+
lshift_shapes = lshift_shapes_dict
|
|
1084
|
+
rshift_shapes = rshift_shapes_dict
|
|
1085
|
+
matmult_shapes = matmult_shapes_dict
|
|
1086
|
+
|
|
1087
|
+
ibitor_shapes = ibitor_shapes_dict
|
|
1088
|
+
|
|
1089
|
+
def getComparisonLtShape(self, right_shape):
|
|
1090
|
+
# Need to consider value shape for this
|
|
1091
|
+
|
|
1092
|
+
# TODO: Could return bool with annotation that exception is still
|
|
1093
|
+
# possible..
|
|
1094
|
+
return operation_result_unknown
|
|
1095
|
+
|
|
1096
|
+
@staticmethod
|
|
1097
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1098
|
+
return hasattr(_the_empty_dict, attribute_name)
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
tshape_dict = ShapeTypeDict()
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
class ShapeTypeDictIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1105
|
+
__slots__ = ()
|
|
1106
|
+
|
|
1107
|
+
typical_value = iter(tshape_dict.typical_value)
|
|
1108
|
+
|
|
1109
|
+
@staticmethod
|
|
1110
|
+
def getTypeName():
|
|
1111
|
+
return (
|
|
1112
|
+
"dictionary-keyiterator" if python_version < 0x300 else "dictkey_iterator"
|
|
1113
|
+
)
|
|
1114
|
+
|
|
1115
|
+
@staticmethod
|
|
1116
|
+
def hasShapeIndexLookup():
|
|
1117
|
+
return False
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
tshape_dict_iterator = ShapeTypeDictIterator()
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
class ShapeTypeStr(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1124
|
+
__slots__ = ()
|
|
1125
|
+
|
|
1126
|
+
typical_value = "a"
|
|
1127
|
+
|
|
1128
|
+
@staticmethod
|
|
1129
|
+
def getTypeName():
|
|
1130
|
+
return "str"
|
|
1131
|
+
|
|
1132
|
+
helper_code = "STR" if python_version < 0x300 else "UNICODE"
|
|
1133
|
+
|
|
1134
|
+
# Not a container, but has these.
|
|
1135
|
+
@staticmethod
|
|
1136
|
+
def hasShapeSlotIter():
|
|
1137
|
+
return True
|
|
1138
|
+
|
|
1139
|
+
@staticmethod
|
|
1140
|
+
def hasShapeSlotLen():
|
|
1141
|
+
return True
|
|
1142
|
+
|
|
1143
|
+
@staticmethod
|
|
1144
|
+
def hasShapeSlotContains():
|
|
1145
|
+
return True
|
|
1146
|
+
|
|
1147
|
+
# Not a number, but has these.
|
|
1148
|
+
@staticmethod
|
|
1149
|
+
def hasShapeSlotInt():
|
|
1150
|
+
return True
|
|
1151
|
+
|
|
1152
|
+
@staticmethod
|
|
1153
|
+
def hasShapeSlotLong():
|
|
1154
|
+
return True
|
|
1155
|
+
|
|
1156
|
+
@staticmethod
|
|
1157
|
+
def hasShapeSlotFloat():
|
|
1158
|
+
return True
|
|
1159
|
+
|
|
1160
|
+
@staticmethod
|
|
1161
|
+
def hasShapeSlotComplex():
|
|
1162
|
+
return True
|
|
1163
|
+
|
|
1164
|
+
@staticmethod
|
|
1165
|
+
def hasShapeSlotHash():
|
|
1166
|
+
return True
|
|
1167
|
+
|
|
1168
|
+
@staticmethod
|
|
1169
|
+
def getShapeIter():
|
|
1170
|
+
return tshape_str_iterator
|
|
1171
|
+
|
|
1172
|
+
@staticmethod
|
|
1173
|
+
def hasShapeIndexLookup():
|
|
1174
|
+
return True
|
|
1175
|
+
|
|
1176
|
+
@staticmethod
|
|
1177
|
+
def hasShapeTrustedAttributes():
|
|
1178
|
+
return True
|
|
1179
|
+
|
|
1180
|
+
add_shapes = add_shapes_str
|
|
1181
|
+
sub_shapes = sub_shapes_str
|
|
1182
|
+
mult_shapes = mult_shapes_str
|
|
1183
|
+
floordiv_shapes = floordiv_shapes_str
|
|
1184
|
+
truediv_shapes = truediv_shapes_str
|
|
1185
|
+
olddiv_shapes = olddiv_shapes_str
|
|
1186
|
+
mod_shapes = mod_shapes_str
|
|
1187
|
+
divmod_shapes = divmod_shapes_str
|
|
1188
|
+
pow_shapes = pow_shapes_str
|
|
1189
|
+
bitor_shapes = bitor_shapes_str
|
|
1190
|
+
bitand_shapes = bitand_shapes_str
|
|
1191
|
+
bitxor_shapes = bitxor_shapes_str
|
|
1192
|
+
lshift_shapes = lshift_shapes_str
|
|
1193
|
+
rshift_shapes = rshift_shapes_str
|
|
1194
|
+
matmult_shapes = matmult_shapes_str
|
|
1195
|
+
|
|
1196
|
+
def getComparisonLtShape(self, right_shape):
|
|
1197
|
+
if right_shape is tshape_unknown:
|
|
1198
|
+
return operation_result_unknown
|
|
1199
|
+
|
|
1200
|
+
if right_shape is tshape_str:
|
|
1201
|
+
return operation_result_bool_noescape
|
|
1202
|
+
|
|
1203
|
+
if right_shape is tshape_str_derived:
|
|
1204
|
+
return operation_result_unknown
|
|
1205
|
+
|
|
1206
|
+
if right_shape is tshape_bytearray:
|
|
1207
|
+
if python_version < 0x300:
|
|
1208
|
+
return operation_result_bool_noescape
|
|
1209
|
+
else:
|
|
1210
|
+
return operation_result_unknown
|
|
1211
|
+
|
|
1212
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
1213
|
+
|
|
1214
|
+
@staticmethod
|
|
1215
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1216
|
+
return hasattr("a", attribute_name)
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
tshape_str = ShapeTypeStr()
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
class TypeShapeStrDerived(ShapeTypeUnknown):
|
|
1223
|
+
__slots__ = ()
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
tshape_str_derived = TypeShapeStrDerived()
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
class ShapeTypeStrIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1230
|
+
__slots__ = ()
|
|
1231
|
+
|
|
1232
|
+
typical_value = iter(tshape_str.typical_value)
|
|
1233
|
+
|
|
1234
|
+
@staticmethod
|
|
1235
|
+
def getTypeName():
|
|
1236
|
+
return "iterator" if python_version < 0x300 else "str_iterator"
|
|
1237
|
+
|
|
1238
|
+
@staticmethod
|
|
1239
|
+
def hasShapeIndexLookup():
|
|
1240
|
+
return False
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
tshape_str_iterator = ShapeTypeStrIterator()
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
if python_version < 0x300:
|
|
1247
|
+
|
|
1248
|
+
class ShapeTypeUnicode(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1249
|
+
__slots__ = ()
|
|
1250
|
+
|
|
1251
|
+
typical_value = the_empty_unicode
|
|
1252
|
+
|
|
1253
|
+
@staticmethod
|
|
1254
|
+
def getTypeName():
|
|
1255
|
+
return "unicode"
|
|
1256
|
+
|
|
1257
|
+
helper_code = "UNICODE"
|
|
1258
|
+
|
|
1259
|
+
# Not a container, but has these.
|
|
1260
|
+
@staticmethod
|
|
1261
|
+
def hasShapeSlotIter():
|
|
1262
|
+
return True
|
|
1263
|
+
|
|
1264
|
+
@staticmethod
|
|
1265
|
+
def hasShapeSlotLen():
|
|
1266
|
+
return True
|
|
1267
|
+
|
|
1268
|
+
@staticmethod
|
|
1269
|
+
def hasShapeSlotContains():
|
|
1270
|
+
return True
|
|
1271
|
+
|
|
1272
|
+
# Not a number, but has these.
|
|
1273
|
+
@staticmethod
|
|
1274
|
+
def hasShapeSlotInt():
|
|
1275
|
+
return True
|
|
1276
|
+
|
|
1277
|
+
@staticmethod
|
|
1278
|
+
def hasShapeSlotLong():
|
|
1279
|
+
return True
|
|
1280
|
+
|
|
1281
|
+
@staticmethod
|
|
1282
|
+
def hasShapeSlotFloat():
|
|
1283
|
+
return True
|
|
1284
|
+
|
|
1285
|
+
@staticmethod
|
|
1286
|
+
def hasShapeSlotComplex():
|
|
1287
|
+
return True
|
|
1288
|
+
|
|
1289
|
+
@staticmethod
|
|
1290
|
+
def hasShapeSlotHash():
|
|
1291
|
+
return True
|
|
1292
|
+
|
|
1293
|
+
@staticmethod
|
|
1294
|
+
def getShapeIter():
|
|
1295
|
+
return tshape_unicode_iterator
|
|
1296
|
+
|
|
1297
|
+
@staticmethod
|
|
1298
|
+
def hasShapeIndexLookup():
|
|
1299
|
+
return True
|
|
1300
|
+
|
|
1301
|
+
@staticmethod
|
|
1302
|
+
def hasShapeTrustedAttributes():
|
|
1303
|
+
return True
|
|
1304
|
+
|
|
1305
|
+
add_shapes = add_shapes_unicode
|
|
1306
|
+
sub_shapes = sub_shapes_unicode
|
|
1307
|
+
mult_shapes = mult_shapes_unicode
|
|
1308
|
+
floordiv_shapes = floordiv_shapes_unicode
|
|
1309
|
+
truediv_shapes = truediv_shapes_unicode
|
|
1310
|
+
olddiv_shapes = olddiv_shapes_unicode
|
|
1311
|
+
mod_shapes = mod_shapes_unicode
|
|
1312
|
+
divmod_shapes = divmod_shapes_unicode
|
|
1313
|
+
pow_shapes = pow_shapes_unicode
|
|
1314
|
+
bitor_shapes = bitor_shapes_unicode
|
|
1315
|
+
bitand_shapes = bitand_shapes_unicode
|
|
1316
|
+
bitxor_shapes = bitxor_shapes_unicode
|
|
1317
|
+
lshift_shapes = lshift_shapes_unicode
|
|
1318
|
+
rshift_shapes = rshift_shapes_unicode
|
|
1319
|
+
matmult_shapes = matmult_shapes_unicode
|
|
1320
|
+
|
|
1321
|
+
def getComparisonLtShape(self, right_shape):
|
|
1322
|
+
if right_shape is tshape_unknown:
|
|
1323
|
+
return operation_result_unknown
|
|
1324
|
+
|
|
1325
|
+
if right_shape is tshape_unicode:
|
|
1326
|
+
return operation_result_bool_noescape
|
|
1327
|
+
|
|
1328
|
+
if right_shape is tshape_unicode_derived:
|
|
1329
|
+
return operation_result_unknown
|
|
1330
|
+
|
|
1331
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
1332
|
+
|
|
1333
|
+
@staticmethod
|
|
1334
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1335
|
+
return hasattr(the_empty_unicode, attribute_name)
|
|
1336
|
+
|
|
1337
|
+
tshape_unicode = ShapeTypeUnicode()
|
|
1338
|
+
|
|
1339
|
+
class ShapeTypeUnicodeDerived(ShapeTypeUnknown):
|
|
1340
|
+
__slots__ = ()
|
|
1341
|
+
|
|
1342
|
+
tshape_unicode_derived = ShapeTypeUnicodeDerived()
|
|
1343
|
+
|
|
1344
|
+
class ShapeTypeUnicodeIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1345
|
+
__slots__ = ()
|
|
1346
|
+
|
|
1347
|
+
typical_value = iter(tshape_unicode.typical_value)
|
|
1348
|
+
|
|
1349
|
+
@staticmethod
|
|
1350
|
+
def getTypeName():
|
|
1351
|
+
return "iterator"
|
|
1352
|
+
|
|
1353
|
+
@staticmethod
|
|
1354
|
+
def hasShapeIndexLookup():
|
|
1355
|
+
return False
|
|
1356
|
+
|
|
1357
|
+
tshape_unicode_iterator = ShapeTypeUnicodeIterator()
|
|
1358
|
+
else:
|
|
1359
|
+
tshape_unicode = tshape_str
|
|
1360
|
+
tshape_unicode_iterator = tshape_str_iterator
|
|
1361
|
+
tshape_unicode_derived = tshape_str_derived
|
|
1362
|
+
|
|
1363
|
+
|
|
1364
|
+
if python_version < 0x300:
|
|
1365
|
+
|
|
1366
|
+
class ShapeTypeStrOrUnicode(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1367
|
+
__slots__ = ()
|
|
1368
|
+
|
|
1369
|
+
@staticmethod
|
|
1370
|
+
def emitAlternatives(emit):
|
|
1371
|
+
emit(tshape_str)
|
|
1372
|
+
emit(tshape_unicode)
|
|
1373
|
+
|
|
1374
|
+
@staticmethod
|
|
1375
|
+
def hasShapeSlotIter():
|
|
1376
|
+
return True
|
|
1377
|
+
|
|
1378
|
+
@staticmethod
|
|
1379
|
+
def hasShapeSlotLen():
|
|
1380
|
+
return True
|
|
1381
|
+
|
|
1382
|
+
@staticmethod
|
|
1383
|
+
def hasShapeSlotContains():
|
|
1384
|
+
return True
|
|
1385
|
+
|
|
1386
|
+
@staticmethod
|
|
1387
|
+
def hasShapeSlotInt():
|
|
1388
|
+
return True
|
|
1389
|
+
|
|
1390
|
+
@staticmethod
|
|
1391
|
+
def hasShapeSlotLong():
|
|
1392
|
+
return True
|
|
1393
|
+
|
|
1394
|
+
@staticmethod
|
|
1395
|
+
def hasShapeSlotFloat():
|
|
1396
|
+
return True
|
|
1397
|
+
|
|
1398
|
+
@staticmethod
|
|
1399
|
+
def hasShapeSlotComplex():
|
|
1400
|
+
return True
|
|
1401
|
+
|
|
1402
|
+
@staticmethod
|
|
1403
|
+
def hasShapeSlotHash():
|
|
1404
|
+
return True
|
|
1405
|
+
|
|
1406
|
+
@staticmethod
|
|
1407
|
+
def hasShapeIndexLookup():
|
|
1408
|
+
return True
|
|
1409
|
+
|
|
1410
|
+
@staticmethod
|
|
1411
|
+
def hasShapeTrustedAttributes():
|
|
1412
|
+
return True
|
|
1413
|
+
|
|
1414
|
+
# TODO: There seem to be missing a few here.
|
|
1415
|
+
add_shapes = add_shapes_strorunicode
|
|
1416
|
+
sub_shapes = sub_shapes_strorunicode
|
|
1417
|
+
mult_shapes = mult_shapes_strorunicode
|
|
1418
|
+
bitor_shapes = bitor_shapes_strorunicode
|
|
1419
|
+
bitand_shapes = bitand_shapes_strorunicode
|
|
1420
|
+
bitxor_shapes = bitxor_shapes_strorunicode
|
|
1421
|
+
lshift_shapes = lshift_shapes_strorunicode
|
|
1422
|
+
rshift_shapes = rshift_shapes_strorunicode
|
|
1423
|
+
matmult_shapes = matmult_shapes_strorunicode
|
|
1424
|
+
|
|
1425
|
+
@staticmethod
|
|
1426
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1427
|
+
return hasattr("a", attribute_name) and hasattr(
|
|
1428
|
+
the_empty_unicode, attribute_name
|
|
1429
|
+
)
|
|
1430
|
+
|
|
1431
|
+
tshape_str_or_unicode = ShapeTypeStrOrUnicode()
|
|
1432
|
+
|
|
1433
|
+
class ShapeTypeStrOrUnicodeDerived(ShapeTypeUnknown):
|
|
1434
|
+
__slots__ = ()
|
|
1435
|
+
|
|
1436
|
+
tshape_str_or_unicode_derived = ShapeTypeStrOrUnicodeDerived()
|
|
1437
|
+
|
|
1438
|
+
else:
|
|
1439
|
+
tshape_str_or_unicode = tshape_str
|
|
1440
|
+
tshape_str_or_unicode_derived = tshape_str_derived
|
|
1441
|
+
|
|
1442
|
+
if python_version >= 0x300:
|
|
1443
|
+
|
|
1444
|
+
class ShapeTypeBytes(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1445
|
+
__slots__ = ()
|
|
1446
|
+
|
|
1447
|
+
typical_value = b"b"
|
|
1448
|
+
|
|
1449
|
+
@staticmethod
|
|
1450
|
+
def getTypeName():
|
|
1451
|
+
return "bytes"
|
|
1452
|
+
|
|
1453
|
+
helper_code = "BYTES"
|
|
1454
|
+
|
|
1455
|
+
# Not a container, but has these.
|
|
1456
|
+
@staticmethod
|
|
1457
|
+
def hasShapeSlotIter():
|
|
1458
|
+
return True
|
|
1459
|
+
|
|
1460
|
+
@staticmethod
|
|
1461
|
+
def hasShapeSlotLen():
|
|
1462
|
+
return True
|
|
1463
|
+
|
|
1464
|
+
@staticmethod
|
|
1465
|
+
def hasShapeSlotContains():
|
|
1466
|
+
return True
|
|
1467
|
+
|
|
1468
|
+
# Not a number, but has these.
|
|
1469
|
+
@staticmethod
|
|
1470
|
+
def hasShapeSlotInt():
|
|
1471
|
+
return True
|
|
1472
|
+
|
|
1473
|
+
@staticmethod
|
|
1474
|
+
def hasShapeSlotLong():
|
|
1475
|
+
return True
|
|
1476
|
+
|
|
1477
|
+
@staticmethod
|
|
1478
|
+
def hasShapeSlotFloat():
|
|
1479
|
+
return True
|
|
1480
|
+
|
|
1481
|
+
@staticmethod
|
|
1482
|
+
def hasShapeSlotHash():
|
|
1483
|
+
return True
|
|
1484
|
+
|
|
1485
|
+
@staticmethod
|
|
1486
|
+
def getShapeIter():
|
|
1487
|
+
return tshape_bytes_iterator
|
|
1488
|
+
|
|
1489
|
+
@staticmethod
|
|
1490
|
+
def hasShapeIndexLookup():
|
|
1491
|
+
return True
|
|
1492
|
+
|
|
1493
|
+
@staticmethod
|
|
1494
|
+
def hasShapeTrustedAttributes():
|
|
1495
|
+
return True
|
|
1496
|
+
|
|
1497
|
+
add_shapes = add_shapes_bytes
|
|
1498
|
+
sub_shapes = sub_shapes_bytes
|
|
1499
|
+
mult_shapes = mult_shapes_bytes
|
|
1500
|
+
floordiv_shapes = floordiv_shapes_bytes
|
|
1501
|
+
truediv_shapes = truediv_shapes_bytes
|
|
1502
|
+
olddiv_shapes = olddiv_shapes_bytes
|
|
1503
|
+
mod_shapes = mod_shapes_bytes
|
|
1504
|
+
divmod_shapes = divmod_shapes_bytes
|
|
1505
|
+
pow_shapes = pow_shapes_bytes
|
|
1506
|
+
bitor_shapes = bitor_shapes_bytes
|
|
1507
|
+
bitand_shapes = bitand_shapes_bytes
|
|
1508
|
+
bitxor_shapes = bitxor_shapes_bytes
|
|
1509
|
+
lshift_shapes = lshift_shapes_bytes
|
|
1510
|
+
rshift_shapes = rshift_shapes_bytes
|
|
1511
|
+
matmult_shapes = matmult_shapes_bytes
|
|
1512
|
+
|
|
1513
|
+
def getComparisonLtShape(self, right_shape):
|
|
1514
|
+
if right_shape is tshape_unknown:
|
|
1515
|
+
return operation_result_unknown
|
|
1516
|
+
|
|
1517
|
+
if right_shape is tshape_bytes:
|
|
1518
|
+
return operation_result_bool_noescape
|
|
1519
|
+
|
|
1520
|
+
if right_shape is tshape_bytes_derived:
|
|
1521
|
+
return operation_result_unknown
|
|
1522
|
+
|
|
1523
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
1524
|
+
|
|
1525
|
+
@staticmethod
|
|
1526
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1527
|
+
return hasattr(b"b", attribute_name)
|
|
1528
|
+
|
|
1529
|
+
tshape_bytes = ShapeTypeBytes()
|
|
1530
|
+
|
|
1531
|
+
class TypeShapeBytesDerived(ShapeTypeUnknown):
|
|
1532
|
+
__slots__ = ()
|
|
1533
|
+
|
|
1534
|
+
tshape_bytes_derived = TypeShapeBytesDerived()
|
|
1535
|
+
|
|
1536
|
+
class TypeShapeBytesIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1537
|
+
__slots__ = ()
|
|
1538
|
+
typical_value = iter(tshape_bytes.typical_value)
|
|
1539
|
+
|
|
1540
|
+
@staticmethod
|
|
1541
|
+
def getTypeName():
|
|
1542
|
+
return "bytes_iterator"
|
|
1543
|
+
|
|
1544
|
+
tshape_bytes_iterator = TypeShapeBytesIterator()
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
else:
|
|
1548
|
+
# Shouldn't happen with Python2
|
|
1549
|
+
tshape_bytes = None
|
|
1550
|
+
tshape_bytes_iterator = None
|
|
1551
|
+
tshape_bytes_derived = None
|
|
1552
|
+
|
|
1553
|
+
_the_typical_bytearray_value = bytearray(b"b")
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
class ShapeTypeBytearray(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1557
|
+
__slots__ = ()
|
|
1558
|
+
|
|
1559
|
+
typical_value = _the_typical_bytearray_value
|
|
1560
|
+
|
|
1561
|
+
@staticmethod
|
|
1562
|
+
def getTypeName():
|
|
1563
|
+
return "bytearray"
|
|
1564
|
+
|
|
1565
|
+
@staticmethod
|
|
1566
|
+
def getShapeIter():
|
|
1567
|
+
return tshape_bytearray_iterator
|
|
1568
|
+
|
|
1569
|
+
@staticmethod
|
|
1570
|
+
def hasShapeIndexLookup():
|
|
1571
|
+
return True
|
|
1572
|
+
|
|
1573
|
+
add_shapes = add_shapes_bytearray
|
|
1574
|
+
sub_shapes = sub_shapes_bytearray
|
|
1575
|
+
mult_shapes = mult_shapes_bytearray
|
|
1576
|
+
floordiv_shapes = floordiv_shapes_bytearray
|
|
1577
|
+
truediv_shapes = truediv_shapes_bytearray
|
|
1578
|
+
olddiv_shapes = olddiv_shapes_bytearray
|
|
1579
|
+
mod_shapes = mod_shapes_bytearray
|
|
1580
|
+
divmod_shapes = divmod_shapes_bytearray
|
|
1581
|
+
pow_shapes = pow_shapes_bytearray
|
|
1582
|
+
bitor_shapes = bitor_shapes_bytearray
|
|
1583
|
+
bitand_shapes = bitand_shapes_bytearray
|
|
1584
|
+
bitxor_shapes = bitxor_shapes_bytearray
|
|
1585
|
+
lshift_shapes = lshift_shapes_bytearray
|
|
1586
|
+
rshift_shapes = rshift_shapes_bytearray
|
|
1587
|
+
matmult_shapes = matmult_shapes_bytearray
|
|
1588
|
+
|
|
1589
|
+
def getComparisonLtShape(self, right_shape):
|
|
1590
|
+
if right_shape is tshape_unknown:
|
|
1591
|
+
return operation_result_unknown
|
|
1592
|
+
|
|
1593
|
+
if right_shape in (tshape_bytearray, tshape_bytes):
|
|
1594
|
+
return operation_result_bool_noescape
|
|
1595
|
+
|
|
1596
|
+
if right_shape is tshape_str:
|
|
1597
|
+
if python_version < 0x300:
|
|
1598
|
+
return operation_result_bool_noescape
|
|
1599
|
+
else:
|
|
1600
|
+
# TODO: Exception actually for static optimization.
|
|
1601
|
+
return operation_result_unknown
|
|
1602
|
+
|
|
1603
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
1604
|
+
|
|
1605
|
+
@staticmethod
|
|
1606
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1607
|
+
return hasattr(_the_typical_bytearray_value, attribute_name)
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
tshape_bytearray = ShapeTypeBytearray()
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
class ShapeTypeBytearrayIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1614
|
+
__slots__ = ()
|
|
1615
|
+
|
|
1616
|
+
typical_value = iter(tshape_bytearray.typical_value)
|
|
1617
|
+
|
|
1618
|
+
@staticmethod
|
|
1619
|
+
def getTypeName():
|
|
1620
|
+
return "bytearray_iterator"
|
|
1621
|
+
|
|
1622
|
+
@staticmethod
|
|
1623
|
+
def hasShapeIndexLookup():
|
|
1624
|
+
return False
|
|
1625
|
+
|
|
1626
|
+
|
|
1627
|
+
tshape_bytearray_iterator = ShapeTypeBytearrayIterator()
|
|
1628
|
+
|
|
1629
|
+
|
|
1630
|
+
class ShapeTypeEllipsis(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1631
|
+
__slots__ = ()
|
|
1632
|
+
|
|
1633
|
+
typical_value = Ellipsis
|
|
1634
|
+
|
|
1635
|
+
@staticmethod
|
|
1636
|
+
def getTypeName():
|
|
1637
|
+
return "ellipsis"
|
|
1638
|
+
|
|
1639
|
+
@staticmethod
|
|
1640
|
+
def hasShapeSlotHash():
|
|
1641
|
+
return True
|
|
1642
|
+
|
|
1643
|
+
@staticmethod
|
|
1644
|
+
def hasShapeIndexLookup():
|
|
1645
|
+
return False
|
|
1646
|
+
|
|
1647
|
+
@staticmethod
|
|
1648
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1649
|
+
return hasattr(Ellipsis, attribute_name)
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
tshape_ellipsis = ShapeTypeEllipsis()
|
|
1653
|
+
|
|
1654
|
+
_the_typical_slice_value = slice(7)
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
class ShapeTypeSlice(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1658
|
+
__slots__ = ()
|
|
1659
|
+
|
|
1660
|
+
typical_value = _the_typical_slice_value
|
|
1661
|
+
|
|
1662
|
+
@staticmethod
|
|
1663
|
+
def getTypeName():
|
|
1664
|
+
return "slice"
|
|
1665
|
+
|
|
1666
|
+
@staticmethod
|
|
1667
|
+
def hasShapeSlotHash():
|
|
1668
|
+
return False
|
|
1669
|
+
|
|
1670
|
+
@staticmethod
|
|
1671
|
+
def hasShapeIndexLookup():
|
|
1672
|
+
return False
|
|
1673
|
+
|
|
1674
|
+
@staticmethod
|
|
1675
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1676
|
+
return hasattr(_the_typical_slice_value, attribute_name)
|
|
1677
|
+
|
|
1678
|
+
|
|
1679
|
+
tshape_slice = ShapeTypeSlice()
|
|
1680
|
+
|
|
1681
|
+
_the_typical_xrange_value = (
|
|
1682
|
+
xrange(1) # pylint: disable=I0021,undefined-variable
|
|
1683
|
+
if python_version < 0x300
|
|
1684
|
+
else range(1)
|
|
1685
|
+
)
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
class ShapeTypeXrange(ShapeContainerImmutableMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1689
|
+
__slots__ = ()
|
|
1690
|
+
|
|
1691
|
+
typical_value = _the_typical_xrange_value
|
|
1692
|
+
|
|
1693
|
+
@staticmethod
|
|
1694
|
+
def getTypeName():
|
|
1695
|
+
return "xrange" if python_version < 0x300 else "range"
|
|
1696
|
+
|
|
1697
|
+
@staticmethod
|
|
1698
|
+
def getShapeIter():
|
|
1699
|
+
return tshape_xrange_iterator
|
|
1700
|
+
|
|
1701
|
+
@staticmethod
|
|
1702
|
+
def hasShapeIndexLookup():
|
|
1703
|
+
return True
|
|
1704
|
+
|
|
1705
|
+
def getComparisonLtShape(self, right_shape):
|
|
1706
|
+
if right_shape is tshape_unknown:
|
|
1707
|
+
return operation_result_unknown
|
|
1708
|
+
|
|
1709
|
+
# TODO: Maybe split in two shapes, they are quite different in the
|
|
1710
|
+
# end when it comes to operations.
|
|
1711
|
+
if python_version < 0x300:
|
|
1712
|
+
# Need to consider value shape for this.
|
|
1713
|
+
if right_shape in (tshape_list, tshape_tuple):
|
|
1714
|
+
return operation_result_bool_element_based
|
|
1715
|
+
|
|
1716
|
+
if right_shape is tshape_xrange:
|
|
1717
|
+
# TODO: This is value escaping, but that doesn't really apply
|
|
1718
|
+
return operation_result_bool_element_based
|
|
1719
|
+
else:
|
|
1720
|
+
# TODO: Actually unorderable, but this requires making a
|
|
1721
|
+
# difference with "=="
|
|
1722
|
+
return operation_result_unknown
|
|
1723
|
+
|
|
1724
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
1725
|
+
|
|
1726
|
+
@staticmethod
|
|
1727
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1728
|
+
return hasattr(_the_typical_xrange_value, attribute_name)
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
tshape_xrange = ShapeTypeXrange()
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
class ShapeTypeXrangeIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1735
|
+
__slots__ = ()
|
|
1736
|
+
|
|
1737
|
+
typical_value = iter(tshape_xrange.typical_value)
|
|
1738
|
+
|
|
1739
|
+
@staticmethod
|
|
1740
|
+
def getTypeName():
|
|
1741
|
+
return "rangeiterator" if python_version < 0x300 else "range_iterator"
|
|
1742
|
+
|
|
1743
|
+
@staticmethod
|
|
1744
|
+
def hasShapeIndexLookup():
|
|
1745
|
+
return False
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
tshape_xrange_iterator = ShapeTypeXrangeIterator()
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
class ShapeTypeTypeBase(ShapeNotNumberMixin, ShapeBase):
|
|
1752
|
+
# Base classes can be abstract, pylint: disable=abstract-method
|
|
1753
|
+
|
|
1754
|
+
__slots__ = ()
|
|
1755
|
+
|
|
1756
|
+
typical_value = int
|
|
1757
|
+
|
|
1758
|
+
@staticmethod
|
|
1759
|
+
def getTypeName():
|
|
1760
|
+
return "type"
|
|
1761
|
+
|
|
1762
|
+
@staticmethod
|
|
1763
|
+
def hasShapeSlotHash():
|
|
1764
|
+
return True
|
|
1765
|
+
|
|
1766
|
+
def getComparisonLtShape(self, right_shape):
|
|
1767
|
+
if right_shape is tshape_unknown:
|
|
1768
|
+
return operation_result_unknown
|
|
1769
|
+
|
|
1770
|
+
if right_shape is tshape_type:
|
|
1771
|
+
return tshape_unknown, ControlFlowDescriptionNoEscape
|
|
1772
|
+
|
|
1773
|
+
return _getComparisonLtShapeGeneric(self, right_shape)
|
|
1774
|
+
|
|
1775
|
+
@staticmethod
|
|
1776
|
+
def isKnownToHaveAttribute(attribute_name):
|
|
1777
|
+
return hasattr(int, attribute_name)
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
if python_version < 0x390:
|
|
1781
|
+
|
|
1782
|
+
class ShapeTypeType(ShapeNotContainerMixin, ShapeTypeTypeBase):
|
|
1783
|
+
__slots__ = ()
|
|
1784
|
+
|
|
1785
|
+
else:
|
|
1786
|
+
|
|
1787
|
+
class ShapeTypeType(ShapeTypeTypeBase):
|
|
1788
|
+
__slots__ = ()
|
|
1789
|
+
|
|
1790
|
+
@staticmethod
|
|
1791
|
+
def getOperationUnaryReprEscape():
|
|
1792
|
+
# We can't really say it's element based, since it may not be iterable
|
|
1793
|
+
# still.
|
|
1794
|
+
return ControlFlowDescriptionFullEscape
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
tshape_type = ShapeTypeType()
|
|
1798
|
+
|
|
1799
|
+
|
|
1800
|
+
class ShapeTypeModule(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1801
|
+
__slots__ = ()
|
|
1802
|
+
|
|
1803
|
+
typical_value = __import__("sys")
|
|
1804
|
+
|
|
1805
|
+
@staticmethod
|
|
1806
|
+
def getTypeName():
|
|
1807
|
+
return "module"
|
|
1808
|
+
|
|
1809
|
+
@staticmethod
|
|
1810
|
+
def hasShapeModule():
|
|
1811
|
+
return True
|
|
1812
|
+
|
|
1813
|
+
@staticmethod
|
|
1814
|
+
def hasShapeSlotHash():
|
|
1815
|
+
return True
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
tshape_module = ShapeTypeModule()
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
class ShapeTypeFunction(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1822
|
+
__slots__ = ()
|
|
1823
|
+
# TODO: Add typical value.
|
|
1824
|
+
|
|
1825
|
+
@staticmethod
|
|
1826
|
+
def getTypeName():
|
|
1827
|
+
return "function"
|
|
1828
|
+
|
|
1829
|
+
@staticmethod
|
|
1830
|
+
def hasShapeSlotHash():
|
|
1831
|
+
return True
|
|
1832
|
+
|
|
1833
|
+
|
|
1834
|
+
tshape_function = ShapeTypeFunction()
|
|
1835
|
+
|
|
1836
|
+
|
|
1837
|
+
class ShapeTypeBuiltinModule(ShapeTypeModule):
|
|
1838
|
+
__slots__ = ()
|
|
1839
|
+
|
|
1840
|
+
typical_value = __import__("_ctypes")
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
tshape_module_builtin = ShapeTypeBuiltinModule()
|
|
1844
|
+
|
|
1845
|
+
|
|
1846
|
+
class ShapeTypeFile(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1847
|
+
__slots__ = ()
|
|
1848
|
+
# TODO: That need not really be a file, find something better.
|
|
1849
|
+
typical_value = __import__("sys").stdout
|
|
1850
|
+
|
|
1851
|
+
@staticmethod
|
|
1852
|
+
def getTypeName():
|
|
1853
|
+
return "file"
|
|
1854
|
+
|
|
1855
|
+
# Files are self-iterators.
|
|
1856
|
+
@staticmethod
|
|
1857
|
+
def hasShapeSlotIter():
|
|
1858
|
+
return True
|
|
1859
|
+
|
|
1860
|
+
@staticmethod
|
|
1861
|
+
def hasShapeSlotNext():
|
|
1862
|
+
return True
|
|
1863
|
+
|
|
1864
|
+
@staticmethod
|
|
1865
|
+
def hasShapeSlotContains():
|
|
1866
|
+
return True
|
|
1867
|
+
|
|
1868
|
+
@staticmethod
|
|
1869
|
+
def hasShapeSlotHash():
|
|
1870
|
+
return True
|
|
1871
|
+
|
|
1872
|
+
|
|
1873
|
+
tshape_file = ShapeTypeFile()
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
class ShapeTypeStaticmethod(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1877
|
+
__slots__ = ()
|
|
1878
|
+
|
|
1879
|
+
# TODO: Add typical value.
|
|
1880
|
+
|
|
1881
|
+
@staticmethod
|
|
1882
|
+
def getTypeName():
|
|
1883
|
+
return "staticmethod"
|
|
1884
|
+
|
|
1885
|
+
# TODO: These probably reject all kinds of operations.
|
|
1886
|
+
|
|
1887
|
+
|
|
1888
|
+
tshape_staticmethod = ShapeTypeStaticmethod()
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+
class ShapeTypeClassmethod(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
|
|
1892
|
+
__slots__ = ()
|
|
1893
|
+
# TODO: Add typical value.
|
|
1894
|
+
|
|
1895
|
+
@staticmethod
|
|
1896
|
+
def getTypeName():
|
|
1897
|
+
return "classmethod"
|
|
1898
|
+
|
|
1899
|
+
# TODO: These probably reject all kinds of operations.
|
|
1900
|
+
|
|
1901
|
+
|
|
1902
|
+
tshape_classmethod = ShapeTypeClassmethod()
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
# Prepared tuples to save creating return value tuples:
|
|
1906
|
+
operation_result_bool_noescape = tshape_bool, ControlFlowDescriptionNoEscape
|
|
1907
|
+
operation_result_float_noescape = tshape_float, ControlFlowDescriptionNoEscape
|
|
1908
|
+
operation_result_int_noescape = tshape_int, ControlFlowDescriptionNoEscape
|
|
1909
|
+
operation_result_long_noescape = tshape_long, ControlFlowDescriptionNoEscape
|
|
1910
|
+
operation_result_intorlong_noescape = tshape_int_or_long, ControlFlowDescriptionNoEscape
|
|
1911
|
+
operation_result_complex_noescape = tshape_complex, ControlFlowDescriptionNoEscape
|
|
1912
|
+
operation_result_tuple_noescape = tshape_tuple, ControlFlowDescriptionNoEscape
|
|
1913
|
+
operation_result_list_noescape = tshape_list, ControlFlowDescriptionNoEscape
|
|
1914
|
+
operation_result_set_noescape = tshape_set, ControlFlowDescriptionNoEscape
|
|
1915
|
+
operation_result_frozenset_noescape = tshape_frozenset, ControlFlowDescriptionNoEscape
|
|
1916
|
+
operation_result_str_noescape = tshape_str, ControlFlowDescriptionNoEscape
|
|
1917
|
+
operation_result_unicode_noescape = tshape_unicode, ControlFlowDescriptionNoEscape
|
|
1918
|
+
operation_result_strorunicode_noescape = (
|
|
1919
|
+
tshape_str_or_unicode,
|
|
1920
|
+
ControlFlowDescriptionNoEscape,
|
|
1921
|
+
)
|
|
1922
|
+
operation_result_bytes_noescape = tshape_bytes, ControlFlowDescriptionNoEscape
|
|
1923
|
+
operation_result_bytearray_noescape = tshape_bytearray, ControlFlowDescriptionNoEscape
|
|
1924
|
+
|
|
1925
|
+
operation_result_dict_noescape = tshape_dict, ControlFlowDescriptionNoEscape
|
|
1926
|
+
operation_result_dict_valueerror = tshape_dict, ControlFlowDescriptionValueErrorNoEscape
|
|
1927
|
+
|
|
1928
|
+
|
|
1929
|
+
operation_result_bool_element_based = (
|
|
1930
|
+
tshape_bool,
|
|
1931
|
+
ControlFlowDescriptionElementBasedEscape,
|
|
1932
|
+
)
|
|
1933
|
+
|
|
1934
|
+
operation_result_unorderable_comparison = (
|
|
1935
|
+
tshape_unknown,
|
|
1936
|
+
ControlFlowDescriptionComparisonUnorderable,
|
|
1937
|
+
)
|
|
1938
|
+
|
|
1939
|
+
operation_result_unsupported_add = tshape_unknown, ControlFlowDescriptionAddUnsupported
|
|
1940
|
+
operation_result_unsupported_sub = tshape_unknown, ControlFlowDescriptionSubUnsupported
|
|
1941
|
+
operation_result_unsupported_mul = tshape_unknown, ControlFlowDescriptionMulUnsupported
|
|
1942
|
+
operation_result_unsupported_floordiv = (
|
|
1943
|
+
tshape_unknown,
|
|
1944
|
+
ControlFlowDescriptionFloorDivUnsupported,
|
|
1945
|
+
)
|
|
1946
|
+
operation_result_unsupported_truediv = (
|
|
1947
|
+
tshape_unknown,
|
|
1948
|
+
ControlFlowDescriptionTrueDivUnsupported,
|
|
1949
|
+
)
|
|
1950
|
+
operation_result_unsupported_olddiv = (
|
|
1951
|
+
tshape_unknown,
|
|
1952
|
+
ControlFlowDescriptionOldDivUnsupported,
|
|
1953
|
+
)
|
|
1954
|
+
operation_result_unsupported_mod = tshape_unknown, ControlFlowDescriptionModUnsupported
|
|
1955
|
+
|
|
1956
|
+
operation_result_unsupported_divmod = (
|
|
1957
|
+
tshape_unknown,
|
|
1958
|
+
ControlFlowDescriptionDivmodUnsupported,
|
|
1959
|
+
)
|
|
1960
|
+
operation_result_unsupported_pow = tshape_unknown, ControlFlowDescriptionPowUnsupported
|
|
1961
|
+
operation_result_unsupported_bitor = (
|
|
1962
|
+
tshape_unknown,
|
|
1963
|
+
ControlFlowDescriptionBitorUnsupported,
|
|
1964
|
+
)
|
|
1965
|
+
operation_result_unsupported_bitand = (
|
|
1966
|
+
tshape_unknown,
|
|
1967
|
+
ControlFlowDescriptionBitandUnsupported,
|
|
1968
|
+
)
|
|
1969
|
+
operation_result_unsupported_bitxor = (
|
|
1970
|
+
tshape_unknown,
|
|
1971
|
+
ControlFlowDescriptionBitxorUnsupported,
|
|
1972
|
+
)
|
|
1973
|
+
operation_result_unsupported_lshift = (
|
|
1974
|
+
tshape_unknown,
|
|
1975
|
+
ControlFlowDescriptionLshiftUnsupported,
|
|
1976
|
+
)
|
|
1977
|
+
operation_result_unsupported_rshift = (
|
|
1978
|
+
tshape_unknown,
|
|
1979
|
+
ControlFlowDescriptionRshiftUnsupported,
|
|
1980
|
+
)
|
|
1981
|
+
operation_result_unsupported_matmult = (
|
|
1982
|
+
tshape_unknown,
|
|
1983
|
+
ControlFlowDescriptionMatmultUnsupported,
|
|
1984
|
+
)
|
|
1985
|
+
|
|
1986
|
+
# ZeroDivisionError can occur for some module and division operations, otherwise they
|
|
1987
|
+
# are fixed type.
|
|
1988
|
+
operation_result_zerodiv_int = tshape_int, ControlFlowDescriptionZeroDivisionNoEscape
|
|
1989
|
+
operation_result_zerodiv_long = (
|
|
1990
|
+
tshape_long,
|
|
1991
|
+
ControlFlowDescriptionZeroDivisionNoEscape,
|
|
1992
|
+
)
|
|
1993
|
+
operation_result_zerodiv_intorlong = (
|
|
1994
|
+
tshape_int_or_long,
|
|
1995
|
+
ControlFlowDescriptionZeroDivisionNoEscape,
|
|
1996
|
+
)
|
|
1997
|
+
operation_result_zerodiv_float = (
|
|
1998
|
+
tshape_float,
|
|
1999
|
+
ControlFlowDescriptionZeroDivisionNoEscape,
|
|
2000
|
+
)
|
|
2001
|
+
operation_result_zerodiv_complex = (
|
|
2002
|
+
tshape_complex,
|
|
2003
|
+
ControlFlowDescriptionZeroDivisionNoEscape,
|
|
2004
|
+
)
|
|
2005
|
+
operation_result_zerodiv_tuple = (
|
|
2006
|
+
tshape_tuple,
|
|
2007
|
+
ControlFlowDescriptionZeroDivisionNoEscape,
|
|
2008
|
+
)
|
|
2009
|
+
operation_result_valueerror_intorlong = (
|
|
2010
|
+
tshape_int_or_long,
|
|
2011
|
+
ControlFlowDescriptionValueErrorNoEscape,
|
|
2012
|
+
)
|
|
2013
|
+
operation_result_valueerror_long = (
|
|
2014
|
+
tshape_long,
|
|
2015
|
+
ControlFlowDescriptionValueErrorNoEscape,
|
|
2016
|
+
)
|
|
2017
|
+
|
|
2018
|
+
# Format operations can do many things.
|
|
2019
|
+
operation_result_str_formaterror = (tshape_str, ControlFlowDescriptionFormatError)
|
|
2020
|
+
operation_result_unicode_formaterror = (
|
|
2021
|
+
tshape_unicode,
|
|
2022
|
+
ControlFlowDescriptionFormatError,
|
|
2023
|
+
)
|
|
2024
|
+
operation_result_bytes_formaterror = (tshape_bytes, ControlFlowDescriptionFormatError)
|
|
2025
|
+
operation_result_bytearray_formaterror = (
|
|
2026
|
+
tshape_bytearray,
|
|
2027
|
+
ControlFlowDescriptionFormatError,
|
|
2028
|
+
)
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
# Prepared values, reject everything.
|
|
2032
|
+
def _rejectEverything(shapes, operation_unsupported):
|
|
2033
|
+
shapes.update(
|
|
2034
|
+
{
|
|
2035
|
+
# Standard
|
|
2036
|
+
tshape_unknown: operation_result_unknown,
|
|
2037
|
+
tshape_long_derived: operation_result_unknown,
|
|
2038
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2039
|
+
tshape_float_derived: operation_result_unknown,
|
|
2040
|
+
tshape_str_derived: operation_result_unknown,
|
|
2041
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2042
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2043
|
+
# None really hates everything concrete for all operations.
|
|
2044
|
+
tshape_int: operation_unsupported,
|
|
2045
|
+
tshape_long: operation_unsupported,
|
|
2046
|
+
tshape_int_or_long: operation_unsupported,
|
|
2047
|
+
tshape_bool: operation_unsupported,
|
|
2048
|
+
tshape_long: operation_unsupported,
|
|
2049
|
+
tshape_float: operation_unsupported,
|
|
2050
|
+
tshape_complex: operation_unsupported,
|
|
2051
|
+
# Sequence repeat:
|
|
2052
|
+
tshape_str: operation_unsupported,
|
|
2053
|
+
tshape_bytes: operation_unsupported,
|
|
2054
|
+
tshape_bytearray: operation_unsupported,
|
|
2055
|
+
tshape_unicode: operation_unsupported,
|
|
2056
|
+
tshape_tuple: operation_unsupported,
|
|
2057
|
+
tshape_list: operation_unsupported,
|
|
2058
|
+
# Unsupported:
|
|
2059
|
+
tshape_set: operation_unsupported,
|
|
2060
|
+
tshape_frozenset: operation_unsupported,
|
|
2061
|
+
tshape_dict: operation_unsupported,
|
|
2062
|
+
tshape_type: operation_unsupported,
|
|
2063
|
+
tshape_none: operation_unsupported,
|
|
2064
|
+
}
|
|
2065
|
+
)
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
_rejectEverything(add_shapes_none, operation_result_unsupported_add)
|
|
2069
|
+
_rejectEverything(sub_shapes_none, operation_result_unsupported_sub)
|
|
2070
|
+
_rejectEverything(mult_shapes_none, operation_result_unsupported_mul)
|
|
2071
|
+
_rejectEverything(floordiv_shapes_none, operation_result_unsupported_floordiv)
|
|
2072
|
+
_rejectEverything(truediv_shapes_none, operation_result_unsupported_truediv)
|
|
2073
|
+
_rejectEverything(olddiv_shapes_none, operation_result_unsupported_olddiv)
|
|
2074
|
+
_rejectEverything(mod_shapes_none, operation_result_unsupported_mod)
|
|
2075
|
+
_rejectEverything(divmod_shapes_none, operation_result_unsupported_divmod)
|
|
2076
|
+
_rejectEverything(pow_shapes_none, operation_result_unsupported_pow)
|
|
2077
|
+
_rejectEverything(bitor_shapes_none, operation_result_unsupported_bitor)
|
|
2078
|
+
_rejectEverything(bitand_shapes_none, operation_result_unsupported_bitand)
|
|
2079
|
+
_rejectEverything(bitxor_shapes_none, operation_result_unsupported_bitxor)
|
|
2080
|
+
_rejectEverything(lshift_shapes_none, operation_result_unsupported_lshift)
|
|
2081
|
+
_rejectEverything(rshift_shapes_none, operation_result_unsupported_rshift)
|
|
2082
|
+
_rejectEverything(matmult_shapes_none, operation_result_unsupported_rshift)
|
|
2083
|
+
|
|
2084
|
+
|
|
2085
|
+
def cloneWithUnsupportedChange(op_shapes, operation_result_unsupported):
|
|
2086
|
+
r = {}
|
|
2087
|
+
|
|
2088
|
+
for key, value in op_shapes.items():
|
|
2089
|
+
if value[1].getExceptionExit() is TypeError:
|
|
2090
|
+
value = operation_result_unsupported
|
|
2091
|
+
|
|
2092
|
+
r[key] = value
|
|
2093
|
+
|
|
2094
|
+
return r
|
|
2095
|
+
|
|
2096
|
+
|
|
2097
|
+
add_shapes_bool.update(
|
|
2098
|
+
{
|
|
2099
|
+
# Standard
|
|
2100
|
+
tshape_unknown: operation_result_unknown,
|
|
2101
|
+
tshape_long_derived: operation_result_unknown,
|
|
2102
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2103
|
+
tshape_float_derived: operation_result_unknown,
|
|
2104
|
+
tshape_str_derived: operation_result_unknown,
|
|
2105
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2106
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2107
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2108
|
+
tshape_int: operation_result_intorlong_noescape,
|
|
2109
|
+
tshape_long: operation_result_long_noescape,
|
|
2110
|
+
tshape_int_or_long: operation_result_intorlong_noescape,
|
|
2111
|
+
tshape_bool: operation_result_int_noescape,
|
|
2112
|
+
tshape_long: operation_result_long_noescape,
|
|
2113
|
+
tshape_float: operation_result_float_noescape,
|
|
2114
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2115
|
+
# Sequence repeat:
|
|
2116
|
+
tshape_str: operation_result_unsupported_add,
|
|
2117
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
2118
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
2119
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
2120
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
2121
|
+
tshape_list: operation_result_unsupported_add,
|
|
2122
|
+
# Unsupported:
|
|
2123
|
+
tshape_set: operation_result_unsupported_add,
|
|
2124
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
2125
|
+
tshape_dict: operation_result_unsupported_add,
|
|
2126
|
+
tshape_type: operation_result_unsupported_add,
|
|
2127
|
+
tshape_none: operation_result_unsupported_add,
|
|
2128
|
+
}
|
|
2129
|
+
)
|
|
2130
|
+
|
|
2131
|
+
sub_shapes_bool.update(
|
|
2132
|
+
cloneWithUnsupportedChange(add_shapes_bool, operation_result_unsupported_sub)
|
|
2133
|
+
)
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
mult_shapes_bool.update(
|
|
2137
|
+
{
|
|
2138
|
+
# Standard
|
|
2139
|
+
tshape_unknown: operation_result_unknown,
|
|
2140
|
+
tshape_long_derived: operation_result_unknown,
|
|
2141
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2142
|
+
tshape_float_derived: operation_result_unknown,
|
|
2143
|
+
tshape_str_derived: operation_result_unknown,
|
|
2144
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2145
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2146
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2147
|
+
tshape_int: operation_result_int_noescape,
|
|
2148
|
+
tshape_long: operation_result_long_noescape,
|
|
2149
|
+
tshape_int_or_long: operation_result_intorlong_noescape,
|
|
2150
|
+
tshape_bool: operation_result_int_noescape,
|
|
2151
|
+
tshape_float: operation_result_float_noescape,
|
|
2152
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2153
|
+
# Sequence repeat:
|
|
2154
|
+
tshape_str: operation_result_str_noescape,
|
|
2155
|
+
tshape_bytes: operation_result_bytes_noescape,
|
|
2156
|
+
tshape_bytearray: operation_result_bytearray_noescape,
|
|
2157
|
+
tshape_unicode: operation_result_unicode_noescape,
|
|
2158
|
+
tshape_tuple: operation_result_tuple_noescape,
|
|
2159
|
+
tshape_list: operation_result_list_noescape,
|
|
2160
|
+
# Unsupported:
|
|
2161
|
+
tshape_set: operation_result_unsupported_mul,
|
|
2162
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
2163
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
2164
|
+
tshape_type: operation_result_unsupported_mul,
|
|
2165
|
+
tshape_none: operation_result_unsupported_mul,
|
|
2166
|
+
}
|
|
2167
|
+
)
|
|
2168
|
+
|
|
2169
|
+
floordiv_shapes_bool.update(
|
|
2170
|
+
{
|
|
2171
|
+
# Standard
|
|
2172
|
+
tshape_unknown: operation_result_unknown,
|
|
2173
|
+
tshape_long_derived: operation_result_unknown,
|
|
2174
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2175
|
+
tshape_float_derived: operation_result_unknown,
|
|
2176
|
+
tshape_str_derived: operation_result_unknown,
|
|
2177
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2178
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2179
|
+
# Ints do math
|
|
2180
|
+
tshape_int: operation_result_zerodiv_int,
|
|
2181
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2182
|
+
tshape_int_or_long: operation_result_zerodiv_intorlong,
|
|
2183
|
+
tshape_bool: operation_result_zerodiv_int,
|
|
2184
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2185
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2186
|
+
# Unsupported:
|
|
2187
|
+
tshape_str: operation_result_unsupported_floordiv,
|
|
2188
|
+
tshape_bytes: operation_result_unsupported_floordiv,
|
|
2189
|
+
tshape_bytearray: operation_result_unsupported_floordiv,
|
|
2190
|
+
tshape_unicode: operation_result_unsupported_floordiv,
|
|
2191
|
+
tshape_tuple: operation_result_unsupported_floordiv,
|
|
2192
|
+
tshape_list: operation_result_unsupported_floordiv,
|
|
2193
|
+
tshape_set: operation_result_unsupported_floordiv,
|
|
2194
|
+
tshape_frozenset: operation_result_unsupported_floordiv,
|
|
2195
|
+
tshape_dict: operation_result_unsupported_floordiv,
|
|
2196
|
+
tshape_type: operation_result_unsupported_floordiv,
|
|
2197
|
+
tshape_none: operation_result_unsupported_floordiv,
|
|
2198
|
+
}
|
|
2199
|
+
)
|
|
2200
|
+
|
|
2201
|
+
truediv_shapes_bool.update(
|
|
2202
|
+
{
|
|
2203
|
+
# Standard
|
|
2204
|
+
tshape_unknown: operation_result_unknown,
|
|
2205
|
+
tshape_long_derived: operation_result_unknown,
|
|
2206
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2207
|
+
tshape_float_derived: operation_result_unknown,
|
|
2208
|
+
tshape_str_derived: operation_result_unknown,
|
|
2209
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2210
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2211
|
+
# Bool act mostly like 0 or 1 int.
|
|
2212
|
+
tshape_int: operation_result_zerodiv_float,
|
|
2213
|
+
tshape_long: operation_result_zerodiv_float,
|
|
2214
|
+
tshape_int_or_long: operation_result_zerodiv_float,
|
|
2215
|
+
tshape_bool: operation_result_zerodiv_float,
|
|
2216
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2217
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2218
|
+
# Unsupported:
|
|
2219
|
+
tshape_str: operation_result_unsupported_truediv,
|
|
2220
|
+
tshape_bytes: operation_result_unsupported_truediv,
|
|
2221
|
+
tshape_bytearray: operation_result_unsupported_truediv,
|
|
2222
|
+
tshape_unicode: operation_result_unsupported_truediv,
|
|
2223
|
+
tshape_tuple: operation_result_unsupported_truediv,
|
|
2224
|
+
tshape_list: operation_result_unsupported_truediv,
|
|
2225
|
+
tshape_set: operation_result_unsupported_truediv,
|
|
2226
|
+
tshape_frozenset: operation_result_unsupported_truediv,
|
|
2227
|
+
tshape_dict: operation_result_unsupported_truediv,
|
|
2228
|
+
tshape_type: operation_result_unsupported_truediv,
|
|
2229
|
+
tshape_none: operation_result_unsupported_truediv,
|
|
2230
|
+
}
|
|
2231
|
+
)
|
|
2232
|
+
|
|
2233
|
+
olddiv_shapes_bool.update(
|
|
2234
|
+
{
|
|
2235
|
+
# Standard
|
|
2236
|
+
tshape_unknown: operation_result_unknown,
|
|
2237
|
+
tshape_long_derived: operation_result_unknown,
|
|
2238
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2239
|
+
tshape_float_derived: operation_result_unknown,
|
|
2240
|
+
tshape_str_derived: operation_result_unknown,
|
|
2241
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2242
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2243
|
+
# Bool act mostly like 0 or 1 int.
|
|
2244
|
+
tshape_int: operation_result_zerodiv_int,
|
|
2245
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2246
|
+
tshape_int_or_long: operation_result_zerodiv_intorlong,
|
|
2247
|
+
tshape_bool: operation_result_zerodiv_int,
|
|
2248
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2249
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2250
|
+
# Unsupported:
|
|
2251
|
+
tshape_str: operation_result_unsupported_olddiv,
|
|
2252
|
+
tshape_bytes: operation_result_unsupported_olddiv,
|
|
2253
|
+
tshape_bytearray: operation_result_unsupported_olddiv,
|
|
2254
|
+
tshape_unicode: operation_result_unsupported_olddiv,
|
|
2255
|
+
tshape_tuple: operation_result_unsupported_olddiv,
|
|
2256
|
+
tshape_list: operation_result_unsupported_olddiv,
|
|
2257
|
+
tshape_set: operation_result_unsupported_olddiv,
|
|
2258
|
+
tshape_dict: operation_result_unsupported_olddiv,
|
|
2259
|
+
tshape_type: operation_result_unsupported_olddiv,
|
|
2260
|
+
tshape_none: operation_result_unsupported_olddiv,
|
|
2261
|
+
}
|
|
2262
|
+
)
|
|
2263
|
+
|
|
2264
|
+
mod_shapes_bool.update(
|
|
2265
|
+
{
|
|
2266
|
+
# Standard
|
|
2267
|
+
tshape_unknown: operation_result_unknown,
|
|
2268
|
+
tshape_long_derived: operation_result_unknown,
|
|
2269
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2270
|
+
tshape_float_derived: operation_result_unknown,
|
|
2271
|
+
tshape_str_derived: operation_result_unknown,
|
|
2272
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2273
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2274
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2275
|
+
tshape_int: operation_result_zerodiv_int,
|
|
2276
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2277
|
+
tshape_int_or_long: operation_result_zerodiv_intorlong,
|
|
2278
|
+
tshape_bool: operation_result_zerodiv_int,
|
|
2279
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2280
|
+
tshape_complex: (
|
|
2281
|
+
operation_result_zerodiv_complex
|
|
2282
|
+
if python_version < 0x300
|
|
2283
|
+
else operation_result_unsupported_mod
|
|
2284
|
+
),
|
|
2285
|
+
# Unsupported:
|
|
2286
|
+
tshape_str: operation_result_unsupported_mod,
|
|
2287
|
+
tshape_bytes: operation_result_unsupported_mod,
|
|
2288
|
+
tshape_bytearray: operation_result_unsupported_mod,
|
|
2289
|
+
tshape_unicode: operation_result_unsupported_mod,
|
|
2290
|
+
tshape_tuple: operation_result_unsupported_mod,
|
|
2291
|
+
tshape_list: operation_result_unsupported_mod,
|
|
2292
|
+
tshape_set: operation_result_unsupported_mod,
|
|
2293
|
+
tshape_frozenset: operation_result_unsupported_mod,
|
|
2294
|
+
tshape_dict: operation_result_unsupported_mod,
|
|
2295
|
+
tshape_type: operation_result_unsupported_mod,
|
|
2296
|
+
tshape_none: operation_result_unsupported_mod,
|
|
2297
|
+
}
|
|
2298
|
+
)
|
|
2299
|
+
|
|
2300
|
+
divmod_shapes_bool.update(
|
|
2301
|
+
{
|
|
2302
|
+
# Standard
|
|
2303
|
+
tshape_unknown: operation_result_unknown,
|
|
2304
|
+
tshape_long_derived: operation_result_unknown,
|
|
2305
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2306
|
+
tshape_float_derived: operation_result_unknown,
|
|
2307
|
+
tshape_str_derived: operation_result_unknown,
|
|
2308
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2309
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2310
|
+
# Divmod makes tuples of 2 elements
|
|
2311
|
+
tshape_int: operation_result_zerodiv_tuple,
|
|
2312
|
+
tshape_long: operation_result_zerodiv_tuple,
|
|
2313
|
+
tshape_int_or_long: operation_result_zerodiv_tuple,
|
|
2314
|
+
tshape_bool: operation_result_zerodiv_tuple,
|
|
2315
|
+
tshape_float: operation_result_zerodiv_tuple,
|
|
2316
|
+
tshape_complex: operation_result_zerodiv_tuple,
|
|
2317
|
+
# Unsupported:
|
|
2318
|
+
tshape_str: operation_result_unsupported_divmod,
|
|
2319
|
+
tshape_bytes: operation_result_unsupported_divmod,
|
|
2320
|
+
tshape_bytearray: operation_result_unsupported_divmod,
|
|
2321
|
+
tshape_unicode: operation_result_unsupported_divmod,
|
|
2322
|
+
tshape_tuple: operation_result_unsupported_divmod,
|
|
2323
|
+
tshape_list: operation_result_unsupported_divmod,
|
|
2324
|
+
tshape_set: operation_result_unsupported_divmod,
|
|
2325
|
+
tshape_frozenset: operation_result_unsupported_divmod,
|
|
2326
|
+
tshape_dict: operation_result_unsupported_divmod,
|
|
2327
|
+
tshape_type: operation_result_unsupported_divmod,
|
|
2328
|
+
tshape_none: operation_result_unsupported_divmod,
|
|
2329
|
+
}
|
|
2330
|
+
)
|
|
2331
|
+
|
|
2332
|
+
pow_shapes_bool.update(
|
|
2333
|
+
{
|
|
2334
|
+
# Standard
|
|
2335
|
+
tshape_unknown: operation_result_unknown,
|
|
2336
|
+
tshape_long_derived: operation_result_unknown,
|
|
2337
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2338
|
+
tshape_float_derived: operation_result_unknown,
|
|
2339
|
+
tshape_str_derived: operation_result_unknown,
|
|
2340
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2341
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2342
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2343
|
+
tshape_int: operation_result_unknown, # TODO: operation_result_zerodiv_intorfloat,
|
|
2344
|
+
tshape_long: operation_result_unknown, # TODO: operation_result_zerodiv_longorfloat,
|
|
2345
|
+
tshape_int_or_long: operation_result_unknown, # TODO: operation_result_izerodiv_ntorlongorfloat,
|
|
2346
|
+
tshape_bool: operation_result_int_noescape,
|
|
2347
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2348
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2349
|
+
# Unsupported:
|
|
2350
|
+
tshape_str: operation_result_unsupported_pow,
|
|
2351
|
+
tshape_bytes: operation_result_unsupported_pow,
|
|
2352
|
+
tshape_bytearray: operation_result_unsupported_pow,
|
|
2353
|
+
tshape_unicode: operation_result_unsupported_pow,
|
|
2354
|
+
tshape_tuple: operation_result_unsupported_pow,
|
|
2355
|
+
tshape_list: operation_result_unsupported_pow,
|
|
2356
|
+
tshape_set: operation_result_unsupported_pow,
|
|
2357
|
+
tshape_frozenset: operation_result_unsupported_pow,
|
|
2358
|
+
tshape_dict: operation_result_unsupported_pow,
|
|
2359
|
+
tshape_type: operation_result_unsupported_pow,
|
|
2360
|
+
tshape_none: operation_result_unsupported_pow,
|
|
2361
|
+
}
|
|
2362
|
+
)
|
|
2363
|
+
|
|
2364
|
+
bitor_shapes_bool.update(
|
|
2365
|
+
{
|
|
2366
|
+
# Standard
|
|
2367
|
+
tshape_unknown: operation_result_unknown,
|
|
2368
|
+
tshape_long_derived: operation_result_unknown,
|
|
2369
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2370
|
+
tshape_float_derived: operation_result_unknown,
|
|
2371
|
+
tshape_str_derived: operation_result_unknown,
|
|
2372
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2373
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2374
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2375
|
+
tshape_int: operation_result_int_noescape,
|
|
2376
|
+
tshape_long: operation_result_long_noescape,
|
|
2377
|
+
tshape_int_or_long: operation_result_intorlong_noescape,
|
|
2378
|
+
tshape_bool: operation_result_bool_noescape,
|
|
2379
|
+
# Unsupported:
|
|
2380
|
+
tshape_float: operation_result_unsupported_bitor,
|
|
2381
|
+
tshape_complex: operation_result_unsupported_bitor,
|
|
2382
|
+
tshape_str: operation_result_unsupported_bitor,
|
|
2383
|
+
tshape_bytes: operation_result_unsupported_bitor,
|
|
2384
|
+
tshape_bytearray: operation_result_unsupported_bitor,
|
|
2385
|
+
tshape_unicode: operation_result_unsupported_bitor,
|
|
2386
|
+
tshape_tuple: operation_result_unsupported_bitor,
|
|
2387
|
+
tshape_list: operation_result_unsupported_bitor,
|
|
2388
|
+
tshape_set: operation_result_unsupported_bitor,
|
|
2389
|
+
tshape_frozenset: operation_result_unsupported_bitor,
|
|
2390
|
+
tshape_dict: operation_result_unsupported_bitor,
|
|
2391
|
+
tshape_type: operation_result_unsupported_bitor,
|
|
2392
|
+
tshape_none: operation_result_unsupported_bitor,
|
|
2393
|
+
}
|
|
2394
|
+
)
|
|
2395
|
+
|
|
2396
|
+
bitand_shapes_bool.update(
|
|
2397
|
+
cloneWithUnsupportedChange(bitor_shapes_bool, operation_result_unsupported_bitand)
|
|
2398
|
+
)
|
|
2399
|
+
bitxor_shapes_bool.update(
|
|
2400
|
+
cloneWithUnsupportedChange(bitor_shapes_bool, operation_result_unsupported_bitand)
|
|
2401
|
+
)
|
|
2402
|
+
|
|
2403
|
+
lshift_shapes_bool.update(
|
|
2404
|
+
{
|
|
2405
|
+
# Standard
|
|
2406
|
+
tshape_unknown: operation_result_unknown,
|
|
2407
|
+
tshape_long_derived: operation_result_unknown,
|
|
2408
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2409
|
+
tshape_float_derived: operation_result_unknown,
|
|
2410
|
+
tshape_str_derived: operation_result_unknown,
|
|
2411
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2412
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2413
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2414
|
+
tshape_int: operation_result_valueerror_intorlong,
|
|
2415
|
+
tshape_long: operation_result_valueerror_long,
|
|
2416
|
+
tshape_int_or_long: operation_result_valueerror_intorlong,
|
|
2417
|
+
tshape_bool: operation_result_valueerror_intorlong,
|
|
2418
|
+
# Unsupported:
|
|
2419
|
+
tshape_float: operation_result_unsupported_lshift,
|
|
2420
|
+
tshape_complex: operation_result_unsupported_lshift,
|
|
2421
|
+
tshape_str: operation_result_unsupported_lshift,
|
|
2422
|
+
tshape_bytes: operation_result_unsupported_lshift,
|
|
2423
|
+
tshape_bytearray: operation_result_unsupported_lshift,
|
|
2424
|
+
tshape_unicode: operation_result_unsupported_lshift,
|
|
2425
|
+
tshape_tuple: operation_result_unsupported_lshift,
|
|
2426
|
+
tshape_list: operation_result_unsupported_lshift,
|
|
2427
|
+
tshape_set: operation_result_unsupported_lshift,
|
|
2428
|
+
tshape_frozenset: operation_result_unsupported_lshift,
|
|
2429
|
+
tshape_dict: operation_result_unsupported_lshift,
|
|
2430
|
+
tshape_type: operation_result_unsupported_lshift,
|
|
2431
|
+
tshape_none: operation_result_unsupported_lshift,
|
|
2432
|
+
}
|
|
2433
|
+
)
|
|
2434
|
+
rshift_shapes_bool.update(
|
|
2435
|
+
cloneWithUnsupportedChange(lshift_shapes_bool, operation_result_unsupported_rshift)
|
|
2436
|
+
)
|
|
2437
|
+
|
|
2438
|
+
|
|
2439
|
+
add_shapes_int.update(
|
|
2440
|
+
{
|
|
2441
|
+
# Standard
|
|
2442
|
+
tshape_unknown: operation_result_unknown,
|
|
2443
|
+
tshape_long_derived: operation_result_unknown,
|
|
2444
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2445
|
+
tshape_float_derived: operation_result_unknown,
|
|
2446
|
+
tshape_str_derived: operation_result_unknown,
|
|
2447
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2448
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2449
|
+
# Int might turn into long when growing due to possible overflow.
|
|
2450
|
+
tshape_int: operation_result_intorlong_noescape,
|
|
2451
|
+
tshape_long: operation_result_long_noescape,
|
|
2452
|
+
tshape_int_or_long: operation_result_intorlong_noescape,
|
|
2453
|
+
tshape_bool: operation_result_intorlong_noescape,
|
|
2454
|
+
tshape_float: operation_result_float_noescape,
|
|
2455
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2456
|
+
# Unsupported:
|
|
2457
|
+
tshape_str: operation_result_unsupported_add,
|
|
2458
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
2459
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
2460
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
2461
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
2462
|
+
tshape_list: operation_result_unsupported_add,
|
|
2463
|
+
tshape_set: operation_result_unsupported_add,
|
|
2464
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
2465
|
+
tshape_dict: operation_result_unsupported_add,
|
|
2466
|
+
tshape_type: operation_result_unsupported_add,
|
|
2467
|
+
tshape_none: operation_result_unsupported_add,
|
|
2468
|
+
}
|
|
2469
|
+
)
|
|
2470
|
+
|
|
2471
|
+
sub_shapes_int.update(
|
|
2472
|
+
cloneWithUnsupportedChange(add_shapes_int, operation_result_unsupported_sub)
|
|
2473
|
+
)
|
|
2474
|
+
|
|
2475
|
+
mult_shapes_int.update(
|
|
2476
|
+
{
|
|
2477
|
+
# Standard
|
|
2478
|
+
tshape_unknown: operation_result_unknown,
|
|
2479
|
+
tshape_long_derived: operation_result_unknown,
|
|
2480
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2481
|
+
tshape_float_derived: operation_result_unknown,
|
|
2482
|
+
tshape_str_derived: operation_result_unknown,
|
|
2483
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2484
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2485
|
+
# Int might turn into long when growing due to possible overflow.
|
|
2486
|
+
tshape_int: operation_result_intorlong_noescape,
|
|
2487
|
+
tshape_long: operation_result_long_noescape,
|
|
2488
|
+
tshape_int_or_long: operation_result_intorlong_noescape,
|
|
2489
|
+
tshape_bool: operation_result_int_noescape, # cannot overflow
|
|
2490
|
+
tshape_float: operation_result_float_noescape,
|
|
2491
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2492
|
+
# Sequence repeat:
|
|
2493
|
+
tshape_str: operation_result_str_noescape,
|
|
2494
|
+
tshape_bytes: operation_result_bytes_noescape,
|
|
2495
|
+
tshape_bytearray: operation_result_bytearray_noescape,
|
|
2496
|
+
tshape_unicode: operation_result_unicode_noescape,
|
|
2497
|
+
tshape_tuple: operation_result_tuple_noescape,
|
|
2498
|
+
tshape_list: operation_result_list_noescape,
|
|
2499
|
+
# Unsupported:
|
|
2500
|
+
tshape_set: operation_result_unsupported_mul,
|
|
2501
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
2502
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
2503
|
+
tshape_type: operation_result_unsupported_mul,
|
|
2504
|
+
tshape_none: operation_result_unsupported_mul,
|
|
2505
|
+
}
|
|
2506
|
+
)
|
|
2507
|
+
|
|
2508
|
+
floordiv_shapes_int.update(
|
|
2509
|
+
{
|
|
2510
|
+
# Standard
|
|
2511
|
+
tshape_unknown: operation_result_unknown,
|
|
2512
|
+
tshape_long_derived: operation_result_unknown,
|
|
2513
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2514
|
+
tshape_float_derived: operation_result_unknown,
|
|
2515
|
+
tshape_str_derived: operation_result_unknown,
|
|
2516
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2517
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2518
|
+
# ints do math ops
|
|
2519
|
+
tshape_int: operation_result_zerodiv_intorlong,
|
|
2520
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2521
|
+
tshape_int_or_long: operation_result_zerodiv_intorlong,
|
|
2522
|
+
tshape_bool: operation_result_zerodiv_int,
|
|
2523
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2524
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2525
|
+
# Unsupported:
|
|
2526
|
+
tshape_str: operation_result_unsupported_floordiv,
|
|
2527
|
+
tshape_bytes: operation_result_unsupported_floordiv,
|
|
2528
|
+
tshape_bytearray: operation_result_unsupported_floordiv,
|
|
2529
|
+
tshape_unicode: operation_result_unsupported_floordiv,
|
|
2530
|
+
tshape_tuple: operation_result_unsupported_floordiv,
|
|
2531
|
+
tshape_list: operation_result_unsupported_floordiv,
|
|
2532
|
+
tshape_set: operation_result_unsupported_floordiv,
|
|
2533
|
+
tshape_frozenset: operation_result_unsupported_floordiv,
|
|
2534
|
+
tshape_dict: operation_result_unsupported_floordiv,
|
|
2535
|
+
tshape_type: operation_result_unsupported_floordiv,
|
|
2536
|
+
tshape_none: operation_result_unsupported_floordiv,
|
|
2537
|
+
}
|
|
2538
|
+
)
|
|
2539
|
+
|
|
2540
|
+
truediv_shapes_int.update(
|
|
2541
|
+
{
|
|
2542
|
+
# Standard
|
|
2543
|
+
tshape_unknown: operation_result_unknown,
|
|
2544
|
+
tshape_long_derived: operation_result_unknown,
|
|
2545
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2546
|
+
tshape_float_derived: operation_result_unknown,
|
|
2547
|
+
tshape_str_derived: operation_result_unknown,
|
|
2548
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2549
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2550
|
+
# ints do math ops
|
|
2551
|
+
tshape_int: operation_result_zerodiv_float,
|
|
2552
|
+
tshape_long: operation_result_zerodiv_float,
|
|
2553
|
+
tshape_int_or_long: operation_result_zerodiv_float,
|
|
2554
|
+
tshape_bool: operation_result_zerodiv_float,
|
|
2555
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2556
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2557
|
+
# Unsupported:
|
|
2558
|
+
tshape_str: operation_result_unsupported_truediv,
|
|
2559
|
+
tshape_bytes: operation_result_unsupported_truediv,
|
|
2560
|
+
tshape_bytearray: operation_result_unsupported_truediv,
|
|
2561
|
+
tshape_unicode: operation_result_unsupported_truediv,
|
|
2562
|
+
tshape_tuple: operation_result_unsupported_truediv,
|
|
2563
|
+
tshape_list: operation_result_unsupported_truediv,
|
|
2564
|
+
tshape_set: operation_result_unsupported_truediv,
|
|
2565
|
+
tshape_frozenset: operation_result_unsupported_truediv,
|
|
2566
|
+
tshape_dict: operation_result_unsupported_truediv,
|
|
2567
|
+
tshape_type: operation_result_unsupported_truediv,
|
|
2568
|
+
tshape_none: operation_result_unsupported_truediv,
|
|
2569
|
+
}
|
|
2570
|
+
)
|
|
2571
|
+
|
|
2572
|
+
olddiv_shapes_int.update(
|
|
2573
|
+
{
|
|
2574
|
+
# Standard
|
|
2575
|
+
tshape_unknown: operation_result_unknown,
|
|
2576
|
+
tshape_long_derived: operation_result_unknown,
|
|
2577
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2578
|
+
tshape_float_derived: operation_result_unknown,
|
|
2579
|
+
tshape_str_derived: operation_result_unknown,
|
|
2580
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2581
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2582
|
+
# ints do math
|
|
2583
|
+
tshape_int: operation_result_zerodiv_intorlong,
|
|
2584
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2585
|
+
tshape_int_or_long: operation_result_zerodiv_intorlong,
|
|
2586
|
+
tshape_bool: operation_result_zerodiv_int,
|
|
2587
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2588
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2589
|
+
# Unsupported:
|
|
2590
|
+
tshape_str: operation_result_unsupported_olddiv,
|
|
2591
|
+
tshape_bytes: operation_result_unsupported_olddiv,
|
|
2592
|
+
tshape_bytearray: operation_result_unsupported_olddiv,
|
|
2593
|
+
tshape_unicode: operation_result_unsupported_olddiv,
|
|
2594
|
+
tshape_tuple: operation_result_unsupported_olddiv,
|
|
2595
|
+
tshape_list: operation_result_unsupported_olddiv,
|
|
2596
|
+
tshape_set: operation_result_unsupported_olddiv,
|
|
2597
|
+
tshape_dict: operation_result_unsupported_olddiv,
|
|
2598
|
+
tshape_type: operation_result_unsupported_olddiv,
|
|
2599
|
+
tshape_none: operation_result_unsupported_olddiv,
|
|
2600
|
+
}
|
|
2601
|
+
)
|
|
2602
|
+
|
|
2603
|
+
mod_shapes_int.update(
|
|
2604
|
+
{
|
|
2605
|
+
# Standard
|
|
2606
|
+
tshape_unknown: operation_result_unknown,
|
|
2607
|
+
tshape_long_derived: operation_result_unknown,
|
|
2608
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2609
|
+
tshape_float_derived: operation_result_unknown,
|
|
2610
|
+
tshape_str_derived: operation_result_unknown,
|
|
2611
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2612
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2613
|
+
# ints do math
|
|
2614
|
+
tshape_int: operation_result_zerodiv_intorlong,
|
|
2615
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2616
|
+
tshape_int_or_long: operation_result_zerodiv_intorlong,
|
|
2617
|
+
tshape_bool: operation_result_zerodiv_int,
|
|
2618
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2619
|
+
tshape_complex: (
|
|
2620
|
+
operation_result_zerodiv_complex
|
|
2621
|
+
if python_version < 0x300
|
|
2622
|
+
else operation_result_unsupported_mod
|
|
2623
|
+
),
|
|
2624
|
+
# Unsupported:
|
|
2625
|
+
tshape_str: operation_result_unsupported_mod,
|
|
2626
|
+
tshape_bytes: operation_result_unsupported_mod,
|
|
2627
|
+
tshape_bytearray: operation_result_unsupported_mod,
|
|
2628
|
+
tshape_unicode: operation_result_unsupported_mod,
|
|
2629
|
+
tshape_tuple: operation_result_unsupported_mod,
|
|
2630
|
+
tshape_list: operation_result_unsupported_mod,
|
|
2631
|
+
tshape_set: operation_result_unsupported_mod,
|
|
2632
|
+
tshape_frozenset: operation_result_unsupported_mod,
|
|
2633
|
+
tshape_dict: operation_result_unsupported_mod,
|
|
2634
|
+
tshape_type: operation_result_unsupported_mod,
|
|
2635
|
+
tshape_none: operation_result_unsupported_mod,
|
|
2636
|
+
}
|
|
2637
|
+
)
|
|
2638
|
+
|
|
2639
|
+
pow_shapes_int.update(
|
|
2640
|
+
{
|
|
2641
|
+
# Standard
|
|
2642
|
+
tshape_unknown: operation_result_unknown,
|
|
2643
|
+
tshape_long_derived: operation_result_unknown,
|
|
2644
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2645
|
+
tshape_float_derived: operation_result_unknown,
|
|
2646
|
+
tshape_str_derived: operation_result_unknown,
|
|
2647
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2648
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2649
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2650
|
+
tshape_int: operation_result_unknown, # TODO: operation_result_intorlongorfloat,
|
|
2651
|
+
tshape_long: operation_result_unknown, # TODO: operation_result_longorfloat,
|
|
2652
|
+
tshape_int_or_long: operation_result_unknown, # TODO: operation_result_intorlongorfloat,
|
|
2653
|
+
tshape_bool: operation_result_int_noescape,
|
|
2654
|
+
tshape_float: operation_result_float_noescape,
|
|
2655
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2656
|
+
# Unsupported:
|
|
2657
|
+
tshape_str: operation_result_unsupported_pow,
|
|
2658
|
+
tshape_bytes: operation_result_unsupported_pow,
|
|
2659
|
+
tshape_bytearray: operation_result_unsupported_pow,
|
|
2660
|
+
tshape_unicode: operation_result_unsupported_pow,
|
|
2661
|
+
tshape_tuple: operation_result_unsupported_pow,
|
|
2662
|
+
tshape_list: operation_result_unsupported_pow,
|
|
2663
|
+
tshape_set: operation_result_unsupported_pow,
|
|
2664
|
+
tshape_frozenset: operation_result_unsupported_pow,
|
|
2665
|
+
tshape_dict: operation_result_unsupported_pow,
|
|
2666
|
+
tshape_type: operation_result_unsupported_pow,
|
|
2667
|
+
tshape_none: operation_result_unsupported_pow,
|
|
2668
|
+
}
|
|
2669
|
+
)
|
|
2670
|
+
|
|
2671
|
+
bitor_shapes_int.update(
|
|
2672
|
+
{
|
|
2673
|
+
# Standard
|
|
2674
|
+
tshape_unknown: operation_result_unknown,
|
|
2675
|
+
tshape_long_derived: operation_result_unknown,
|
|
2676
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2677
|
+
tshape_float_derived: operation_result_unknown,
|
|
2678
|
+
tshape_str_derived: operation_result_unknown,
|
|
2679
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2680
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2681
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2682
|
+
tshape_int: operation_result_int_noescape,
|
|
2683
|
+
tshape_long: operation_result_long_noescape,
|
|
2684
|
+
tshape_int_or_long: operation_result_intorlong_noescape,
|
|
2685
|
+
tshape_bool: operation_result_int_noescape,
|
|
2686
|
+
# Unsupported:
|
|
2687
|
+
tshape_float: operation_result_unsupported_bitor,
|
|
2688
|
+
tshape_complex: operation_result_unsupported_bitor,
|
|
2689
|
+
tshape_str: operation_result_unsupported_bitor,
|
|
2690
|
+
tshape_bytes: operation_result_unsupported_bitor,
|
|
2691
|
+
tshape_bytearray: operation_result_unsupported_bitor,
|
|
2692
|
+
tshape_unicode: operation_result_unsupported_bitor,
|
|
2693
|
+
tshape_tuple: operation_result_unsupported_bitor,
|
|
2694
|
+
tshape_list: operation_result_unsupported_bitor,
|
|
2695
|
+
tshape_set: operation_result_unsupported_bitor,
|
|
2696
|
+
tshape_frozenset: operation_result_unsupported_bitor,
|
|
2697
|
+
tshape_dict: operation_result_unsupported_bitor,
|
|
2698
|
+
tshape_type: operation_result_unsupported_bitor,
|
|
2699
|
+
tshape_none: operation_result_unsupported_bitor,
|
|
2700
|
+
}
|
|
2701
|
+
)
|
|
2702
|
+
|
|
2703
|
+
bitand_shapes_int.update(
|
|
2704
|
+
cloneWithUnsupportedChange(bitor_shapes_int, operation_result_unsupported_bitand)
|
|
2705
|
+
)
|
|
2706
|
+
bitxor_shapes_int.update(
|
|
2707
|
+
cloneWithUnsupportedChange(bitor_shapes_int, operation_result_unsupported_bitand)
|
|
2708
|
+
)
|
|
2709
|
+
|
|
2710
|
+
lshift_shapes_int.update(
|
|
2711
|
+
{
|
|
2712
|
+
# Standard
|
|
2713
|
+
tshape_unknown: operation_result_unknown,
|
|
2714
|
+
tshape_long_derived: operation_result_unknown,
|
|
2715
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2716
|
+
tshape_float_derived: operation_result_unknown,
|
|
2717
|
+
tshape_str_derived: operation_result_unknown,
|
|
2718
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2719
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2720
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2721
|
+
tshape_int: operation_result_valueerror_intorlong,
|
|
2722
|
+
tshape_long: operation_result_valueerror_long,
|
|
2723
|
+
tshape_int_or_long: operation_result_valueerror_intorlong,
|
|
2724
|
+
tshape_bool: operation_result_valueerror_intorlong,
|
|
2725
|
+
# Unsupported:
|
|
2726
|
+
tshape_float: operation_result_unsupported_lshift,
|
|
2727
|
+
tshape_complex: operation_result_unsupported_lshift,
|
|
2728
|
+
tshape_str: operation_result_unsupported_lshift,
|
|
2729
|
+
tshape_bytes: operation_result_unsupported_lshift,
|
|
2730
|
+
tshape_bytearray: operation_result_unsupported_lshift,
|
|
2731
|
+
tshape_unicode: operation_result_unsupported_lshift,
|
|
2732
|
+
tshape_tuple: operation_result_unsupported_lshift,
|
|
2733
|
+
tshape_list: operation_result_unsupported_lshift,
|
|
2734
|
+
tshape_set: operation_result_unsupported_lshift,
|
|
2735
|
+
tshape_frozenset: operation_result_unsupported_lshift,
|
|
2736
|
+
tshape_dict: operation_result_unsupported_lshift,
|
|
2737
|
+
tshape_type: operation_result_unsupported_lshift,
|
|
2738
|
+
tshape_none: operation_result_unsupported_lshift,
|
|
2739
|
+
}
|
|
2740
|
+
)
|
|
2741
|
+
rshift_shapes_int.update(
|
|
2742
|
+
cloneWithUnsupportedChange(lshift_shapes_int, operation_result_unsupported_rshift)
|
|
2743
|
+
)
|
|
2744
|
+
|
|
2745
|
+
|
|
2746
|
+
add_shapes_long.update(
|
|
2747
|
+
{
|
|
2748
|
+
# Standard
|
|
2749
|
+
tshape_unknown: operation_result_unknown,
|
|
2750
|
+
tshape_long_derived: operation_result_unknown,
|
|
2751
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2752
|
+
tshape_float_derived: operation_result_unknown,
|
|
2753
|
+
tshape_str_derived: operation_result_unknown,
|
|
2754
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2755
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2756
|
+
# Int might turn into long when growing due to possible overflow.
|
|
2757
|
+
tshape_int: operation_result_long_noescape,
|
|
2758
|
+
tshape_long: operation_result_long_noescape,
|
|
2759
|
+
tshape_int_or_long: operation_result_long_noescape,
|
|
2760
|
+
tshape_bool: operation_result_long_noescape,
|
|
2761
|
+
tshape_float: operation_result_float_noescape,
|
|
2762
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2763
|
+
# Sequence repeat:
|
|
2764
|
+
tshape_str: operation_result_unsupported_add,
|
|
2765
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
2766
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
2767
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
2768
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
2769
|
+
tshape_list: operation_result_unsupported_add,
|
|
2770
|
+
# Unsupported:
|
|
2771
|
+
tshape_set: operation_result_unsupported_add,
|
|
2772
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
2773
|
+
tshape_dict: operation_result_unsupported_add,
|
|
2774
|
+
tshape_type: operation_result_unsupported_add,
|
|
2775
|
+
tshape_none: operation_result_unsupported_add,
|
|
2776
|
+
}
|
|
2777
|
+
)
|
|
2778
|
+
|
|
2779
|
+
sub_shapes_long.update(
|
|
2780
|
+
{
|
|
2781
|
+
# Standard
|
|
2782
|
+
tshape_unknown: operation_result_unknown,
|
|
2783
|
+
tshape_long_derived: operation_result_unknown,
|
|
2784
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2785
|
+
tshape_float_derived: operation_result_unknown,
|
|
2786
|
+
tshape_str_derived: operation_result_unknown,
|
|
2787
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2788
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2789
|
+
# Int might turn into long when growing due to possible overflow.
|
|
2790
|
+
tshape_int: operation_result_long_noescape,
|
|
2791
|
+
tshape_long: operation_result_long_noescape,
|
|
2792
|
+
tshape_int_or_long: operation_result_long_noescape,
|
|
2793
|
+
tshape_bool: operation_result_long_noescape,
|
|
2794
|
+
tshape_float: operation_result_float_noescape,
|
|
2795
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2796
|
+
# Sequence repeat:
|
|
2797
|
+
tshape_str: operation_result_unsupported_sub,
|
|
2798
|
+
tshape_bytes: operation_result_unsupported_sub,
|
|
2799
|
+
tshape_bytearray: operation_result_unsupported_sub,
|
|
2800
|
+
tshape_unicode: operation_result_unsupported_sub,
|
|
2801
|
+
tshape_tuple: operation_result_unsupported_sub,
|
|
2802
|
+
tshape_list: operation_result_unsupported_sub,
|
|
2803
|
+
# Unsupported:
|
|
2804
|
+
tshape_set: operation_result_unsupported_sub,
|
|
2805
|
+
tshape_frozenset: operation_result_unsupported_sub,
|
|
2806
|
+
tshape_dict: operation_result_unsupported_sub,
|
|
2807
|
+
tshape_type: operation_result_unsupported_sub,
|
|
2808
|
+
tshape_none: operation_result_unsupported_sub,
|
|
2809
|
+
}
|
|
2810
|
+
)
|
|
2811
|
+
|
|
2812
|
+
|
|
2813
|
+
mult_shapes_long.update(
|
|
2814
|
+
{
|
|
2815
|
+
# Standard
|
|
2816
|
+
tshape_unknown: operation_result_unknown,
|
|
2817
|
+
tshape_long_derived: operation_result_unknown,
|
|
2818
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2819
|
+
tshape_float_derived: operation_result_unknown,
|
|
2820
|
+
tshape_str_derived: operation_result_unknown,
|
|
2821
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2822
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2823
|
+
# Int might turn into long when growing due to possible overflow.
|
|
2824
|
+
tshape_int: operation_result_long_noescape,
|
|
2825
|
+
tshape_long: operation_result_long_noescape,
|
|
2826
|
+
tshape_int_or_long: operation_result_long_noescape,
|
|
2827
|
+
tshape_bool: operation_result_long_noescape,
|
|
2828
|
+
tshape_float: operation_result_float_noescape,
|
|
2829
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2830
|
+
# Sequence repeat:
|
|
2831
|
+
tshape_str: operation_result_str_noescape,
|
|
2832
|
+
tshape_bytes: operation_result_bytes_noescape,
|
|
2833
|
+
tshape_bytearray: operation_result_bytearray_noescape,
|
|
2834
|
+
tshape_unicode: operation_result_unicode_noescape,
|
|
2835
|
+
tshape_tuple: operation_result_tuple_noescape,
|
|
2836
|
+
tshape_list: operation_result_list_noescape,
|
|
2837
|
+
# Unsupported:
|
|
2838
|
+
tshape_set: operation_result_unsupported_mul,
|
|
2839
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
2840
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
2841
|
+
tshape_type: operation_result_unsupported_mul,
|
|
2842
|
+
tshape_none: operation_result_unsupported_mul,
|
|
2843
|
+
}
|
|
2844
|
+
)
|
|
2845
|
+
|
|
2846
|
+
floordiv_shapes_long.update(
|
|
2847
|
+
{
|
|
2848
|
+
# Standard
|
|
2849
|
+
tshape_unknown: operation_result_unknown,
|
|
2850
|
+
tshape_long_derived: operation_result_unknown,
|
|
2851
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2852
|
+
tshape_float_derived: operation_result_unknown,
|
|
2853
|
+
tshape_str_derived: operation_result_unknown,
|
|
2854
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2855
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2856
|
+
# ints do math ops
|
|
2857
|
+
tshape_int: operation_result_zerodiv_long,
|
|
2858
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2859
|
+
tshape_int_or_long: operation_result_zerodiv_long,
|
|
2860
|
+
tshape_bool: operation_result_zerodiv_long,
|
|
2861
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2862
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2863
|
+
# Unsupported:
|
|
2864
|
+
tshape_str: operation_result_unsupported_floordiv,
|
|
2865
|
+
tshape_bytes: operation_result_unsupported_floordiv,
|
|
2866
|
+
tshape_bytearray: operation_result_unsupported_floordiv,
|
|
2867
|
+
tshape_unicode: operation_result_unsupported_floordiv,
|
|
2868
|
+
tshape_tuple: operation_result_unsupported_floordiv,
|
|
2869
|
+
tshape_list: operation_result_unsupported_floordiv,
|
|
2870
|
+
tshape_set: operation_result_unsupported_floordiv,
|
|
2871
|
+
tshape_frozenset: operation_result_unsupported_floordiv,
|
|
2872
|
+
tshape_dict: operation_result_unsupported_floordiv,
|
|
2873
|
+
tshape_type: operation_result_unsupported_floordiv,
|
|
2874
|
+
tshape_none: operation_result_unsupported_floordiv,
|
|
2875
|
+
}
|
|
2876
|
+
)
|
|
2877
|
+
|
|
2878
|
+
olddiv_shapes_long.update(
|
|
2879
|
+
{
|
|
2880
|
+
# Standard
|
|
2881
|
+
tshape_unknown: operation_result_unknown,
|
|
2882
|
+
tshape_long_derived: operation_result_unknown,
|
|
2883
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2884
|
+
tshape_float_derived: operation_result_unknown,
|
|
2885
|
+
tshape_str_derived: operation_result_unknown,
|
|
2886
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2887
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2888
|
+
# ints do math
|
|
2889
|
+
tshape_int: operation_result_zerodiv_long,
|
|
2890
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2891
|
+
tshape_int_or_long: operation_result_zerodiv_long,
|
|
2892
|
+
tshape_bool: operation_result_zerodiv_long,
|
|
2893
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2894
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
2895
|
+
# Unsupported:
|
|
2896
|
+
tshape_str: operation_result_unsupported_olddiv,
|
|
2897
|
+
tshape_bytes: operation_result_unsupported_olddiv,
|
|
2898
|
+
tshape_bytearray: operation_result_unsupported_olddiv,
|
|
2899
|
+
tshape_unicode: operation_result_unsupported_olddiv,
|
|
2900
|
+
tshape_tuple: operation_result_unsupported_olddiv,
|
|
2901
|
+
tshape_list: operation_result_unsupported_olddiv,
|
|
2902
|
+
tshape_set: operation_result_unsupported_olddiv,
|
|
2903
|
+
tshape_dict: operation_result_unsupported_olddiv,
|
|
2904
|
+
tshape_type: operation_result_unsupported_olddiv,
|
|
2905
|
+
tshape_none: operation_result_unsupported_olddiv,
|
|
2906
|
+
}
|
|
2907
|
+
)
|
|
2908
|
+
|
|
2909
|
+
mod_shapes_long.update(
|
|
2910
|
+
{
|
|
2911
|
+
# Standard
|
|
2912
|
+
tshape_unknown: operation_result_unknown,
|
|
2913
|
+
tshape_long_derived: operation_result_unknown,
|
|
2914
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2915
|
+
tshape_float_derived: operation_result_unknown,
|
|
2916
|
+
tshape_str_derived: operation_result_unknown,
|
|
2917
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2918
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2919
|
+
# ints do math
|
|
2920
|
+
tshape_int: operation_result_zerodiv_long,
|
|
2921
|
+
tshape_long: operation_result_zerodiv_long,
|
|
2922
|
+
tshape_int_or_long: operation_result_zerodiv_long,
|
|
2923
|
+
tshape_bool: operation_result_zerodiv_long,
|
|
2924
|
+
tshape_float: operation_result_zerodiv_float,
|
|
2925
|
+
tshape_complex: (
|
|
2926
|
+
operation_result_zerodiv_complex
|
|
2927
|
+
if python_version < 0x300
|
|
2928
|
+
else operation_result_unsupported_mod
|
|
2929
|
+
),
|
|
2930
|
+
# Unsupported:
|
|
2931
|
+
tshape_str: operation_result_unsupported_mod,
|
|
2932
|
+
tshape_bytes: operation_result_unsupported_mod,
|
|
2933
|
+
tshape_bytearray: operation_result_unsupported_mod,
|
|
2934
|
+
tshape_unicode: operation_result_unsupported_mod,
|
|
2935
|
+
tshape_tuple: operation_result_unsupported_mod,
|
|
2936
|
+
tshape_list: operation_result_unsupported_mod,
|
|
2937
|
+
tshape_set: operation_result_unsupported_mod,
|
|
2938
|
+
tshape_frozenset: operation_result_unsupported_mod,
|
|
2939
|
+
tshape_dict: operation_result_unsupported_mod,
|
|
2940
|
+
tshape_type: operation_result_unsupported_mod,
|
|
2941
|
+
tshape_none: operation_result_unsupported_mod,
|
|
2942
|
+
}
|
|
2943
|
+
)
|
|
2944
|
+
|
|
2945
|
+
pow_shapes_long.update(
|
|
2946
|
+
{
|
|
2947
|
+
# Standard
|
|
2948
|
+
tshape_unknown: operation_result_unknown,
|
|
2949
|
+
tshape_long_derived: operation_result_unknown,
|
|
2950
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2951
|
+
tshape_float_derived: operation_result_unknown,
|
|
2952
|
+
tshape_str_derived: operation_result_unknown,
|
|
2953
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2954
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2955
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
2956
|
+
tshape_int: operation_result_unknown, # TODO: operation_result_intorlongorfloat,
|
|
2957
|
+
tshape_long: operation_result_unknown, # TODO: operation_result_longorfloat,
|
|
2958
|
+
tshape_int_or_long: operation_result_unknown, # TODO: operation_result_intorlongorfloat,
|
|
2959
|
+
tshape_bool: operation_result_long_noescape,
|
|
2960
|
+
tshape_float: operation_result_float_noescape,
|
|
2961
|
+
tshape_complex: operation_result_complex_noescape,
|
|
2962
|
+
# Unsupported:
|
|
2963
|
+
tshape_str: operation_result_unsupported_pow,
|
|
2964
|
+
tshape_bytes: operation_result_unsupported_pow,
|
|
2965
|
+
tshape_bytearray: operation_result_unsupported_pow,
|
|
2966
|
+
tshape_unicode: operation_result_unsupported_pow,
|
|
2967
|
+
tshape_tuple: operation_result_unsupported_pow,
|
|
2968
|
+
tshape_list: operation_result_unsupported_pow,
|
|
2969
|
+
tshape_set: operation_result_unsupported_pow,
|
|
2970
|
+
tshape_frozenset: operation_result_unsupported_pow,
|
|
2971
|
+
tshape_dict: operation_result_unsupported_pow,
|
|
2972
|
+
tshape_type: operation_result_unsupported_pow,
|
|
2973
|
+
tshape_none: operation_result_unsupported_pow,
|
|
2974
|
+
}
|
|
2975
|
+
)
|
|
2976
|
+
|
|
2977
|
+
bitor_shapes_long.update(
|
|
2978
|
+
{
|
|
2979
|
+
# Standard
|
|
2980
|
+
tshape_unknown: operation_result_unknown,
|
|
2981
|
+
tshape_long_derived: operation_result_unknown,
|
|
2982
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
2983
|
+
tshape_float_derived: operation_result_unknown,
|
|
2984
|
+
tshape_str_derived: operation_result_unknown,
|
|
2985
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
2986
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
2987
|
+
# Long keep their type
|
|
2988
|
+
tshape_int: operation_result_long_noescape,
|
|
2989
|
+
tshape_long: operation_result_long_noescape,
|
|
2990
|
+
tshape_int_or_long: operation_result_long_noescape,
|
|
2991
|
+
tshape_bool: operation_result_long_noescape,
|
|
2992
|
+
# Unsupported:
|
|
2993
|
+
tshape_float: operation_result_unsupported_bitor,
|
|
2994
|
+
tshape_complex: operation_result_unsupported_bitor,
|
|
2995
|
+
tshape_str: operation_result_unsupported_bitor,
|
|
2996
|
+
tshape_bytes: operation_result_unsupported_bitor,
|
|
2997
|
+
tshape_bytearray: operation_result_unsupported_bitor,
|
|
2998
|
+
tshape_unicode: operation_result_unsupported_bitor,
|
|
2999
|
+
tshape_tuple: operation_result_unsupported_bitor,
|
|
3000
|
+
tshape_list: operation_result_unsupported_bitor,
|
|
3001
|
+
tshape_set: operation_result_unsupported_bitor,
|
|
3002
|
+
tshape_frozenset: operation_result_unsupported_bitor,
|
|
3003
|
+
tshape_dict: operation_result_unsupported_bitor,
|
|
3004
|
+
tshape_type: operation_result_unsupported_bitor,
|
|
3005
|
+
tshape_none: operation_result_unsupported_bitor,
|
|
3006
|
+
}
|
|
3007
|
+
)
|
|
3008
|
+
|
|
3009
|
+
bitand_shapes_long.update(
|
|
3010
|
+
cloneWithUnsupportedChange(bitor_shapes_long, operation_result_unsupported_bitand)
|
|
3011
|
+
)
|
|
3012
|
+
bitxor_shapes_long.update(
|
|
3013
|
+
cloneWithUnsupportedChange(bitor_shapes_long, operation_result_unsupported_bitand)
|
|
3014
|
+
)
|
|
3015
|
+
|
|
3016
|
+
lshift_shapes_long.update(
|
|
3017
|
+
{
|
|
3018
|
+
# Standard
|
|
3019
|
+
tshape_unknown: operation_result_unknown,
|
|
3020
|
+
tshape_long_derived: operation_result_unknown,
|
|
3021
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3022
|
+
tshape_float_derived: operation_result_unknown,
|
|
3023
|
+
tshape_str_derived: operation_result_unknown,
|
|
3024
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3025
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3026
|
+
# Long keep their type, as bool is 0 or 1 int.
|
|
3027
|
+
tshape_int: operation_result_valueerror_long,
|
|
3028
|
+
tshape_long: operation_result_valueerror_long,
|
|
3029
|
+
tshape_int_or_long: operation_result_valueerror_long,
|
|
3030
|
+
tshape_bool: operation_result_valueerror_long,
|
|
3031
|
+
# Unsupported:
|
|
3032
|
+
tshape_float: operation_result_unsupported_lshift,
|
|
3033
|
+
tshape_complex: operation_result_unsupported_lshift,
|
|
3034
|
+
tshape_str: operation_result_unsupported_lshift,
|
|
3035
|
+
tshape_bytes: operation_result_unsupported_lshift,
|
|
3036
|
+
tshape_bytearray: operation_result_unsupported_lshift,
|
|
3037
|
+
tshape_unicode: operation_result_unsupported_lshift,
|
|
3038
|
+
tshape_tuple: operation_result_unsupported_lshift,
|
|
3039
|
+
tshape_list: operation_result_unsupported_lshift,
|
|
3040
|
+
tshape_set: operation_result_unsupported_lshift,
|
|
3041
|
+
tshape_frozenset: operation_result_unsupported_lshift,
|
|
3042
|
+
tshape_dict: operation_result_unsupported_lshift,
|
|
3043
|
+
tshape_type: operation_result_unsupported_lshift,
|
|
3044
|
+
tshape_none: operation_result_unsupported_lshift,
|
|
3045
|
+
}
|
|
3046
|
+
)
|
|
3047
|
+
rshift_shapes_long.update(
|
|
3048
|
+
cloneWithUnsupportedChange(lshift_shapes_long, operation_result_unsupported_rshift)
|
|
3049
|
+
)
|
|
3050
|
+
|
|
3051
|
+
|
|
3052
|
+
def mergeIntOrLong(op_shapes_int, op_shapes_long):
|
|
3053
|
+
r = {}
|
|
3054
|
+
|
|
3055
|
+
for key, value in op_shapes_int.items():
|
|
3056
|
+
value2 = op_shapes_long[key]
|
|
3057
|
+
|
|
3058
|
+
if value is value2:
|
|
3059
|
+
r[key] = value
|
|
3060
|
+
elif value[0] is tshape_int_or_long and value2[0] is tshape_long:
|
|
3061
|
+
assert value[1] is value2[1]
|
|
3062
|
+
|
|
3063
|
+
r[key] = value
|
|
3064
|
+
elif value[0] is tshape_int and value2[0] is tshape_long:
|
|
3065
|
+
assert value[1] is value2[1]
|
|
3066
|
+
|
|
3067
|
+
if value[1] is operation_result_intorlong_noescape[1]:
|
|
3068
|
+
r[key] = operation_result_intorlong_noescape
|
|
3069
|
+
elif value[1] is operation_result_zerodiv_intorlong[1]:
|
|
3070
|
+
r[key] = operation_result_zerodiv_intorlong
|
|
3071
|
+
else:
|
|
3072
|
+
assert False
|
|
3073
|
+
else:
|
|
3074
|
+
assert False, (key, "->", value, "!=", value2)
|
|
3075
|
+
|
|
3076
|
+
return r
|
|
3077
|
+
|
|
3078
|
+
|
|
3079
|
+
add_shapes_intorlong.update(mergeIntOrLong(add_shapes_int, add_shapes_long))
|
|
3080
|
+
sub_shapes_intorlong.update(mergeIntOrLong(sub_shapes_int, sub_shapes_long))
|
|
3081
|
+
mult_shapes_intorlong.update(mergeIntOrLong(mult_shapes_int, mult_shapes_long))
|
|
3082
|
+
floordiv_shapes_intorlong.update(
|
|
3083
|
+
mergeIntOrLong(floordiv_shapes_int, floordiv_shapes_long)
|
|
3084
|
+
)
|
|
3085
|
+
truediv_shapes_intorlong.update(mergeIntOrLong(truediv_shapes_int, truediv_shapes_long))
|
|
3086
|
+
olddiv_shapes_intorlong.update(mergeIntOrLong(olddiv_shapes_int, olddiv_shapes_long))
|
|
3087
|
+
mod_shapes_intorlong.update(mergeIntOrLong(mod_shapes_int, mod_shapes_long))
|
|
3088
|
+
divmod_shapes_intorlong.update(mergeIntOrLong(divmod_shapes_int, divmod_shapes_long))
|
|
3089
|
+
pow_shapes_intorlong.update(mergeIntOrLong(pow_shapes_int, pow_shapes_long))
|
|
3090
|
+
lshift_shapes_intorlong.update(mergeIntOrLong(lshift_shapes_int, lshift_shapes_long))
|
|
3091
|
+
rshift_shapes_intorlong.update(mergeIntOrLong(rshift_shapes_int, rshift_shapes_long))
|
|
3092
|
+
bitor_shapes_intorlong.update(mergeIntOrLong(bitor_shapes_int, bitor_shapes_long))
|
|
3093
|
+
bitand_shapes_intorlong.update(mergeIntOrLong(bitand_shapes_int, bitand_shapes_long))
|
|
3094
|
+
bitxor_shapes_intorlong.update(mergeIntOrLong(bitxor_shapes_int, bitxor_shapes_long))
|
|
3095
|
+
|
|
3096
|
+
add_shapes_float.update(
|
|
3097
|
+
{
|
|
3098
|
+
# Standard
|
|
3099
|
+
tshape_unknown: operation_result_unknown,
|
|
3100
|
+
tshape_long_derived: operation_result_unknown,
|
|
3101
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3102
|
+
tshape_float_derived: operation_result_unknown,
|
|
3103
|
+
tshape_str_derived: operation_result_unknown,
|
|
3104
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3105
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3106
|
+
# Int might turn into long when growing due to possible overflow.
|
|
3107
|
+
tshape_int: operation_result_float_noescape,
|
|
3108
|
+
tshape_long: operation_result_float_noescape,
|
|
3109
|
+
tshape_int_or_long: operation_result_float_noescape,
|
|
3110
|
+
tshape_bool: operation_result_float_noescape,
|
|
3111
|
+
tshape_float: operation_result_float_noescape,
|
|
3112
|
+
tshape_complex: operation_result_complex_noescape,
|
|
3113
|
+
# Sequence repeat is not allowed
|
|
3114
|
+
tshape_str: operation_result_unsupported_add,
|
|
3115
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
3116
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
3117
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
3118
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
3119
|
+
tshape_list: operation_result_unsupported_add,
|
|
3120
|
+
# Unsupported:
|
|
3121
|
+
tshape_set: operation_result_unsupported_add,
|
|
3122
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3123
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3124
|
+
tshape_type: operation_result_unsupported_add,
|
|
3125
|
+
tshape_none: operation_result_unsupported_add,
|
|
3126
|
+
}
|
|
3127
|
+
)
|
|
3128
|
+
|
|
3129
|
+
sub_shapes_float.update(
|
|
3130
|
+
{
|
|
3131
|
+
# Standard
|
|
3132
|
+
tshape_unknown: operation_result_unknown,
|
|
3133
|
+
tshape_long_derived: operation_result_unknown,
|
|
3134
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3135
|
+
tshape_float_derived: operation_result_unknown,
|
|
3136
|
+
tshape_str_derived: operation_result_unknown,
|
|
3137
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3138
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3139
|
+
# Int might turn into long when growing due to possible overflow.
|
|
3140
|
+
tshape_int: operation_result_float_noescape,
|
|
3141
|
+
tshape_long: operation_result_float_noescape,
|
|
3142
|
+
tshape_int_or_long: operation_result_float_noescape,
|
|
3143
|
+
tshape_bool: operation_result_float_noescape,
|
|
3144
|
+
tshape_float: operation_result_float_noescape,
|
|
3145
|
+
tshape_complex: operation_result_complex_noescape,
|
|
3146
|
+
# Sequence repeat is not allowed
|
|
3147
|
+
tshape_str: operation_result_unsupported_sub,
|
|
3148
|
+
tshape_bytes: operation_result_unsupported_sub,
|
|
3149
|
+
tshape_bytearray: operation_result_unsupported_sub,
|
|
3150
|
+
tshape_unicode: operation_result_unsupported_sub,
|
|
3151
|
+
tshape_tuple: operation_result_unsupported_sub,
|
|
3152
|
+
tshape_list: operation_result_unsupported_sub,
|
|
3153
|
+
# Unsupported:
|
|
3154
|
+
tshape_set: operation_result_unsupported_sub,
|
|
3155
|
+
tshape_frozenset: operation_result_unsupported_sub,
|
|
3156
|
+
tshape_dict: operation_result_unsupported_sub,
|
|
3157
|
+
tshape_type: operation_result_unsupported_sub,
|
|
3158
|
+
tshape_none: operation_result_unsupported_sub,
|
|
3159
|
+
}
|
|
3160
|
+
)
|
|
3161
|
+
|
|
3162
|
+
|
|
3163
|
+
mult_shapes_float.update(
|
|
3164
|
+
{
|
|
3165
|
+
# Standard
|
|
3166
|
+
tshape_unknown: operation_result_unknown,
|
|
3167
|
+
tshape_long_derived: operation_result_unknown,
|
|
3168
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3169
|
+
tshape_float_derived: operation_result_unknown,
|
|
3170
|
+
tshape_str_derived: operation_result_unknown,
|
|
3171
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3172
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3173
|
+
# Int might turn into long when growing due to possible overflow.
|
|
3174
|
+
tshape_int: operation_result_float_noescape,
|
|
3175
|
+
tshape_long: operation_result_float_noescape,
|
|
3176
|
+
tshape_int_or_long: operation_result_float_noescape,
|
|
3177
|
+
tshape_bool: operation_result_float_noescape,
|
|
3178
|
+
tshape_float: operation_result_float_noescape,
|
|
3179
|
+
tshape_complex: operation_result_complex_noescape,
|
|
3180
|
+
# Sequence repeat is not allowed
|
|
3181
|
+
tshape_str: operation_result_unsupported_mul,
|
|
3182
|
+
tshape_bytes: operation_result_unsupported_mul,
|
|
3183
|
+
tshape_bytearray: operation_result_unsupported_mul,
|
|
3184
|
+
tshape_unicode: operation_result_unsupported_mul,
|
|
3185
|
+
tshape_tuple: operation_result_unsupported_mul,
|
|
3186
|
+
tshape_list: operation_result_unsupported_mul,
|
|
3187
|
+
# Unsupported:
|
|
3188
|
+
tshape_set: operation_result_unsupported_mul,
|
|
3189
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
3190
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
3191
|
+
tshape_type: operation_result_unsupported_mul,
|
|
3192
|
+
tshape_none: operation_result_unsupported_mul,
|
|
3193
|
+
}
|
|
3194
|
+
)
|
|
3195
|
+
|
|
3196
|
+
floordiv_shapes_float.update(
|
|
3197
|
+
{
|
|
3198
|
+
# Standard
|
|
3199
|
+
tshape_unknown: operation_result_unknown,
|
|
3200
|
+
tshape_long_derived: operation_result_unknown,
|
|
3201
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3202
|
+
tshape_float_derived: operation_result_unknown,
|
|
3203
|
+
tshape_str_derived: operation_result_unknown,
|
|
3204
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3205
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3206
|
+
# floats do math ops
|
|
3207
|
+
tshape_int: operation_result_zerodiv_float,
|
|
3208
|
+
tshape_long: operation_result_zerodiv_float,
|
|
3209
|
+
tshape_int_or_long: operation_result_zerodiv_float,
|
|
3210
|
+
tshape_bool: operation_result_zerodiv_float,
|
|
3211
|
+
tshape_float: operation_result_zerodiv_float,
|
|
3212
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
3213
|
+
# Unsupported:
|
|
3214
|
+
tshape_str: operation_result_unsupported_floordiv,
|
|
3215
|
+
tshape_bytes: operation_result_unsupported_floordiv,
|
|
3216
|
+
tshape_bytearray: operation_result_unsupported_floordiv,
|
|
3217
|
+
tshape_unicode: operation_result_unsupported_floordiv,
|
|
3218
|
+
tshape_tuple: operation_result_unsupported_floordiv,
|
|
3219
|
+
tshape_list: operation_result_unsupported_floordiv,
|
|
3220
|
+
tshape_set: operation_result_unsupported_floordiv,
|
|
3221
|
+
tshape_frozenset: operation_result_unsupported_floordiv,
|
|
3222
|
+
tshape_dict: operation_result_unsupported_floordiv,
|
|
3223
|
+
tshape_type: operation_result_unsupported_floordiv,
|
|
3224
|
+
tshape_none: operation_result_unsupported_floordiv,
|
|
3225
|
+
}
|
|
3226
|
+
)
|
|
3227
|
+
|
|
3228
|
+
truediv_shapes_float.update(
|
|
3229
|
+
cloneWithUnsupportedChange(
|
|
3230
|
+
floordiv_shapes_float, operation_result_unsupported_truediv
|
|
3231
|
+
)
|
|
3232
|
+
)
|
|
3233
|
+
olddiv_shapes_float.update(
|
|
3234
|
+
cloneWithUnsupportedChange(
|
|
3235
|
+
floordiv_shapes_float, operation_result_unsupported_olddiv
|
|
3236
|
+
)
|
|
3237
|
+
)
|
|
3238
|
+
|
|
3239
|
+
mod_shapes_float.update(
|
|
3240
|
+
cloneWithUnsupportedChange(floordiv_shapes_float, operation_result_unsupported_mod)
|
|
3241
|
+
)
|
|
3242
|
+
|
|
3243
|
+
pow_shapes_float.update(
|
|
3244
|
+
{
|
|
3245
|
+
# Standard
|
|
3246
|
+
tshape_unknown: operation_result_unknown,
|
|
3247
|
+
tshape_long_derived: operation_result_unknown,
|
|
3248
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3249
|
+
tshape_float_derived: operation_result_unknown,
|
|
3250
|
+
tshape_str_derived: operation_result_unknown,
|
|
3251
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3252
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3253
|
+
# Int keep their type, as bool is 0 or 1 int.
|
|
3254
|
+
tshape_int: operation_result_zerodiv_float,
|
|
3255
|
+
tshape_long: operation_result_zerodiv_float,
|
|
3256
|
+
tshape_int_or_long: operation_result_zerodiv_float,
|
|
3257
|
+
tshape_bool: operation_result_float_noescape,
|
|
3258
|
+
tshape_float: operation_result_zerodiv_float,
|
|
3259
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
3260
|
+
# Unsupported:
|
|
3261
|
+
tshape_str: operation_result_unsupported_pow,
|
|
3262
|
+
tshape_bytes: operation_result_unsupported_pow,
|
|
3263
|
+
tshape_bytearray: operation_result_unsupported_pow,
|
|
3264
|
+
tshape_unicode: operation_result_unsupported_pow,
|
|
3265
|
+
tshape_tuple: operation_result_unsupported_pow,
|
|
3266
|
+
tshape_list: operation_result_unsupported_pow,
|
|
3267
|
+
tshape_set: operation_result_unsupported_pow,
|
|
3268
|
+
tshape_frozenset: operation_result_unsupported_pow,
|
|
3269
|
+
tshape_dict: operation_result_unsupported_pow,
|
|
3270
|
+
tshape_type: operation_result_unsupported_pow,
|
|
3271
|
+
tshape_none: operation_result_unsupported_pow,
|
|
3272
|
+
}
|
|
3273
|
+
)
|
|
3274
|
+
|
|
3275
|
+
add_shapes_complex.update(
|
|
3276
|
+
{
|
|
3277
|
+
# Standard
|
|
3278
|
+
tshape_unknown: operation_result_unknown,
|
|
3279
|
+
tshape_long_derived: operation_result_unknown,
|
|
3280
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3281
|
+
tshape_float_derived: operation_result_unknown,
|
|
3282
|
+
tshape_str_derived: operation_result_unknown,
|
|
3283
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3284
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3285
|
+
# Int might turn into long when growing due to possible overflow.
|
|
3286
|
+
tshape_int: operation_result_complex_noescape,
|
|
3287
|
+
tshape_long: operation_result_complex_noescape,
|
|
3288
|
+
tshape_int_or_long: operation_result_complex_noescape,
|
|
3289
|
+
tshape_bool: operation_result_complex_noescape,
|
|
3290
|
+
tshape_float: operation_result_complex_noescape,
|
|
3291
|
+
tshape_complex: operation_result_complex_noescape,
|
|
3292
|
+
# Sequence repeat is not allowed
|
|
3293
|
+
tshape_str: operation_result_unsupported_add,
|
|
3294
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
3295
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
3296
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
3297
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
3298
|
+
tshape_list: operation_result_unsupported_add,
|
|
3299
|
+
# Unsupported:
|
|
3300
|
+
tshape_set: operation_result_unsupported_add,
|
|
3301
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3302
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3303
|
+
tshape_type: operation_result_unsupported_add,
|
|
3304
|
+
tshape_none: operation_result_unsupported_add,
|
|
3305
|
+
}
|
|
3306
|
+
)
|
|
3307
|
+
|
|
3308
|
+
|
|
3309
|
+
sub_shapes_complex.update(
|
|
3310
|
+
{
|
|
3311
|
+
# Standard
|
|
3312
|
+
tshape_unknown: operation_result_unknown,
|
|
3313
|
+
tshape_long_derived: operation_result_unknown,
|
|
3314
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3315
|
+
tshape_float_derived: operation_result_unknown,
|
|
3316
|
+
tshape_str_derived: operation_result_unknown,
|
|
3317
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3318
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3319
|
+
# Int might turn into long when growing due to possible overflow.
|
|
3320
|
+
tshape_int: operation_result_complex_noescape,
|
|
3321
|
+
tshape_long: operation_result_complex_noescape,
|
|
3322
|
+
tshape_int_or_long: operation_result_complex_noescape,
|
|
3323
|
+
tshape_bool: operation_result_complex_noescape,
|
|
3324
|
+
tshape_float: operation_result_complex_noescape,
|
|
3325
|
+
tshape_complex: operation_result_complex_noescape,
|
|
3326
|
+
# Sequence repeat is not allowed
|
|
3327
|
+
tshape_str: operation_result_unsupported_sub,
|
|
3328
|
+
tshape_bytes: operation_result_unsupported_sub,
|
|
3329
|
+
tshape_bytearray: operation_result_unsupported_sub,
|
|
3330
|
+
tshape_unicode: operation_result_unsupported_sub,
|
|
3331
|
+
tshape_tuple: operation_result_unsupported_sub,
|
|
3332
|
+
tshape_list: operation_result_unsupported_sub,
|
|
3333
|
+
# Unsupported:
|
|
3334
|
+
tshape_set: operation_result_unsupported_sub,
|
|
3335
|
+
tshape_frozenset: operation_result_unsupported_sub,
|
|
3336
|
+
tshape_dict: operation_result_unsupported_sub,
|
|
3337
|
+
tshape_type: operation_result_unsupported_sub,
|
|
3338
|
+
tshape_none: operation_result_unsupported_sub,
|
|
3339
|
+
}
|
|
3340
|
+
)
|
|
3341
|
+
|
|
3342
|
+
mult_shapes_complex.update(
|
|
3343
|
+
{
|
|
3344
|
+
# Standard
|
|
3345
|
+
tshape_unknown: operation_result_unknown,
|
|
3346
|
+
tshape_long_derived: operation_result_unknown,
|
|
3347
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3348
|
+
tshape_float_derived: operation_result_unknown,
|
|
3349
|
+
tshape_str_derived: operation_result_unknown,
|
|
3350
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3351
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3352
|
+
# Int might turn into long when growing due to possible overflow.
|
|
3353
|
+
tshape_int: operation_result_complex_noescape,
|
|
3354
|
+
tshape_long: operation_result_complex_noescape,
|
|
3355
|
+
tshape_int_or_long: operation_result_complex_noescape,
|
|
3356
|
+
tshape_bool: operation_result_complex_noescape,
|
|
3357
|
+
tshape_float: operation_result_complex_noescape,
|
|
3358
|
+
tshape_complex: operation_result_complex_noescape,
|
|
3359
|
+
# Sequence repeat is not allowed
|
|
3360
|
+
tshape_str: operation_result_unsupported_mul,
|
|
3361
|
+
tshape_bytes: operation_result_unsupported_mul,
|
|
3362
|
+
tshape_bytearray: operation_result_unsupported_mul,
|
|
3363
|
+
tshape_unicode: operation_result_unsupported_mul,
|
|
3364
|
+
tshape_tuple: operation_result_unsupported_mul,
|
|
3365
|
+
tshape_list: operation_result_unsupported_mul,
|
|
3366
|
+
# Unsupported:
|
|
3367
|
+
tshape_set: operation_result_unsupported_mul,
|
|
3368
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
3369
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
3370
|
+
tshape_type: operation_result_unsupported_mul,
|
|
3371
|
+
tshape_none: operation_result_unsupported_mul,
|
|
3372
|
+
}
|
|
3373
|
+
)
|
|
3374
|
+
|
|
3375
|
+
truediv_shapes_complex.update(
|
|
3376
|
+
{
|
|
3377
|
+
# Standard
|
|
3378
|
+
tshape_unknown: operation_result_unknown,
|
|
3379
|
+
tshape_long_derived: operation_result_unknown,
|
|
3380
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3381
|
+
tshape_float_derived: operation_result_unknown,
|
|
3382
|
+
tshape_str_derived: operation_result_unknown,
|
|
3383
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3384
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3385
|
+
# floats do math ops
|
|
3386
|
+
tshape_int: operation_result_zerodiv_complex,
|
|
3387
|
+
tshape_long: operation_result_zerodiv_complex,
|
|
3388
|
+
tshape_int_or_long: operation_result_zerodiv_complex,
|
|
3389
|
+
tshape_bool: operation_result_zerodiv_complex,
|
|
3390
|
+
tshape_float: operation_result_zerodiv_complex,
|
|
3391
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
3392
|
+
# Unsupported:
|
|
3393
|
+
tshape_str: operation_result_unsupported_truediv,
|
|
3394
|
+
tshape_bytes: operation_result_unsupported_truediv,
|
|
3395
|
+
tshape_bytearray: operation_result_unsupported_truediv,
|
|
3396
|
+
tshape_unicode: operation_result_unsupported_truediv,
|
|
3397
|
+
tshape_tuple: operation_result_unsupported_truediv,
|
|
3398
|
+
tshape_list: operation_result_unsupported_truediv,
|
|
3399
|
+
tshape_set: operation_result_unsupported_truediv,
|
|
3400
|
+
tshape_frozenset: operation_result_unsupported_truediv,
|
|
3401
|
+
tshape_dict: operation_result_unsupported_truediv,
|
|
3402
|
+
tshape_type: operation_result_unsupported_truediv,
|
|
3403
|
+
tshape_none: operation_result_unsupported_truediv,
|
|
3404
|
+
}
|
|
3405
|
+
)
|
|
3406
|
+
|
|
3407
|
+
if python_version < 0x300:
|
|
3408
|
+
floordiv_shapes_complex.update(
|
|
3409
|
+
{
|
|
3410
|
+
# Standard
|
|
3411
|
+
tshape_unknown: operation_result_unknown,
|
|
3412
|
+
tshape_long_derived: operation_result_unknown,
|
|
3413
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3414
|
+
tshape_float_derived: operation_result_unknown,
|
|
3415
|
+
tshape_str_derived: operation_result_unknown,
|
|
3416
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3417
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3418
|
+
# floats do math ops
|
|
3419
|
+
tshape_int: operation_result_zerodiv_complex,
|
|
3420
|
+
tshape_long: operation_result_zerodiv_complex,
|
|
3421
|
+
tshape_int_or_long: operation_result_zerodiv_complex,
|
|
3422
|
+
tshape_bool: operation_result_zerodiv_complex,
|
|
3423
|
+
tshape_float: operation_result_zerodiv_complex,
|
|
3424
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
3425
|
+
# Unsupported:
|
|
3426
|
+
tshape_str: operation_result_unsupported_floordiv,
|
|
3427
|
+
tshape_bytes: operation_result_unsupported_floordiv,
|
|
3428
|
+
tshape_bytearray: operation_result_unsupported_floordiv,
|
|
3429
|
+
tshape_unicode: operation_result_unsupported_floordiv,
|
|
3430
|
+
tshape_tuple: operation_result_unsupported_floordiv,
|
|
3431
|
+
tshape_list: operation_result_unsupported_floordiv,
|
|
3432
|
+
tshape_set: operation_result_unsupported_floordiv,
|
|
3433
|
+
tshape_frozenset: operation_result_unsupported_floordiv,
|
|
3434
|
+
tshape_dict: operation_result_unsupported_floordiv,
|
|
3435
|
+
tshape_type: operation_result_unsupported_floordiv,
|
|
3436
|
+
tshape_none: operation_result_unsupported_floordiv,
|
|
3437
|
+
}
|
|
3438
|
+
)
|
|
3439
|
+
|
|
3440
|
+
olddiv_shapes_complex.update(
|
|
3441
|
+
cloneWithUnsupportedChange(
|
|
3442
|
+
truediv_shapes_complex, operation_result_unsupported_olddiv
|
|
3443
|
+
)
|
|
3444
|
+
)
|
|
3445
|
+
|
|
3446
|
+
mod_shapes_complex.update(
|
|
3447
|
+
cloneWithUnsupportedChange(truediv_shapes_complex, operation_result_unsupported_mod)
|
|
3448
|
+
)
|
|
3449
|
+
|
|
3450
|
+
pow_shapes_complex.update(
|
|
3451
|
+
{
|
|
3452
|
+
# Standard
|
|
3453
|
+
tshape_unknown: operation_result_unknown,
|
|
3454
|
+
tshape_long_derived: operation_result_unknown,
|
|
3455
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3456
|
+
tshape_float_derived: operation_result_unknown,
|
|
3457
|
+
tshape_str_derived: operation_result_unknown,
|
|
3458
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3459
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3460
|
+
tshape_int: operation_result_zerodiv_complex,
|
|
3461
|
+
tshape_long: operation_result_zerodiv_complex,
|
|
3462
|
+
tshape_int_or_long: operation_result_zerodiv_complex,
|
|
3463
|
+
tshape_bool: operation_result_complex_noescape,
|
|
3464
|
+
tshape_float: operation_result_zerodiv_complex,
|
|
3465
|
+
tshape_complex: operation_result_zerodiv_complex,
|
|
3466
|
+
# Unsupported:
|
|
3467
|
+
tshape_str: operation_result_unsupported_pow,
|
|
3468
|
+
tshape_bytes: operation_result_unsupported_pow,
|
|
3469
|
+
tshape_bytearray: operation_result_unsupported_pow,
|
|
3470
|
+
tshape_unicode: operation_result_unsupported_pow,
|
|
3471
|
+
tshape_tuple: operation_result_unsupported_pow,
|
|
3472
|
+
tshape_list: operation_result_unsupported_pow,
|
|
3473
|
+
tshape_set: operation_result_unsupported_pow,
|
|
3474
|
+
tshape_frozenset: operation_result_unsupported_pow,
|
|
3475
|
+
tshape_dict: operation_result_unsupported_pow,
|
|
3476
|
+
tshape_type: operation_result_unsupported_pow,
|
|
3477
|
+
tshape_none: operation_result_unsupported_pow,
|
|
3478
|
+
}
|
|
3479
|
+
)
|
|
3480
|
+
|
|
3481
|
+
add_shapes_tuple.update(
|
|
3482
|
+
{
|
|
3483
|
+
# Standard
|
|
3484
|
+
tshape_unknown: operation_result_unknown,
|
|
3485
|
+
tshape_long_derived: operation_result_unknown,
|
|
3486
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3487
|
+
tshape_float_derived: operation_result_unknown,
|
|
3488
|
+
tshape_str_derived: operation_result_unknown,
|
|
3489
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3490
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3491
|
+
# Int is sequence repeat
|
|
3492
|
+
tshape_int: operation_result_unsupported_add,
|
|
3493
|
+
tshape_long: operation_result_unsupported_add,
|
|
3494
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
3495
|
+
tshape_bool: operation_result_unsupported_add,
|
|
3496
|
+
tshape_float: operation_result_unsupported_add,
|
|
3497
|
+
tshape_complex: operation_result_unsupported_add,
|
|
3498
|
+
# Sequence mixing is not allowed
|
|
3499
|
+
tshape_str: operation_result_unsupported_add,
|
|
3500
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
3501
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
3502
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
3503
|
+
tshape_tuple: operation_result_tuple_noescape,
|
|
3504
|
+
tshape_list: operation_result_unsupported_add,
|
|
3505
|
+
# Unsupported:
|
|
3506
|
+
tshape_set: operation_result_unsupported_add,
|
|
3507
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3508
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3509
|
+
tshape_type: operation_result_unsupported_add,
|
|
3510
|
+
tshape_none: operation_result_unsupported_add,
|
|
3511
|
+
}
|
|
3512
|
+
)
|
|
3513
|
+
|
|
3514
|
+
mult_shapes_tuple.update(
|
|
3515
|
+
{
|
|
3516
|
+
# Standard
|
|
3517
|
+
tshape_unknown: operation_result_unknown,
|
|
3518
|
+
tshape_long_derived: operation_result_unknown,
|
|
3519
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3520
|
+
tshape_float_derived: operation_result_unknown,
|
|
3521
|
+
tshape_str_derived: operation_result_unknown,
|
|
3522
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3523
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3524
|
+
# Int is sequence repeat
|
|
3525
|
+
tshape_int: operation_result_tuple_noescape,
|
|
3526
|
+
tshape_long: operation_result_tuple_noescape,
|
|
3527
|
+
tshape_int_or_long: operation_result_tuple_noescape,
|
|
3528
|
+
tshape_bool: operation_result_tuple_noescape,
|
|
3529
|
+
tshape_float: operation_result_unsupported_mul,
|
|
3530
|
+
tshape_complex: operation_result_unsupported_mul,
|
|
3531
|
+
# Sequence repeat is not allowed
|
|
3532
|
+
tshape_str: operation_result_unsupported_mul,
|
|
3533
|
+
tshape_bytes: operation_result_unsupported_mul,
|
|
3534
|
+
tshape_bytearray: operation_result_unsupported_mul,
|
|
3535
|
+
tshape_unicode: operation_result_unsupported_mul,
|
|
3536
|
+
tshape_tuple: operation_result_unsupported_mul,
|
|
3537
|
+
tshape_list: operation_result_unsupported_mul,
|
|
3538
|
+
# Unsupported:
|
|
3539
|
+
tshape_set: operation_result_unsupported_mul,
|
|
3540
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
3541
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
3542
|
+
tshape_type: operation_result_unsupported_mul,
|
|
3543
|
+
tshape_none: operation_result_unsupported_mul,
|
|
3544
|
+
}
|
|
3545
|
+
)
|
|
3546
|
+
|
|
3547
|
+
add_shapes_list.update(
|
|
3548
|
+
{
|
|
3549
|
+
# Standard
|
|
3550
|
+
tshape_unknown: operation_result_unknown,
|
|
3551
|
+
tshape_long_derived: operation_result_unknown,
|
|
3552
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3553
|
+
tshape_float_derived: operation_result_unknown,
|
|
3554
|
+
tshape_str_derived: operation_result_unknown,
|
|
3555
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3556
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3557
|
+
tshape_int: operation_result_unsupported_add,
|
|
3558
|
+
tshape_long: operation_result_unsupported_add,
|
|
3559
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
3560
|
+
tshape_bool: operation_result_unsupported_add,
|
|
3561
|
+
tshape_float: operation_result_unsupported_add,
|
|
3562
|
+
tshape_complex: operation_result_unsupported_add,
|
|
3563
|
+
# Sequence concat mixing is not allowed except for list
|
|
3564
|
+
tshape_str: operation_result_unsupported_add,
|
|
3565
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
3566
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
3567
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
3568
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
3569
|
+
tshape_list: operation_result_list_noescape,
|
|
3570
|
+
tshape_set: operation_result_unsupported_add,
|
|
3571
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3572
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3573
|
+
tshape_type: operation_result_unsupported_add,
|
|
3574
|
+
tshape_none: operation_result_unsupported_add,
|
|
3575
|
+
}
|
|
3576
|
+
)
|
|
3577
|
+
|
|
3578
|
+
iadd_shapes_list.update(
|
|
3579
|
+
{
|
|
3580
|
+
# Standard
|
|
3581
|
+
tshape_unknown: operation_result_unknown,
|
|
3582
|
+
tshape_long_derived: operation_result_unknown,
|
|
3583
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3584
|
+
tshape_str_derived: operation_result_unknown,
|
|
3585
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3586
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3587
|
+
tshape_int: operation_result_unsupported_add,
|
|
3588
|
+
tshape_long: operation_result_unsupported_add,
|
|
3589
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
3590
|
+
tshape_bool: operation_result_unsupported_add,
|
|
3591
|
+
tshape_float: operation_result_unsupported_add,
|
|
3592
|
+
tshape_complex: operation_result_unsupported_add,
|
|
3593
|
+
# Sequence concat mixing is not allowed
|
|
3594
|
+
tshape_str: operation_result_list_noescape,
|
|
3595
|
+
tshape_bytes: operation_result_list_noescape,
|
|
3596
|
+
tshape_bytearray: operation_result_list_noescape,
|
|
3597
|
+
tshape_unicode: operation_result_list_noescape,
|
|
3598
|
+
tshape_tuple: operation_result_list_noescape,
|
|
3599
|
+
tshape_list: operation_result_list_noescape,
|
|
3600
|
+
tshape_set: operation_result_list_noescape,
|
|
3601
|
+
tshape_frozenset: operation_result_list_noescape,
|
|
3602
|
+
tshape_dict: operation_result_list_noescape,
|
|
3603
|
+
# Unsupported:
|
|
3604
|
+
tshape_type: operation_result_unsupported_add,
|
|
3605
|
+
tshape_none: operation_result_unsupported_add,
|
|
3606
|
+
}
|
|
3607
|
+
)
|
|
3608
|
+
|
|
3609
|
+
|
|
3610
|
+
# These multiply with nothing really.
|
|
3611
|
+
nothing_multiplicants = (
|
|
3612
|
+
tshape_none,
|
|
3613
|
+
tshape_set,
|
|
3614
|
+
tshape_dict,
|
|
3615
|
+
tshape_type,
|
|
3616
|
+
tshape_list_iterator,
|
|
3617
|
+
tshape_dict_iterator,
|
|
3618
|
+
tshape_set_iterator,
|
|
3619
|
+
tshape_tuple_iterator,
|
|
3620
|
+
)
|
|
3621
|
+
|
|
3622
|
+
|
|
3623
|
+
def updateNonMultiplicants(op_shapes):
|
|
3624
|
+
for shape in nothing_multiplicants:
|
|
3625
|
+
op_shapes[shape] = operation_result_unsupported_mul
|
|
3626
|
+
|
|
3627
|
+
|
|
3628
|
+
sequence_non_multiplicants = (
|
|
3629
|
+
tshape_float,
|
|
3630
|
+
tshape_str,
|
|
3631
|
+
tshape_bytes,
|
|
3632
|
+
tshape_bytearray,
|
|
3633
|
+
tshape_unicode,
|
|
3634
|
+
tshape_tuple,
|
|
3635
|
+
tshape_list,
|
|
3636
|
+
tshape_set,
|
|
3637
|
+
tshape_frozenset,
|
|
3638
|
+
tshape_dict,
|
|
3639
|
+
)
|
|
3640
|
+
|
|
3641
|
+
|
|
3642
|
+
def updateSequenceNonMultiplicants(op_shapes):
|
|
3643
|
+
updateNonMultiplicants(op_shapes)
|
|
3644
|
+
|
|
3645
|
+
for shape in sequence_non_multiplicants:
|
|
3646
|
+
op_shapes[shape] = operation_result_unsupported_mul
|
|
3647
|
+
|
|
3648
|
+
|
|
3649
|
+
mult_shapes_list.update(
|
|
3650
|
+
{
|
|
3651
|
+
# Standard
|
|
3652
|
+
tshape_unknown: operation_result_unknown,
|
|
3653
|
+
tshape_long_derived: operation_result_unknown,
|
|
3654
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3655
|
+
tshape_float_derived: operation_result_unknown,
|
|
3656
|
+
tshape_str_derived: operation_result_unknown,
|
|
3657
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3658
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3659
|
+
# Int is sequence repeat
|
|
3660
|
+
tshape_int: operation_result_list_noescape,
|
|
3661
|
+
tshape_long: operation_result_list_noescape,
|
|
3662
|
+
tshape_int_or_long: operation_result_list_noescape,
|
|
3663
|
+
tshape_bool: operation_result_list_noescape,
|
|
3664
|
+
}
|
|
3665
|
+
)
|
|
3666
|
+
|
|
3667
|
+
# Sequence repeat is not allowed with most types.
|
|
3668
|
+
updateSequenceNonMultiplicants(mult_shapes_list)
|
|
3669
|
+
|
|
3670
|
+
add_shapes_set.update(
|
|
3671
|
+
{
|
|
3672
|
+
# Standard
|
|
3673
|
+
tshape_unknown: operation_result_unknown,
|
|
3674
|
+
tshape_long_derived: operation_result_unknown,
|
|
3675
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3676
|
+
tshape_float_derived: operation_result_unknown,
|
|
3677
|
+
tshape_str_derived: operation_result_unknown,
|
|
3678
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3679
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3680
|
+
# Sets to do not multiply
|
|
3681
|
+
tshape_int: operation_result_unsupported_add,
|
|
3682
|
+
tshape_long: operation_result_unsupported_add,
|
|
3683
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
3684
|
+
tshape_bool: operation_result_unsupported_add,
|
|
3685
|
+
tshape_float: operation_result_unsupported_add,
|
|
3686
|
+
# Sequence repeat is not allowed
|
|
3687
|
+
tshape_str: operation_result_unsupported_add,
|
|
3688
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
3689
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
3690
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
3691
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
3692
|
+
tshape_list: operation_result_unsupported_add,
|
|
3693
|
+
# Unsupported:
|
|
3694
|
+
tshape_set: operation_result_unsupported_add,
|
|
3695
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3696
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3697
|
+
tshape_type: operation_result_unsupported_add,
|
|
3698
|
+
tshape_none: operation_result_unsupported_add,
|
|
3699
|
+
}
|
|
3700
|
+
)
|
|
3701
|
+
|
|
3702
|
+
sub_shapes_set.update(sub_shapes_none)
|
|
3703
|
+
sub_shapes_set[tshape_set] = operation_result_set_noescape
|
|
3704
|
+
sub_shapes_set[tshape_frozenset] = operation_result_set_noescape
|
|
3705
|
+
|
|
3706
|
+
bitor_shapes_set.update(bitor_shapes_none)
|
|
3707
|
+
bitor_shapes_set[tshape_set] = operation_result_set_noescape
|
|
3708
|
+
bitor_shapes_set[tshape_frozenset] = operation_result_set_noescape
|
|
3709
|
+
bitand_shapes_set.update(
|
|
3710
|
+
cloneWithUnsupportedChange(bitor_shapes_set, operation_result_unsupported_bitand)
|
|
3711
|
+
)
|
|
3712
|
+
bitxor_shapes_set.update(
|
|
3713
|
+
cloneWithUnsupportedChange(bitor_shapes_set, operation_result_unsupported_bitxor)
|
|
3714
|
+
)
|
|
3715
|
+
|
|
3716
|
+
add_shapes_frozenset.update(
|
|
3717
|
+
{
|
|
3718
|
+
# Standard
|
|
3719
|
+
tshape_unknown: operation_result_unknown,
|
|
3720
|
+
tshape_long_derived: operation_result_unknown,
|
|
3721
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3722
|
+
tshape_float_derived: operation_result_unknown,
|
|
3723
|
+
tshape_str_derived: operation_result_unknown,
|
|
3724
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3725
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3726
|
+
# Sets to do not multiply
|
|
3727
|
+
tshape_int: operation_result_unsupported_add,
|
|
3728
|
+
tshape_long: operation_result_unsupported_add,
|
|
3729
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
3730
|
+
tshape_bool: operation_result_unsupported_add,
|
|
3731
|
+
tshape_float: operation_result_unsupported_add,
|
|
3732
|
+
# Sequence repeat is not allowed
|
|
3733
|
+
tshape_str: operation_result_unsupported_add,
|
|
3734
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
3735
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
3736
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
3737
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
3738
|
+
tshape_list: operation_result_unsupported_add,
|
|
3739
|
+
tshape_set: operation_result_unsupported_add,
|
|
3740
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3741
|
+
# Unsupported:
|
|
3742
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3743
|
+
tshape_type: operation_result_unsupported_add,
|
|
3744
|
+
tshape_none: operation_result_unsupported_add,
|
|
3745
|
+
}
|
|
3746
|
+
)
|
|
3747
|
+
|
|
3748
|
+
sub_shapes_frozenset.update(sub_shapes_set)
|
|
3749
|
+
sub_shapes_frozenset[tshape_set] = operation_result_frozenset_noescape
|
|
3750
|
+
sub_shapes_frozenset[tshape_frozenset] = operation_result_frozenset_noescape
|
|
3751
|
+
|
|
3752
|
+
bitor_shapes_frozenset.update(bitor_shapes_none)
|
|
3753
|
+
bitor_shapes_frozenset[tshape_set] = operation_result_frozenset_noescape
|
|
3754
|
+
bitor_shapes_frozenset[tshape_frozenset] = operation_result_frozenset_noescape
|
|
3755
|
+
bitand_shapes_frozenset.update(
|
|
3756
|
+
cloneWithUnsupportedChange(
|
|
3757
|
+
bitor_shapes_frozenset, operation_result_unsupported_bitand
|
|
3758
|
+
)
|
|
3759
|
+
)
|
|
3760
|
+
bitxor_shapes_frozenset.update(
|
|
3761
|
+
cloneWithUnsupportedChange(
|
|
3762
|
+
bitor_shapes_frozenset, operation_result_unsupported_bitxor
|
|
3763
|
+
)
|
|
3764
|
+
)
|
|
3765
|
+
|
|
3766
|
+
add_shapes_dict.update(
|
|
3767
|
+
{
|
|
3768
|
+
# Standard
|
|
3769
|
+
tshape_unknown: operation_result_unknown,
|
|
3770
|
+
tshape_long_derived: operation_result_unknown,
|
|
3771
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3772
|
+
tshape_float_derived: operation_result_unknown,
|
|
3773
|
+
tshape_str_derived: operation_result_unknown,
|
|
3774
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3775
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3776
|
+
# Sets to do not multiply
|
|
3777
|
+
tshape_int: operation_result_unsupported_add,
|
|
3778
|
+
tshape_long: operation_result_unsupported_add,
|
|
3779
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
3780
|
+
tshape_bool: operation_result_unsupported_add,
|
|
3781
|
+
tshape_float: operation_result_unsupported_add,
|
|
3782
|
+
# Sequence repeat is not allowed
|
|
3783
|
+
tshape_str: operation_result_unsupported_add,
|
|
3784
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
3785
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
3786
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
3787
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
3788
|
+
tshape_list: operation_result_unsupported_add,
|
|
3789
|
+
# Unsupported:
|
|
3790
|
+
tshape_set: operation_result_unsupported_add,
|
|
3791
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3792
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3793
|
+
tshape_type: operation_result_unsupported_add,
|
|
3794
|
+
tshape_none: operation_result_unsupported_add,
|
|
3795
|
+
}
|
|
3796
|
+
)
|
|
3797
|
+
|
|
3798
|
+
add_shapes_str.update(
|
|
3799
|
+
{
|
|
3800
|
+
# Standard
|
|
3801
|
+
tshape_unknown: operation_result_unknown,
|
|
3802
|
+
tshape_long_derived: operation_result_unknown,
|
|
3803
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3804
|
+
tshape_float_derived: operation_result_unknown,
|
|
3805
|
+
tshape_str_derived: operation_result_unknown,
|
|
3806
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3807
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3808
|
+
# Int is sequence repeat
|
|
3809
|
+
tshape_int: operation_result_unsupported_add,
|
|
3810
|
+
tshape_long: operation_result_unsupported_add,
|
|
3811
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
3812
|
+
tshape_bool: operation_result_unsupported_add,
|
|
3813
|
+
tshape_float: operation_result_unsupported_add,
|
|
3814
|
+
# Sequence repeat is not allowed
|
|
3815
|
+
tshape_str: operation_result_str_noescape,
|
|
3816
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
3817
|
+
tshape_bytearray: (
|
|
3818
|
+
operation_result_bytearray_noescape
|
|
3819
|
+
if python_version < 0x300
|
|
3820
|
+
else operation_result_unsupported_add
|
|
3821
|
+
),
|
|
3822
|
+
tshape_unicode: operation_result_unicode_noescape,
|
|
3823
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
3824
|
+
tshape_list: operation_result_unsupported_add,
|
|
3825
|
+
# Unsupported:
|
|
3826
|
+
tshape_set: operation_result_unsupported_add,
|
|
3827
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3828
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3829
|
+
tshape_type: operation_result_unsupported_add,
|
|
3830
|
+
tshape_none: operation_result_unsupported_add,
|
|
3831
|
+
}
|
|
3832
|
+
)
|
|
3833
|
+
|
|
3834
|
+
mult_shapes_str.update(
|
|
3835
|
+
{
|
|
3836
|
+
# Standard
|
|
3837
|
+
tshape_unknown: operation_result_unknown,
|
|
3838
|
+
tshape_long_derived: operation_result_unknown,
|
|
3839
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3840
|
+
tshape_float_derived: operation_result_unknown,
|
|
3841
|
+
tshape_str_derived: operation_result_unknown,
|
|
3842
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3843
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3844
|
+
# Int is sequence repeat
|
|
3845
|
+
tshape_int: operation_result_str_noescape,
|
|
3846
|
+
tshape_long: operation_result_str_noescape,
|
|
3847
|
+
tshape_int_or_long: operation_result_str_noescape,
|
|
3848
|
+
tshape_bool: operation_result_str_noescape,
|
|
3849
|
+
tshape_float: operation_result_unsupported_mul,
|
|
3850
|
+
# Sequence repeat is not allowed
|
|
3851
|
+
tshape_str: operation_result_unsupported_mul,
|
|
3852
|
+
tshape_bytes: operation_result_unsupported_mul,
|
|
3853
|
+
tshape_bytearray: operation_result_unsupported_mul,
|
|
3854
|
+
tshape_unicode: operation_result_unsupported_mul,
|
|
3855
|
+
tshape_tuple: operation_result_unsupported_mul,
|
|
3856
|
+
tshape_list: operation_result_unsupported_mul,
|
|
3857
|
+
# Unsupported:
|
|
3858
|
+
tshape_set: operation_result_unsupported_mul,
|
|
3859
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
3860
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
3861
|
+
tshape_type: operation_result_unsupported_mul,
|
|
3862
|
+
tshape_none: operation_result_unsupported_mul,
|
|
3863
|
+
}
|
|
3864
|
+
)
|
|
3865
|
+
|
|
3866
|
+
mod_shapes_str.update(
|
|
3867
|
+
{
|
|
3868
|
+
# Standard, TODO: should be string, but may escape with exception.
|
|
3869
|
+
tshape_unknown: operation_result_unknown,
|
|
3870
|
+
tshape_long_derived: operation_result_unknown,
|
|
3871
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3872
|
+
tshape_float_derived: operation_result_unknown,
|
|
3873
|
+
tshape_str_derived: operation_result_unknown,
|
|
3874
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3875
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3876
|
+
# str formatting with all kinds of values
|
|
3877
|
+
tshape_int: operation_result_str_formaterror,
|
|
3878
|
+
tshape_long: operation_result_str_formaterror,
|
|
3879
|
+
tshape_int_or_long: operation_result_str_formaterror,
|
|
3880
|
+
tshape_bool: operation_result_str_formaterror,
|
|
3881
|
+
tshape_float: operation_result_str_formaterror,
|
|
3882
|
+
tshape_str: operation_result_str_formaterror,
|
|
3883
|
+
tshape_bytes: operation_result_str_formaterror,
|
|
3884
|
+
tshape_bytearray: operation_result_str_formaterror,
|
|
3885
|
+
tshape_unicode: operation_result_str_formaterror,
|
|
3886
|
+
tshape_tuple: operation_result_str_formaterror,
|
|
3887
|
+
tshape_list: operation_result_str_formaterror,
|
|
3888
|
+
tshape_set: operation_result_str_formaterror,
|
|
3889
|
+
tshape_frozenset: operation_result_str_formaterror,
|
|
3890
|
+
tshape_dict: operation_result_str_formaterror,
|
|
3891
|
+
tshape_type: operation_result_str_formaterror,
|
|
3892
|
+
tshape_none: operation_result_str_formaterror,
|
|
3893
|
+
}
|
|
3894
|
+
)
|
|
3895
|
+
|
|
3896
|
+
add_shapes_bytes.update(
|
|
3897
|
+
{
|
|
3898
|
+
# Standard
|
|
3899
|
+
tshape_unknown: operation_result_unknown,
|
|
3900
|
+
tshape_long_derived: operation_result_unknown,
|
|
3901
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3902
|
+
tshape_float_derived: operation_result_unknown,
|
|
3903
|
+
tshape_str_derived: operation_result_unknown,
|
|
3904
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3905
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3906
|
+
# Int is sequence repeat
|
|
3907
|
+
tshape_int: operation_result_unsupported_add,
|
|
3908
|
+
tshape_long: operation_result_unsupported_add,
|
|
3909
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
3910
|
+
tshape_bool: operation_result_unsupported_add,
|
|
3911
|
+
tshape_float: operation_result_unsupported_add,
|
|
3912
|
+
# Sequence repeat is not allowed
|
|
3913
|
+
tshape_str: operation_result_unsupported_add,
|
|
3914
|
+
tshape_bytes: operation_result_bytes_noescape,
|
|
3915
|
+
tshape_bytearray: operation_result_bytearray_noescape,
|
|
3916
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
3917
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
3918
|
+
tshape_list: operation_result_unsupported_add,
|
|
3919
|
+
# Unsupported:
|
|
3920
|
+
tshape_set: operation_result_unsupported_add,
|
|
3921
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
3922
|
+
tshape_dict: operation_result_unsupported_add,
|
|
3923
|
+
tshape_type: operation_result_unsupported_add,
|
|
3924
|
+
tshape_none: operation_result_unsupported_add,
|
|
3925
|
+
}
|
|
3926
|
+
)
|
|
3927
|
+
|
|
3928
|
+
mult_shapes_bytes.update(
|
|
3929
|
+
{
|
|
3930
|
+
# Standard
|
|
3931
|
+
tshape_unknown: operation_result_unknown,
|
|
3932
|
+
tshape_long_derived: operation_result_unknown,
|
|
3933
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3934
|
+
tshape_float_derived: operation_result_unknown,
|
|
3935
|
+
tshape_str_derived: operation_result_unknown,
|
|
3936
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3937
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3938
|
+
# Int is sequence repeat
|
|
3939
|
+
tshape_int: operation_result_bytes_noescape,
|
|
3940
|
+
tshape_long: operation_result_bytes_noescape,
|
|
3941
|
+
tshape_int_or_long: operation_result_bytes_noescape,
|
|
3942
|
+
tshape_bool: operation_result_bytes_noescape,
|
|
3943
|
+
tshape_float: operation_result_unsupported_mul,
|
|
3944
|
+
# Sequence repeat is not allowed
|
|
3945
|
+
tshape_str: operation_result_unsupported_mul,
|
|
3946
|
+
tshape_bytes: operation_result_unsupported_mul,
|
|
3947
|
+
tshape_bytearray: operation_result_unsupported_mul,
|
|
3948
|
+
tshape_unicode: operation_result_unsupported_mul,
|
|
3949
|
+
tshape_tuple: operation_result_unsupported_mul,
|
|
3950
|
+
tshape_list: operation_result_unsupported_mul,
|
|
3951
|
+
# Unsupported:
|
|
3952
|
+
tshape_set: operation_result_unsupported_mul,
|
|
3953
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
3954
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
3955
|
+
tshape_type: operation_result_unsupported_mul,
|
|
3956
|
+
tshape_none: operation_result_unsupported_mul,
|
|
3957
|
+
}
|
|
3958
|
+
)
|
|
3959
|
+
|
|
3960
|
+
if python_version < 0x350:
|
|
3961
|
+
operation_result_350_bytes_mod_noescape = operation_result_unsupported_mod
|
|
3962
|
+
else:
|
|
3963
|
+
operation_result_350_bytes_mod_noescape = operation_result_bytes_formaterror
|
|
3964
|
+
|
|
3965
|
+
mod_shapes_bytes.update(
|
|
3966
|
+
{
|
|
3967
|
+
# Standard, TODO: should be string, but may escape with exception.
|
|
3968
|
+
tshape_unknown: operation_result_unknown,
|
|
3969
|
+
tshape_long_derived: operation_result_unknown,
|
|
3970
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3971
|
+
tshape_float_derived: operation_result_unknown,
|
|
3972
|
+
tshape_str_derived: operation_result_unknown,
|
|
3973
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
3974
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
3975
|
+
# bytes formatting with all kinds of values
|
|
3976
|
+
tshape_int: operation_result_350_bytes_mod_noescape,
|
|
3977
|
+
tshape_bool: operation_result_350_bytes_mod_noescape,
|
|
3978
|
+
tshape_float: operation_result_350_bytes_mod_noescape,
|
|
3979
|
+
tshape_bytes: operation_result_350_bytes_mod_noescape,
|
|
3980
|
+
tshape_bytearray: operation_result_350_bytes_mod_noescape,
|
|
3981
|
+
tshape_unicode: operation_result_350_bytes_mod_noescape,
|
|
3982
|
+
tshape_tuple: operation_result_350_bytes_mod_noescape,
|
|
3983
|
+
tshape_list: operation_result_350_bytes_mod_noescape,
|
|
3984
|
+
tshape_set: operation_result_350_bytes_mod_noescape,
|
|
3985
|
+
tshape_frozenset: operation_result_350_bytes_mod_noescape,
|
|
3986
|
+
tshape_dict: operation_result_350_bytes_mod_noescape,
|
|
3987
|
+
tshape_type: operation_result_350_bytes_mod_noescape,
|
|
3988
|
+
tshape_none: operation_result_350_bytes_mod_noescape,
|
|
3989
|
+
}
|
|
3990
|
+
)
|
|
3991
|
+
|
|
3992
|
+
add_shapes_bytearray.update(
|
|
3993
|
+
{
|
|
3994
|
+
# Standard
|
|
3995
|
+
tshape_unknown: operation_result_unknown,
|
|
3996
|
+
tshape_long_derived: operation_result_unknown,
|
|
3997
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
3998
|
+
tshape_float_derived: operation_result_unknown,
|
|
3999
|
+
tshape_str_derived: operation_result_unknown,
|
|
4000
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
4001
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
4002
|
+
# Int is sequence repeat
|
|
4003
|
+
tshape_int: operation_result_unsupported_add,
|
|
4004
|
+
tshape_long: operation_result_unsupported_add,
|
|
4005
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
4006
|
+
tshape_bool: operation_result_unsupported_add,
|
|
4007
|
+
tshape_float: operation_result_unsupported_add,
|
|
4008
|
+
# Sequence repeat is not allowed
|
|
4009
|
+
tshape_str: (
|
|
4010
|
+
operation_result_bytearray_noescape
|
|
4011
|
+
if python_version < 0x300
|
|
4012
|
+
else operation_result_unsupported_add
|
|
4013
|
+
),
|
|
4014
|
+
tshape_bytes: operation_result_bytearray_noescape,
|
|
4015
|
+
tshape_bytearray: operation_result_bytearray_noescape,
|
|
4016
|
+
tshape_unicode: operation_result_unsupported_add,
|
|
4017
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
4018
|
+
tshape_list: operation_result_unsupported_add,
|
|
4019
|
+
# Unsupported:
|
|
4020
|
+
tshape_set: operation_result_unsupported_add,
|
|
4021
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
4022
|
+
tshape_dict: operation_result_unsupported_add,
|
|
4023
|
+
tshape_type: operation_result_unsupported_add,
|
|
4024
|
+
tshape_none: operation_result_unsupported_add,
|
|
4025
|
+
}
|
|
4026
|
+
)
|
|
4027
|
+
|
|
4028
|
+
mult_shapes_bytearray.update(
|
|
4029
|
+
{
|
|
4030
|
+
# Standard
|
|
4031
|
+
tshape_unknown: operation_result_unknown,
|
|
4032
|
+
tshape_long_derived: operation_result_unknown,
|
|
4033
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
4034
|
+
tshape_float_derived: operation_result_unknown,
|
|
4035
|
+
tshape_str_derived: operation_result_unknown,
|
|
4036
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
4037
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
4038
|
+
# Int is sequence repeat
|
|
4039
|
+
tshape_int: operation_result_bytearray_noescape,
|
|
4040
|
+
tshape_long: operation_result_bytearray_noescape,
|
|
4041
|
+
tshape_int_or_long: operation_result_bytearray_noescape,
|
|
4042
|
+
tshape_bool: operation_result_bytearray_noescape,
|
|
4043
|
+
tshape_float: operation_result_unsupported_mul,
|
|
4044
|
+
# Sequence repeat is not allowed
|
|
4045
|
+
tshape_str: operation_result_unsupported_mul,
|
|
4046
|
+
tshape_bytes: operation_result_unsupported_mul,
|
|
4047
|
+
tshape_bytearray: operation_result_unsupported_mul,
|
|
4048
|
+
tshape_unicode: operation_result_unsupported_mul,
|
|
4049
|
+
tshape_tuple: operation_result_unsupported_mul,
|
|
4050
|
+
tshape_list: operation_result_unsupported_mul,
|
|
4051
|
+
# Unsupported:
|
|
4052
|
+
tshape_set: operation_result_unsupported_mul,
|
|
4053
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
4054
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
4055
|
+
tshape_type: operation_result_unsupported_mul,
|
|
4056
|
+
tshape_none: operation_result_unsupported_mul,
|
|
4057
|
+
}
|
|
4058
|
+
)
|
|
4059
|
+
|
|
4060
|
+
if python_version < 0x350:
|
|
4061
|
+
operation_result_350_bytearray_mod_noescape = operation_result_unsupported_mod
|
|
4062
|
+
else:
|
|
4063
|
+
operation_result_350_bytearray_mod_noescape = operation_result_bytearray_formaterror
|
|
4064
|
+
|
|
4065
|
+
mod_shapes_bytearray.update(
|
|
4066
|
+
{
|
|
4067
|
+
tshape_unknown: operation_result_unknown,
|
|
4068
|
+
tshape_long_derived: operation_result_unknown,
|
|
4069
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
4070
|
+
tshape_float_derived: operation_result_unknown,
|
|
4071
|
+
tshape_str_derived: operation_result_unknown,
|
|
4072
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
4073
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
4074
|
+
# bytes formatting with all kinds of values
|
|
4075
|
+
tshape_int: operation_result_350_bytearray_mod_noescape,
|
|
4076
|
+
tshape_bool: operation_result_350_bytearray_mod_noescape,
|
|
4077
|
+
tshape_float: operation_result_350_bytearray_mod_noescape,
|
|
4078
|
+
tshape_bytes: operation_result_350_bytearray_mod_noescape,
|
|
4079
|
+
tshape_bytearray: operation_result_350_bytearray_mod_noescape,
|
|
4080
|
+
tshape_unicode: operation_result_350_bytearray_mod_noescape,
|
|
4081
|
+
tshape_tuple: operation_result_350_bytearray_mod_noescape,
|
|
4082
|
+
tshape_list: operation_result_350_bytearray_mod_noescape,
|
|
4083
|
+
tshape_set: operation_result_350_bytearray_mod_noescape,
|
|
4084
|
+
tshape_frozenset: operation_result_350_bytes_mod_noescape,
|
|
4085
|
+
tshape_dict: operation_result_350_bytearray_mod_noescape,
|
|
4086
|
+
tshape_type: operation_result_350_bytearray_mod_noescape,
|
|
4087
|
+
tshape_none: operation_result_350_bytearray_mod_noescape,
|
|
4088
|
+
}
|
|
4089
|
+
)
|
|
4090
|
+
|
|
4091
|
+
|
|
4092
|
+
add_shapes_unicode.update(
|
|
4093
|
+
{
|
|
4094
|
+
# Standard
|
|
4095
|
+
tshape_unknown: operation_result_unknown,
|
|
4096
|
+
tshape_long_derived: operation_result_unknown,
|
|
4097
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
4098
|
+
tshape_float_derived: operation_result_unknown,
|
|
4099
|
+
tshape_str_derived: operation_result_unknown,
|
|
4100
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
4101
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
4102
|
+
# Int is sequence repeat
|
|
4103
|
+
tshape_int: operation_result_unsupported_add,
|
|
4104
|
+
tshape_long: operation_result_unsupported_add,
|
|
4105
|
+
tshape_int_or_long: operation_result_unsupported_add,
|
|
4106
|
+
tshape_bool: operation_result_unsupported_add,
|
|
4107
|
+
tshape_float: operation_result_unsupported_add,
|
|
4108
|
+
# Sequence repeat is not allowed
|
|
4109
|
+
tshape_str: operation_result_unicode_noescape,
|
|
4110
|
+
tshape_bytes: operation_result_unsupported_add,
|
|
4111
|
+
tshape_bytearray: operation_result_unsupported_add,
|
|
4112
|
+
tshape_unicode: operation_result_unicode_noescape,
|
|
4113
|
+
tshape_tuple: operation_result_unsupported_add,
|
|
4114
|
+
tshape_list: operation_result_unsupported_add,
|
|
4115
|
+
# Unsupported:
|
|
4116
|
+
tshape_set: operation_result_unsupported_add,
|
|
4117
|
+
tshape_frozenset: operation_result_unsupported_add,
|
|
4118
|
+
tshape_dict: operation_result_unsupported_add,
|
|
4119
|
+
tshape_type: operation_result_unsupported_add,
|
|
4120
|
+
tshape_none: operation_result_unsupported_add,
|
|
4121
|
+
}
|
|
4122
|
+
)
|
|
4123
|
+
|
|
4124
|
+
mult_shapes_unicode.update(
|
|
4125
|
+
{
|
|
4126
|
+
# Standard
|
|
4127
|
+
tshape_unknown: operation_result_unknown,
|
|
4128
|
+
tshape_long_derived: operation_result_unknown,
|
|
4129
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
4130
|
+
tshape_float_derived: operation_result_unknown,
|
|
4131
|
+
tshape_str_derived: operation_result_unknown,
|
|
4132
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
4133
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
4134
|
+
# Int is sequence repeat
|
|
4135
|
+
tshape_int: operation_result_unicode_noescape,
|
|
4136
|
+
tshape_long: operation_result_unicode_noescape,
|
|
4137
|
+
tshape_int_or_long: operation_result_unicode_noescape,
|
|
4138
|
+
tshape_bool: operation_result_unicode_noescape,
|
|
4139
|
+
tshape_float: operation_result_unsupported_mul,
|
|
4140
|
+
# Sequence repeat is not allowed
|
|
4141
|
+
tshape_str: operation_result_unsupported_mul,
|
|
4142
|
+
tshape_bytes: operation_result_unsupported_mul,
|
|
4143
|
+
tshape_bytearray: operation_result_unsupported_mul,
|
|
4144
|
+
tshape_unicode: operation_result_unsupported_mul,
|
|
4145
|
+
tshape_tuple: operation_result_unsupported_mul,
|
|
4146
|
+
tshape_list: operation_result_unsupported_mul,
|
|
4147
|
+
# Unsupported:
|
|
4148
|
+
tshape_set: operation_result_unsupported_mul,
|
|
4149
|
+
tshape_frozenset: operation_result_unsupported_mul,
|
|
4150
|
+
tshape_dict: operation_result_unsupported_mul,
|
|
4151
|
+
tshape_type: operation_result_unsupported_mul,
|
|
4152
|
+
tshape_none: operation_result_unsupported_mul,
|
|
4153
|
+
}
|
|
4154
|
+
)
|
|
4155
|
+
|
|
4156
|
+
mod_shapes_unicode.update(
|
|
4157
|
+
{
|
|
4158
|
+
# Standard, TODO: should be unicode, but may escape with exception.
|
|
4159
|
+
tshape_unknown: operation_result_unknown,
|
|
4160
|
+
tshape_long_derived: operation_result_unknown,
|
|
4161
|
+
tshape_int_or_long_derived: operation_result_unknown,
|
|
4162
|
+
tshape_float_derived: operation_result_unknown,
|
|
4163
|
+
tshape_str_derived: operation_result_unknown,
|
|
4164
|
+
tshape_unicode_derived: operation_result_unknown,
|
|
4165
|
+
tshape_bytes_derived: operation_result_unknown,
|
|
4166
|
+
# str formatting with all kinds of values
|
|
4167
|
+
tshape_int: operation_result_unicode_formaterror,
|
|
4168
|
+
tshape_long: operation_result_unicode_formaterror,
|
|
4169
|
+
tshape_int_or_long: operation_result_unicode_formaterror,
|
|
4170
|
+
tshape_bool: operation_result_unicode_formaterror,
|
|
4171
|
+
tshape_float: operation_result_unicode_formaterror,
|
|
4172
|
+
tshape_str: operation_result_unicode_formaterror,
|
|
4173
|
+
tshape_bytes: operation_result_unicode_formaterror,
|
|
4174
|
+
tshape_bytearray: operation_result_unicode_formaterror,
|
|
4175
|
+
tshape_unicode: operation_result_unicode_formaterror,
|
|
4176
|
+
tshape_tuple: operation_result_unicode_formaterror,
|
|
4177
|
+
tshape_list: operation_result_unicode_formaterror,
|
|
4178
|
+
tshape_set: operation_result_unicode_formaterror,
|
|
4179
|
+
tshape_frozenset: operation_result_unicode_formaterror,
|
|
4180
|
+
tshape_dict: operation_result_unicode_formaterror,
|
|
4181
|
+
tshape_type: operation_result_unicode_formaterror,
|
|
4182
|
+
tshape_none: operation_result_unicode_formaterror,
|
|
4183
|
+
}
|
|
4184
|
+
)
|
|
4185
|
+
|
|
4186
|
+
|
|
4187
|
+
def mergeStrOrUnicode(op_shapes_str, op_shapes_unicode):
|
|
4188
|
+
r = {}
|
|
4189
|
+
|
|
4190
|
+
for key, value in op_shapes_str.items():
|
|
4191
|
+
value2 = op_shapes_unicode[key]
|
|
4192
|
+
|
|
4193
|
+
if value is value2:
|
|
4194
|
+
r[key] = value
|
|
4195
|
+
elif value[0] is tshape_str_or_unicode and value2[0] is tshape_unicode:
|
|
4196
|
+
assert value[1] is value2[1]
|
|
4197
|
+
|
|
4198
|
+
r[key] = value
|
|
4199
|
+
elif value[0] is tshape_str and value2[0] is tshape_unicode:
|
|
4200
|
+
# Actually as intended, pylint: disable=bad-chained-comparison
|
|
4201
|
+
assert (
|
|
4202
|
+
value[1]
|
|
4203
|
+
is value2[1]
|
|
4204
|
+
in (
|
|
4205
|
+
operation_result_strorunicode_noescape[1],
|
|
4206
|
+
ControlFlowDescriptionFormatError,
|
|
4207
|
+
)
|
|
4208
|
+
), (value, value2)
|
|
4209
|
+
|
|
4210
|
+
r[key] = operation_result_strorunicode_noescape
|
|
4211
|
+
elif key == tshape_bytearray:
|
|
4212
|
+
# They differ here on Python2
|
|
4213
|
+
r[key] = operation_result_unknown
|
|
4214
|
+
else:
|
|
4215
|
+
assert False, (key, "->", value, "!=", value2)
|
|
4216
|
+
|
|
4217
|
+
return r
|
|
4218
|
+
|
|
4219
|
+
|
|
4220
|
+
add_shapes_strorunicode.update(mergeStrOrUnicode(add_shapes_str, add_shapes_unicode))
|
|
4221
|
+
sub_shapes_strorunicode.update(mergeStrOrUnicode(sub_shapes_str, sub_shapes_unicode))
|
|
4222
|
+
mult_shapes_strorunicode.update(mergeStrOrUnicode(mult_shapes_str, mult_shapes_unicode))
|
|
4223
|
+
floordiv_shapes_strorunicode.update(
|
|
4224
|
+
mergeStrOrUnicode(floordiv_shapes_str, floordiv_shapes_unicode)
|
|
4225
|
+
)
|
|
4226
|
+
truediv_shapes_strorunicode.update(
|
|
4227
|
+
mergeStrOrUnicode(truediv_shapes_str, truediv_shapes_unicode)
|
|
4228
|
+
)
|
|
4229
|
+
olddiv_shapes_strorunicode.update(
|
|
4230
|
+
mergeStrOrUnicode(olddiv_shapes_str, olddiv_shapes_unicode)
|
|
4231
|
+
)
|
|
4232
|
+
mod_shapes_strorunicode.update(mergeStrOrUnicode(mod_shapes_str, mod_shapes_unicode))
|
|
4233
|
+
divmod_shapes_strorunicode.update(
|
|
4234
|
+
mergeStrOrUnicode(divmod_shapes_str, divmod_shapes_unicode)
|
|
4235
|
+
)
|
|
4236
|
+
pow_shapes_strorunicode.update(mergeStrOrUnicode(pow_shapes_str, pow_shapes_unicode))
|
|
4237
|
+
lshift_shapes_strorunicode.update(
|
|
4238
|
+
mergeStrOrUnicode(lshift_shapes_str, lshift_shapes_unicode)
|
|
4239
|
+
)
|
|
4240
|
+
rshift_shapes_strorunicode.update(
|
|
4241
|
+
mergeStrOrUnicode(rshift_shapes_str, rshift_shapes_unicode)
|
|
4242
|
+
)
|
|
4243
|
+
bitor_shapes_strorunicode.update(
|
|
4244
|
+
mergeStrOrUnicode(bitor_shapes_str, bitor_shapes_unicode)
|
|
4245
|
+
)
|
|
4246
|
+
bitand_shapes_strorunicode.update(
|
|
4247
|
+
mergeStrOrUnicode(bitand_shapes_str, bitand_shapes_unicode)
|
|
4248
|
+
)
|
|
4249
|
+
bitxor_shapes_strorunicode.update(
|
|
4250
|
+
mergeStrOrUnicode(bitxor_shapes_str, bitxor_shapes_unicode)
|
|
4251
|
+
)
|
|
4252
|
+
|
|
4253
|
+
if python_version >= 0x390:
|
|
4254
|
+
bitor_shapes_dict[tshape_dict] = operation_result_dict_noescape
|
|
4255
|
+
|
|
4256
|
+
ibitor_shapes_dict[tshape_dict] = operation_result_dict_noescape
|
|
4257
|
+
ibitor_shapes_dict[tshape_tuple] = operation_result_dict_valueerror
|
|
4258
|
+
ibitor_shapes_dict[tshape_list] = operation_result_dict_valueerror
|
|
4259
|
+
ibitor_shapes_dict[tshape_set] = operation_result_dict_valueerror
|
|
4260
|
+
ibitor_shapes_dict[tshape_frozenset] = operation_result_dict_valueerror
|
|
4261
|
+
ibitor_shapes_dict[tshape_str] = operation_result_dict_valueerror
|
|
4262
|
+
ibitor_shapes_dict[tshape_bytes] = operation_result_dict_valueerror
|
|
4263
|
+
ibitor_shapes_dict[tshape_bytearray] = operation_result_dict_valueerror
|
|
4264
|
+
|
|
4265
|
+
|
|
4266
|
+
class ShapeTypeBuiltinExceptionClass(
|
|
4267
|
+
ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase
|
|
4268
|
+
):
|
|
4269
|
+
__slots__ = ()
|
|
4270
|
+
|
|
4271
|
+
# TODO: Add a typical value, that should be easy.
|
|
4272
|
+
typical_value = None
|
|
4273
|
+
|
|
4274
|
+
|
|
4275
|
+
tshape_exception_class = ShapeTypeBuiltinExceptionClass()
|
|
4276
|
+
|
|
4277
|
+
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
4278
|
+
# integrates with CPython, but also works on its own.
|
|
4279
|
+
#
|
|
4280
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4281
|
+
# you may not use this file except in compliance with the License.
|
|
4282
|
+
# You may obtain a copy of the License at
|
|
4283
|
+
#
|
|
4284
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
4285
|
+
#
|
|
4286
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
4287
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
4288
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4289
|
+
# See the License for the specific language governing permissions and
|
|
4290
|
+
# limitations under the License.
|