Nuitka-winsvc 2.3.11__cp311-cp311-win_amd64.whl → 2.4.1__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Nuitka-winsvc might be problematic. Click here for more details.

Files changed (210) hide show
  1. Nuitka_winsvc-2.3.11.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.1.data/scripts/nuitka-run.cmd +1 -1
  2. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/METADATA +1 -1
  3. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/RECORD +210 -207
  4. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/WHEEL +1 -1
  5. nuitka/CacheCleanup.py +6 -1
  6. nuitka/HardImportRegistry.py +29 -2
  7. nuitka/MainControl.py +62 -35
  8. nuitka/ModuleRegistry.py +11 -3
  9. nuitka/OptionParsing.py +78 -39
  10. nuitka/Options.py +142 -35
  11. nuitka/OutputDirectories.py +5 -0
  12. nuitka/PostProcessing.py +23 -14
  13. nuitka/PythonFlavors.py +22 -4
  14. nuitka/PythonVersions.py +18 -0
  15. nuitka/TreeXML.py +6 -3
  16. nuitka/Version.py +1 -1
  17. nuitka/__main__.py +55 -10
  18. nuitka/build/Backend.scons +6 -1
  19. nuitka/build/CCompilerVersion.scons +1 -0
  20. nuitka/build/Onefile.scons +4 -0
  21. nuitka/build/SconsCaching.py +1 -0
  22. nuitka/build/SconsCompilerSettings.py +1 -0
  23. nuitka/build/SconsHacks.py +5 -1
  24. nuitka/build/SconsInterface.py +2 -0
  25. nuitka/build/SconsUtils.py +4 -1
  26. nuitka/build/include/nuitka/allocator.h +27 -5
  27. nuitka/build/include/nuitka/calling.h +1 -1
  28. nuitka/build/include/nuitka/compiled_frame.h +23 -23
  29. nuitka/build/include/nuitka/compiled_method.h +1 -1
  30. nuitka/build/include/nuitka/exception_groups.h +0 -2
  31. nuitka/build/include/nuitka/helper/attributes.h +7 -1
  32. nuitka/build/include/nuitka/helper/subscripts.h +1 -1
  33. nuitka/build/include/nuitka/helpers.h +7 -4
  34. nuitka/build/include/nuitka/prelude.h +6 -10
  35. nuitka/build/include/nuitka/printing.h +2 -0
  36. nuitka/build/include/nuitka/unfreezing.h +5 -5
  37. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  38. nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
  39. nuitka/build/static_src/CompiledCellType.c +7 -7
  40. nuitka/build/static_src/CompiledCodeHelpers.c +49 -36
  41. nuitka/build/static_src/CompiledCoroutineType.c +2 -4
  42. nuitka/build/static_src/CompiledFrameType.c +109 -82
  43. nuitka/build/static_src/CompiledFunctionType.c +36 -9
  44. nuitka/build/static_src/CompiledGeneratorType.c +12 -10
  45. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
  46. nuitka/build/static_src/CompiledMethodType.c +14 -13
  47. nuitka/build/static_src/HelpersAttributes.c +13 -15
  48. nuitka/build/static_src/HelpersBuiltin.c +16 -7
  49. nuitka/build/static_src/HelpersCalling.c +13 -13
  50. nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
  51. nuitka/build/static_src/HelpersComparisonEq.c +110 -110
  52. nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
  53. nuitka/build/static_src/HelpersComparisonGe.c +110 -110
  54. nuitka/build/static_src/HelpersComparisonGt.c +110 -110
  55. nuitka/build/static_src/HelpersComparisonLe.c +110 -110
  56. nuitka/build/static_src/HelpersComparisonLt.c +110 -110
  57. nuitka/build/static_src/HelpersComparisonNe.c +110 -110
  58. nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
  59. nuitka/build/static_src/HelpersDictionaries.c +9 -0
  60. nuitka/build/static_src/HelpersFiles.c +2 -2
  61. nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
  62. nuitka/build/static_src/HelpersImport.c +1 -1
  63. nuitka/build/static_src/HelpersLists.c +5 -1
  64. nuitka/build/static_src/HelpersMatching.c +95 -35
  65. nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
  66. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
  67. nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
  68. nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
  69. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
  70. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
  71. nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
  72. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
  73. nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
  74. nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
  75. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
  76. nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
  77. nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
  78. nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
  79. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
  80. nuitka/build/static_src/HelpersSequences.c +1 -1
  81. nuitka/build/static_src/HelpersTypes.c +8 -4
  82. nuitka/build/static_src/MainProgram.c +28 -9
  83. nuitka/build/static_src/MetaPathBasedLoader.c +124 -108
  84. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
  85. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +1 -1
  86. nuitka/build/static_src/OnefileBootstrap.c +34 -6
  87. nuitka/code_generation/AttributeCodes.py +12 -10
  88. nuitka/code_generation/CodeGeneration.py +6 -7
  89. nuitka/code_generation/ConstantCodes.py +53 -10
  90. nuitka/code_generation/GlobalConstants.py +6 -6
  91. nuitka/code_generation/Indentation.py +3 -4
  92. nuitka/code_generation/LoaderCodes.py +3 -0
  93. nuitka/code_generation/LocalsDictCodes.py +36 -14
  94. nuitka/code_generation/MatchCodes.py +23 -4
  95. nuitka/code_generation/ModuleCodes.py +0 -7
  96. nuitka/code_generation/Namify.py +2 -0
  97. nuitka/code_generation/PackageResourceCodes.py +5 -1
  98. nuitka/code_generation/templates/CodeTemplatesConstants.py +6 -4
  99. nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
  100. nuitka/code_generation/templates/CodeTemplatesModules.py +3 -3
  101. nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
  102. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
  103. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
  104. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
  105. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
  106. nuitka/freezer/DependsExe.py +3 -1
  107. nuitka/freezer/DllDependenciesMacOS.py +5 -12
  108. nuitka/freezer/IncludedDataFiles.py +12 -3
  109. nuitka/freezer/IncludedEntryPoints.py +8 -2
  110. nuitka/freezer/Onefile.py +6 -1
  111. nuitka/freezer/Standalone.py +9 -2
  112. nuitka/importing/Importing.py +14 -5
  113. nuitka/importing/Recursion.py +3 -0
  114. nuitka/nodes/AttributeNodesGenerated.py +21 -12
  115. nuitka/nodes/BuiltinOpenNodes.py +5 -0
  116. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
  117. nuitka/nodes/BuiltinRefNodes.py +41 -1
  118. nuitka/nodes/ChildrenHavingMixins.py +143 -355
  119. nuitka/nodes/ClassNodes.py +30 -12
  120. nuitka/nodes/CodeObjectSpecs.py +9 -0
  121. nuitka/nodes/ExpressionBasesGenerated.py +11 -11
  122. nuitka/nodes/FunctionNodes.py +7 -11
  123. nuitka/nodes/FutureSpecs.py +16 -3
  124. nuitka/nodes/GeneratorNodes.py +2 -2
  125. nuitka/nodes/HardImportNodesGenerated.py +11 -134
  126. nuitka/nodes/LocalsScopes.py +19 -23
  127. nuitka/nodes/MatchNodes.py +18 -7
  128. nuitka/nodes/ModuleAttributeNodes.py +1 -20
  129. nuitka/nodes/ModuleNodes.py +23 -6
  130. nuitka/nodes/NodeBases.py +3 -2
  131. nuitka/nodes/NodeMetaClasses.py +26 -10
  132. nuitka/nodes/ReturnNodes.py +1 -1
  133. nuitka/nodes/StatementBasesGenerated.py +11 -11
  134. nuitka/nodes/SubscriptNodes.py +4 -4
  135. nuitka/nodes/VariableAssignNodes.py +1 -1
  136. nuitka/nodes/VariableRefNodes.py +28 -2
  137. nuitka/optimizations/FunctionInlining.py +3 -6
  138. nuitka/optimizations/Optimization.py +13 -12
  139. nuitka/optimizations/TraceCollections.py +19 -4
  140. nuitka/plugins/PluginBase.py +121 -133
  141. nuitka/plugins/Plugins.py +91 -3
  142. nuitka/plugins/YamlPluginBase.py +121 -0
  143. nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
  144. nuitka/plugins/standard/DataFilesPlugin.py +15 -6
  145. nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
  146. nuitka/plugins/standard/DllFilesPlugin.py +5 -3
  147. nuitka/plugins/standard/ImplicitImports.py +34 -20
  148. nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
  149. nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
  150. nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
  151. nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
  152. nuitka/plugins/standard/SpacyPlugin.py +136 -0
  153. nuitka/plugins/standard/standard.nuitka-package.config.yml +462 -179
  154. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +6 -0
  155. nuitka/reports/Reports.py +53 -5
  156. nuitka/specs/BuiltinParameterSpecs.py +1 -1
  157. nuitka/specs/HardImportSpecs.py +0 -6
  158. nuitka/tools/data_composer/DataComposer.py +29 -27
  159. nuitka/tools/environments/CreateEnvironment.py +1 -0
  160. nuitka/tools/environments/Virtualenv.py +25 -11
  161. nuitka/tools/general/find_module/FindModuleCode.py +13 -3
  162. nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
  163. nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
  164. nuitka/tools/specialize/CTypeDescriptions.py +13 -7
  165. nuitka/tools/specialize/SpecializePython.py +18 -1
  166. nuitka/tools/testing/Common.py +19 -6
  167. nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
  168. nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
  169. nuitka/tools/watch/AutoStage.py +144 -0
  170. nuitka/tools/watch/__main__.py +79 -32
  171. nuitka/tree/Building.py +105 -104
  172. nuitka/tree/ComplexCallHelperFunctions.py +16 -26
  173. nuitka/tree/InternalModule.py +8 -0
  174. nuitka/tree/ReformulationAssignmentStatements.py +29 -59
  175. nuitka/tree/ReformulationClasses.py +10 -17
  176. nuitka/tree/ReformulationClasses3.py +69 -43
  177. nuitka/tree/ReformulationComparisonExpressions.py +6 -16
  178. nuitka/tree/ReformulationContractionExpressions.py +14 -23
  179. nuitka/tree/ReformulationDictionaryCreation.py +6 -10
  180. nuitka/tree/ReformulationExecStatements.py +10 -10
  181. nuitka/tree/ReformulationForLoopStatements.py +6 -12
  182. nuitka/tree/ReformulationFunctionStatements.py +21 -28
  183. nuitka/tree/ReformulationImportStatements.py +8 -10
  184. nuitka/tree/ReformulationLambdaExpressions.py +3 -6
  185. nuitka/tree/ReformulationMatchStatements.py +166 -60
  186. nuitka/tree/ReformulationMultidist.py +3 -1
  187. nuitka/tree/ReformulationNamespacePackages.py +1 -1
  188. nuitka/tree/ReformulationPrintStatements.py +3 -6
  189. nuitka/tree/ReformulationSequenceCreation.py +13 -26
  190. nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
  191. nuitka/tree/ReformulationWithStatements.py +12 -16
  192. nuitka/tree/SourceHandling.py +13 -8
  193. nuitka/tree/VariableClosure.py +5 -21
  194. nuitka/utils/Distributions.py +80 -11
  195. nuitka/utils/Download.py +38 -31
  196. nuitka/utils/Execution.py +13 -2
  197. nuitka/utils/FileOperations.py +55 -28
  198. nuitka/utils/Images.py +6 -1
  199. nuitka/utils/Importing.py +1 -1
  200. nuitka/utils/ModuleNames.py +11 -5
  201. nuitka/utils/ReExecute.py +17 -13
  202. nuitka/utils/SharedLibraries.py +32 -8
  203. nuitka/utils/Signing.py +3 -1
  204. nuitka/utils/StaticLibraries.py +51 -41
  205. nuitka/utils/Timing.py +1 -1
  206. nuitka/utils/Utils.py +29 -7
  207. /Nuitka_winsvc-2.3.11.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.1.data/scripts/nuitka.cmd +0 -0
  208. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/LICENSE.txt +0 -0
  209. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/entry_points.txt +0 -0
  210. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/top_level.txt +0 -0
@@ -10,18 +10,18 @@
10
10
 
11
11
  WARNING, this code is GENERATED. Modify the template ChildrenHavingMixin.py.j2 instead!
12
12
 
13
- spell-checker: ignore __prepare__ append args autograph buffering capitalize casefold
14
- spell-checker: ignore center chars clear closefd copy count decode default delete dist
15
- spell-checker: ignore distribution_name encode encoding end endswith errors exit_code
16
- spell-checker: ignore expandtabs experimental_attributes experimental_autograph_options
13
+ spell-checker: ignore __prepare__ append args autograph capitalize casefold center chars
14
+ spell-checker: ignore clear copy count decode default delete dist distribution_name encode
15
+ spell-checker: ignore encoding end endswith errors exit_code expandtabs
16
+ spell-checker: ignore experimental_attributes experimental_autograph_options
17
17
  spell-checker: ignore experimental_compile experimental_follow_type_hints
18
- spell-checker: ignore experimental_implements experimental_relax_shapes extend file
19
- spell-checker: ignore fillchar find format format_map formatmap fromkeys func get group
20
- spell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha
21
- spell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable
22
- spell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys
23
- spell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower
24
- spell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package
18
+ spell-checker: ignore experimental_implements experimental_relax_shapes extend fillchar
19
+ spell-checker: ignore find format format_map formatmap fromkeys func get group handle
20
+ spell-checker: ignore has_key haskey index input_signature insert isalnum isalpha isascii
21
+ spell-checker: ignore isdecimal isdigit isidentifier islower isnumeric isprintable isspace
22
+ spell-checker: ignore istitle isupper item items iterable iteritems iterkeys itervalues
23
+ spell-checker: ignore jit_compile join keepends key keys kwargs ljust lower lstrip
24
+ spell-checker: ignore maketrans maxsplit mode name new old p package
25
25
  spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
26
26
  spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
27
27
  spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
@@ -286,8 +286,9 @@ class ChildHavingBodyOptionalMixin(object):
286
286
 
287
287
  # This is generated for use in
288
288
  # ExpressionAsyncgenObjectBody
289
- # ExpressionClassBodyP2
290
- # ExpressionClassBodyP3
289
+ # ExpressionClassDictBody
290
+ # ExpressionClassDictBodyP2
291
+ # ExpressionClassMappingBody
291
292
  # ExpressionCoroutineObjectBody
292
293
  # ExpressionFunctionBody
293
294
  # ExpressionFunctionPureBody
@@ -400,8 +401,9 @@ class ChildHavingBodyOptionalMixin(object):
400
401
 
401
402
  # Assign the names that are easier to import with a stable name.
402
403
  ChildrenExpressionAsyncgenObjectBodyMixin = ChildHavingBodyOptionalMixin
403
- ChildrenExpressionClassBodyP2Mixin = ChildHavingBodyOptionalMixin
404
- ChildrenExpressionClassBodyP3Mixin = ChildHavingBodyOptionalMixin
404
+ ChildrenExpressionClassDictBodyMixin = ChildHavingBodyOptionalMixin
405
+ ChildrenExpressionClassDictBodyP2Mixin = ChildHavingBodyOptionalMixin
406
+ ChildrenExpressionClassMappingBodyMixin = ChildHavingBodyOptionalMixin
405
407
  ChildrenExpressionCoroutineObjectBodyMixin = ChildHavingBodyOptionalMixin
406
408
  ChildrenExpressionFunctionBodyMixin = ChildHavingBodyOptionalMixin
407
409
  ChildrenExpressionFunctionPureBodyMixin = ChildHavingBodyOptionalMixin
@@ -6502,7 +6504,6 @@ class ChildHavingExpressionMixin(object):
6502
6504
  # ExpressionAttributeLookupStrUpper
6503
6505
  # ExpressionAttributeLookupStrZfill
6504
6506
  # ExpressionAttributeLookupTypePrepare
6505
- # ExpressionMatchArgs
6506
6507
  # ExpressionYield
6507
6508
  # ExpressionYieldFrom
6508
6509
  # ExpressionYieldFromAwaitable
@@ -6775,7 +6776,6 @@ ChildrenExpressionAttributeLookupStrTranslateMixin = ChildHavingExpressionMixin
6775
6776
  ChildrenExpressionAttributeLookupStrUpperMixin = ChildHavingExpressionMixin
6776
6777
  ChildrenExpressionAttributeLookupStrZfillMixin = ChildHavingExpressionMixin
6777
6778
  ChildrenExpressionAttributeLookupTypePrepareMixin = ChildHavingExpressionMixin
6778
- ChildrenExpressionMatchArgsMixin = ChildHavingExpressionMixin
6779
6779
  ChildrenExpressionYieldMixin = ChildHavingExpressionMixin
6780
6780
  ChildrenExpressionYieldFromMixin = ChildHavingExpressionMixin
6781
6781
  ChildrenExpressionYieldFromAwaitableMixin = ChildHavingExpressionMixin
@@ -6958,6 +6958,130 @@ ChildrenExpressionSliceLookupMixin = (
6958
6958
  )
6959
6959
 
6960
6960
 
6961
+ class ChildrenHavingExpressionMatchTypeMixin(object):
6962
+ # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
6963
+ __slots__ = ()
6964
+
6965
+ # This is generated for use in
6966
+ # ExpressionMatchArgs
6967
+
6968
+ def __init__(
6969
+ self,
6970
+ expression,
6971
+ match_type,
6972
+ ):
6973
+ expression.parent = self
6974
+
6975
+ self.subnode_expression = expression
6976
+
6977
+ match_type.parent = self
6978
+
6979
+ self.subnode_match_type = match_type
6980
+
6981
+ def getVisitableNodes(self):
6982
+ """The visitable nodes, with tuple values flattened."""
6983
+
6984
+ return (
6985
+ self.subnode_expression,
6986
+ self.subnode_match_type,
6987
+ )
6988
+
6989
+ def getVisitableNodesNamed(self):
6990
+ """Named children dictionary.
6991
+
6992
+ For use in cloning nodes, debugging and XML output.
6993
+ """
6994
+
6995
+ return (
6996
+ ("expression", self.subnode_expression),
6997
+ ("match_type", self.subnode_match_type),
6998
+ )
6999
+
7000
+ def replaceChild(self, old_node, new_node):
7001
+ value = self.subnode_expression
7002
+ if old_node is value:
7003
+ new_node.parent = self
7004
+
7005
+ self.subnode_expression = new_node
7006
+
7007
+ return
7008
+
7009
+ value = self.subnode_match_type
7010
+ if old_node is value:
7011
+ new_node.parent = self
7012
+
7013
+ self.subnode_match_type = new_node
7014
+
7015
+ return
7016
+
7017
+ raise AssertionError("Didn't find child", old_node, "in", self)
7018
+
7019
+ def getCloneArgs(self):
7020
+ """Get clones of all children to pass for a new node.
7021
+
7022
+ Needs to make clones of child nodes too.
7023
+ """
7024
+
7025
+ values = {
7026
+ "expression": self.subnode_expression.makeClone(),
7027
+ "match_type": self.subnode_match_type.makeClone(),
7028
+ }
7029
+
7030
+ values.update(self.getDetails())
7031
+
7032
+ return values
7033
+
7034
+ def finalize(self):
7035
+ del self.parent
7036
+
7037
+ self.subnode_expression.finalize()
7038
+ del self.subnode_expression
7039
+ self.subnode_match_type.finalize()
7040
+ del self.subnode_match_type
7041
+
7042
+ def computeExpressionRaw(self, trace_collection):
7043
+ """Compute an expression.
7044
+
7045
+ Default behavior is to just visit the child expressions first, and
7046
+ then the node "computeExpression". For a few cases this needs to
7047
+ be overloaded, e.g. conditional expressions.
7048
+ """
7049
+
7050
+ # First apply the sub-expressions, as they are evaluated before
7051
+ # the actual operation.
7052
+ for count, sub_expression in enumerate(self.getVisitableNodes()):
7053
+ expression = trace_collection.onExpression(sub_expression)
7054
+
7055
+ if expression.willRaiseAnyException():
7056
+ sub_expressions = self.getVisitableNodes()
7057
+
7058
+ wrapped_expression = wrapExpressionWithSideEffects(
7059
+ side_effects=sub_expressions[:count],
7060
+ old_node=sub_expression,
7061
+ new_node=expression,
7062
+ )
7063
+
7064
+ return (
7065
+ wrapped_expression,
7066
+ "new_raise",
7067
+ lambda: "For '%s' the child expression '%s' will raise."
7068
+ % (self.getChildNameNice(), expression.getChildNameNice()),
7069
+ )
7070
+
7071
+ # Then ask ourselves to work on it.
7072
+ return self.computeExpression(trace_collection)
7073
+
7074
+ def collectVariableAccesses(self, emit_read, emit_write):
7075
+ """Collect variable reads and writes of child nodes."""
7076
+
7077
+ self.subnode_expression.collectVariableAccesses(emit_read, emit_write)
7078
+ self.subnode_match_type.collectVariableAccesses(emit_read, emit_write)
7079
+
7080
+
7081
+ # Assign the names that are easier to import with a stable name.
7082
+ ChildrenExpressionMatchArgsMixin = ChildrenHavingExpressionMatchTypeMixin
7083
+
7084
+
6961
7085
  class ChildrenHavingExpressionNameDefaultOptionalMixin(object):
6962
7086
  # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
6963
7087
  __slots__ = ()
@@ -7263,7 +7387,7 @@ class ChildrenHavingExpressionSubscriptMixin(object):
7263
7387
  __slots__ = ()
7264
7388
 
7265
7389
  # This is generated for use in
7266
- # ExpressionSubscriptCheck
7390
+ # ExpressionMatchSubscriptCheck
7267
7391
  # ExpressionSubscriptLookup
7268
7392
  # ExpressionSubscriptLookupForUnpack
7269
7393
 
@@ -7381,7 +7505,7 @@ class ChildrenHavingExpressionSubscriptMixin(object):
7381
7505
 
7382
7506
 
7383
7507
  # Assign the names that are easier to import with a stable name.
7384
- ChildrenExpressionSubscriptCheckMixin = ChildrenHavingExpressionSubscriptMixin
7508
+ ChildrenExpressionMatchSubscriptCheckMixin = ChildrenHavingExpressionSubscriptMixin
7385
7509
  ChildrenExpressionSubscriptLookupMixin = ChildrenHavingExpressionSubscriptMixin
7386
7510
  ChildrenExpressionSubscriptLookupForUnpackMixin = ChildrenHavingExpressionSubscriptMixin
7387
7511
 
@@ -7479,342 +7603,6 @@ ChildrenExpressionLocalsMappingVariableRefOrFallbackMixin = ChildHavingFallbackM
7479
7603
  ChildrenExpressionLocalsVariableRefOrFallbackMixin = ChildHavingFallbackMixin
7480
7604
 
7481
7605
 
7482
- class ChildrenHavingFileModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin(
7483
- object
7484
- ):
7485
- # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
7486
- __slots__ = ()
7487
-
7488
- # This is generated for use in
7489
- # ExpressionBuiltinsOpen
7490
-
7491
- def __init__(
7492
- self,
7493
- file,
7494
- mode,
7495
- buffering,
7496
- encoding,
7497
- errors,
7498
- newline,
7499
- closefd,
7500
- opener,
7501
- ):
7502
- file.parent = self
7503
-
7504
- self.subnode_file = file
7505
-
7506
- if mode is not None:
7507
- mode.parent = self
7508
-
7509
- self.subnode_mode = mode
7510
-
7511
- if buffering is not None:
7512
- buffering.parent = self
7513
-
7514
- self.subnode_buffering = buffering
7515
-
7516
- if encoding is not None:
7517
- encoding.parent = self
7518
-
7519
- self.subnode_encoding = encoding
7520
-
7521
- if errors is not None:
7522
- errors.parent = self
7523
-
7524
- self.subnode_errors = errors
7525
-
7526
- if newline is not None:
7527
- newline.parent = self
7528
-
7529
- self.subnode_newline = newline
7530
-
7531
- if closefd is not None:
7532
- closefd.parent = self
7533
-
7534
- self.subnode_closefd = closefd
7535
-
7536
- if opener is not None:
7537
- opener.parent = self
7538
-
7539
- self.subnode_opener = opener
7540
-
7541
- def getVisitableNodes(self):
7542
- """The visitable nodes, with tuple values flattened."""
7543
-
7544
- result = []
7545
- result.append(self.subnode_file)
7546
- value = self.subnode_mode
7547
- if value is None:
7548
- pass
7549
- else:
7550
- result.append(value)
7551
- value = self.subnode_buffering
7552
- if value is None:
7553
- pass
7554
- else:
7555
- result.append(value)
7556
- value = self.subnode_encoding
7557
- if value is None:
7558
- pass
7559
- else:
7560
- result.append(value)
7561
- value = self.subnode_errors
7562
- if value is None:
7563
- pass
7564
- else:
7565
- result.append(value)
7566
- value = self.subnode_newline
7567
- if value is None:
7568
- pass
7569
- else:
7570
- result.append(value)
7571
- value = self.subnode_closefd
7572
- if value is None:
7573
- pass
7574
- else:
7575
- result.append(value)
7576
- value = self.subnode_opener
7577
- if value is None:
7578
- pass
7579
- else:
7580
- result.append(value)
7581
- return tuple(result)
7582
-
7583
- def getVisitableNodesNamed(self):
7584
- """Named children dictionary.
7585
-
7586
- For use in cloning nodes, debugging and XML output.
7587
- """
7588
-
7589
- return (
7590
- ("file", self.subnode_file),
7591
- ("mode", self.subnode_mode),
7592
- ("buffering", self.subnode_buffering),
7593
- ("encoding", self.subnode_encoding),
7594
- ("errors", self.subnode_errors),
7595
- ("newline", self.subnode_newline),
7596
- ("closefd", self.subnode_closefd),
7597
- ("opener", self.subnode_opener),
7598
- )
7599
-
7600
- def replaceChild(self, old_node, new_node):
7601
- value = self.subnode_file
7602
- if old_node is value:
7603
- new_node.parent = self
7604
-
7605
- self.subnode_file = new_node
7606
-
7607
- return
7608
-
7609
- value = self.subnode_mode
7610
- if old_node is value:
7611
- if new_node is not None:
7612
- new_node.parent = self
7613
-
7614
- self.subnode_mode = new_node
7615
-
7616
- return
7617
-
7618
- value = self.subnode_buffering
7619
- if old_node is value:
7620
- if new_node is not None:
7621
- new_node.parent = self
7622
-
7623
- self.subnode_buffering = new_node
7624
-
7625
- return
7626
-
7627
- value = self.subnode_encoding
7628
- if old_node is value:
7629
- if new_node is not None:
7630
- new_node.parent = self
7631
-
7632
- self.subnode_encoding = new_node
7633
-
7634
- return
7635
-
7636
- value = self.subnode_errors
7637
- if old_node is value:
7638
- if new_node is not None:
7639
- new_node.parent = self
7640
-
7641
- self.subnode_errors = new_node
7642
-
7643
- return
7644
-
7645
- value = self.subnode_newline
7646
- if old_node is value:
7647
- if new_node is not None:
7648
- new_node.parent = self
7649
-
7650
- self.subnode_newline = new_node
7651
-
7652
- return
7653
-
7654
- value = self.subnode_closefd
7655
- if old_node is value:
7656
- if new_node is not None:
7657
- new_node.parent = self
7658
-
7659
- self.subnode_closefd = new_node
7660
-
7661
- return
7662
-
7663
- value = self.subnode_opener
7664
- if old_node is value:
7665
- if new_node is not None:
7666
- new_node.parent = self
7667
-
7668
- self.subnode_opener = new_node
7669
-
7670
- return
7671
-
7672
- raise AssertionError("Didn't find child", old_node, "in", self)
7673
-
7674
- def getCloneArgs(self):
7675
- """Get clones of all children to pass for a new node.
7676
-
7677
- Needs to make clones of child nodes too.
7678
- """
7679
-
7680
- values = {
7681
- "file": self.subnode_file.makeClone(),
7682
- "mode": (
7683
- self.subnode_mode.makeClone() if self.subnode_mode is not None else None
7684
- ),
7685
- "buffering": (
7686
- self.subnode_buffering.makeClone()
7687
- if self.subnode_buffering is not None
7688
- else None
7689
- ),
7690
- "encoding": (
7691
- self.subnode_encoding.makeClone()
7692
- if self.subnode_encoding is not None
7693
- else None
7694
- ),
7695
- "errors": (
7696
- self.subnode_errors.makeClone()
7697
- if self.subnode_errors is not None
7698
- else None
7699
- ),
7700
- "newline": (
7701
- self.subnode_newline.makeClone()
7702
- if self.subnode_newline is not None
7703
- else None
7704
- ),
7705
- "closefd": (
7706
- self.subnode_closefd.makeClone()
7707
- if self.subnode_closefd is not None
7708
- else None
7709
- ),
7710
- "opener": (
7711
- self.subnode_opener.makeClone()
7712
- if self.subnode_opener is not None
7713
- else None
7714
- ),
7715
- }
7716
-
7717
- values.update(self.getDetails())
7718
-
7719
- return values
7720
-
7721
- def finalize(self):
7722
- del self.parent
7723
-
7724
- self.subnode_file.finalize()
7725
- del self.subnode_file
7726
- if self.subnode_mode is not None:
7727
- self.subnode_mode.finalize()
7728
- del self.subnode_mode
7729
- if self.subnode_buffering is not None:
7730
- self.subnode_buffering.finalize()
7731
- del self.subnode_buffering
7732
- if self.subnode_encoding is not None:
7733
- self.subnode_encoding.finalize()
7734
- del self.subnode_encoding
7735
- if self.subnode_errors is not None:
7736
- self.subnode_errors.finalize()
7737
- del self.subnode_errors
7738
- if self.subnode_newline is not None:
7739
- self.subnode_newline.finalize()
7740
- del self.subnode_newline
7741
- if self.subnode_closefd is not None:
7742
- self.subnode_closefd.finalize()
7743
- del self.subnode_closefd
7744
- if self.subnode_opener is not None:
7745
- self.subnode_opener.finalize()
7746
- del self.subnode_opener
7747
-
7748
- def computeExpressionRaw(self, trace_collection):
7749
- """Compute an expression.
7750
-
7751
- Default behavior is to just visit the child expressions first, and
7752
- then the node "computeExpression". For a few cases this needs to
7753
- be overloaded, e.g. conditional expressions.
7754
- """
7755
-
7756
- # First apply the sub-expressions, as they are evaluated before
7757
- # the actual operation.
7758
- for count, sub_expression in enumerate(self.getVisitableNodes()):
7759
- expression = trace_collection.onExpression(sub_expression)
7760
-
7761
- if expression.willRaiseAnyException():
7762
- sub_expressions = self.getVisitableNodes()
7763
-
7764
- wrapped_expression = wrapExpressionWithSideEffects(
7765
- side_effects=sub_expressions[:count],
7766
- old_node=sub_expression,
7767
- new_node=expression,
7768
- )
7769
-
7770
- return (
7771
- wrapped_expression,
7772
- "new_raise",
7773
- lambda: "For '%s' the child expression '%s' will raise."
7774
- % (self.getChildNameNice(), expression.getChildNameNice()),
7775
- )
7776
-
7777
- # Then ask ourselves to work on it.
7778
- return self.computeExpression(trace_collection)
7779
-
7780
- def collectVariableAccesses(self, emit_read, emit_write):
7781
- """Collect variable reads and writes of child nodes."""
7782
-
7783
- self.subnode_file.collectVariableAccesses(emit_read, emit_write)
7784
- subnode_mode = self.subnode_mode
7785
-
7786
- if subnode_mode is not None:
7787
- self.subnode_mode.collectVariableAccesses(emit_read, emit_write)
7788
- subnode_buffering = self.subnode_buffering
7789
-
7790
- if subnode_buffering is not None:
7791
- self.subnode_buffering.collectVariableAccesses(emit_read, emit_write)
7792
- subnode_encoding = self.subnode_encoding
7793
-
7794
- if subnode_encoding is not None:
7795
- self.subnode_encoding.collectVariableAccesses(emit_read, emit_write)
7796
- subnode_errors = self.subnode_errors
7797
-
7798
- if subnode_errors is not None:
7799
- self.subnode_errors.collectVariableAccesses(emit_read, emit_write)
7800
- subnode_newline = self.subnode_newline
7801
-
7802
- if subnode_newline is not None:
7803
- self.subnode_newline.collectVariableAccesses(emit_read, emit_write)
7804
- subnode_closefd = self.subnode_closefd
7805
-
7806
- if subnode_closefd is not None:
7807
- self.subnode_closefd.collectVariableAccesses(emit_read, emit_write)
7808
- subnode_opener = self.subnode_opener
7809
-
7810
- if subnode_opener is not None:
7811
- self.subnode_opener.collectVariableAccesses(emit_read, emit_write)
7812
-
7813
-
7814
- # Assign the names that are easier to import with a stable name.
7815
- ChildrenExpressionBuiltinsOpenMixin = ChildrenHavingFileModeOptionalBufferingOptionalEncodingOptionalErrorsOptionalNewlineOptionalClosefdOptionalOpenerOptionalMixin
7816
-
7817
-
7818
7606
  class ChildrenHavingFilenameModeOptionalBufferingOptionalMixin(object):
7819
7607
  # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
7820
7608
  __slots__ = ()
@@ -117,17 +117,15 @@ class ExpressionClassBodyBase(ExpressionOutlineFunctionBase):
117
117
  return True
118
118
 
119
119
 
120
- # TODO: Have a variation that knows dict shape or not statically.
121
- class ExpressionClassBodyP3(MarkNeedsAnnotationsMixin, ExpressionClassBodyBase):
122
- kind = "EXPRESSION_CLASS_BODY_P3"
120
+ class ExpressionClassMappingBody(MarkNeedsAnnotationsMixin, ExpressionClassBodyBase):
121
+ """For use in cases, where the Python3 class is possibly a mapping."""
123
122
 
124
- __slots__ = ("needs_annotations_dict",)
123
+ kind = "EXPRESSION_CLASS_MAPPING_BODY"
125
124
 
126
- if python_version >= 0x340:
127
- __slots__ += ("qualname_setup",)
125
+ __slots__ = ("needs_annotations_dict", "qualname_setup")
128
126
 
129
127
  # Force creation with proper type.
130
- locals_kind = "python3_class"
128
+ locals_kind = "python_mapping_class"
131
129
 
132
130
  def __init__(self, provider, name, doc, source_ref):
133
131
  ExpressionClassBodyBase.__init__(
@@ -140,16 +138,15 @@ class ExpressionClassBodyP3(MarkNeedsAnnotationsMixin, ExpressionClassBodyBase):
140
138
 
141
139
  MarkNeedsAnnotationsMixin.__init__(self)
142
140
 
143
- if python_version >= 0x340:
144
- self.qualname_setup = None
141
+ self.qualname_setup = None
145
142
 
146
143
 
147
- class ExpressionClassBodyP2(ExpressionDictShapeExactMixin, ExpressionClassBodyBase):
148
- kind = "EXPRESSION_CLASS_BODY_P2"
144
+ class ExpressionClassDictBodyP2(ExpressionDictShapeExactMixin, ExpressionClassBodyBase):
145
+ kind = "EXPRESSION_CLASS_DICT_BODY_P2"
149
146
 
150
147
  __slots__ = ()
151
148
 
152
- locals_kind = "python2_class"
149
+ locals_kind = "python_dict_class"
153
150
 
154
151
  def __init__(self, provider, name, doc, source_ref):
155
152
  ExpressionClassBodyBase.__init__(
@@ -161,6 +158,27 @@ class ExpressionClassBodyP2(ExpressionDictShapeExactMixin, ExpressionClassBodyBa
161
158
  )
162
159
 
163
160
 
161
+ class ExpressionClassDictBody(MarkNeedsAnnotationsMixin, ExpressionClassDictBodyP2):
162
+ """For use in cases, where it's compile time pre-optimization determined to be a dictionary."""
163
+
164
+ kind = "EXPRESSION_CLASS_DICT_BODY"
165
+
166
+ __slots__ = ("needs_annotations_dict", "qualname_setup")
167
+
168
+ def __init__(self, provider, name, doc, source_ref):
169
+ ExpressionClassDictBodyP2.__init__(
170
+ self,
171
+ provider=provider,
172
+ name=name,
173
+ doc=doc,
174
+ source_ref=source_ref,
175
+ )
176
+
177
+ MarkNeedsAnnotationsMixin.__init__(self)
178
+
179
+ self.qualname_setup = None
180
+
181
+
164
182
  class ExpressionSelectMetaclass(ChildrenHavingMetaclassBasesMixin, ExpressionBase):
165
183
  kind = "EXPRESSION_SELECT_METACLASS"
166
184
 
@@ -8,6 +8,7 @@ objects, as well as tracebacks. They might be shared.
8
8
 
9
9
  """
10
10
 
11
+ from nuitka.utils.Hashing import getStringHash
11
12
  from nuitka.utils.InstanceCounters import (
12
13
  counted_del,
13
14
  counted_init,
@@ -132,6 +133,14 @@ class CodeObjectSpec(object):
132
133
  "code_flags": ",".join(self.future_spec.asFlags()),
133
134
  }
134
135
 
136
+ def getHash(self):
137
+ return getStringHash(
138
+ "|".join(
139
+ "%s=%s" % (key, value)
140
+ for key, value in sorted(self.getDetails().items())
141
+ )
142
+ )
143
+
135
144
  def getCodeObjectKind(self):
136
145
  return self.co_kind
137
146
 
@@ -10,18 +10,18 @@
10
10
 
11
11
  WARNING, this code is GENERATED. Modify the template ChildrenHavingMixin.py.j2 instead!
12
12
 
13
- spell-checker: ignore __prepare__ append args autograph buffering capitalize casefold
14
- spell-checker: ignore center chars clear closefd copy count decode default delete dist
15
- spell-checker: ignore distribution_name encode encoding end endswith errors exit_code
16
- spell-checker: ignore expandtabs experimental_attributes experimental_autograph_options
13
+ spell-checker: ignore __prepare__ append args autograph capitalize casefold center chars
14
+ spell-checker: ignore clear copy count decode default delete dist distribution_name encode
15
+ spell-checker: ignore encoding end endswith errors exit_code expandtabs
16
+ spell-checker: ignore experimental_attributes experimental_autograph_options
17
17
  spell-checker: ignore experimental_compile experimental_follow_type_hints
18
- spell-checker: ignore experimental_implements experimental_relax_shapes extend file
19
- spell-checker: ignore fillchar find format format_map formatmap fromkeys func get group
20
- spell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha
21
- spell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable
22
- spell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys
23
- spell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower
24
- spell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package
18
+ spell-checker: ignore experimental_implements experimental_relax_shapes extend fillchar
19
+ spell-checker: ignore find format format_map formatmap fromkeys func get group handle
20
+ spell-checker: ignore has_key haskey index input_signature insert isalnum isalpha isascii
21
+ spell-checker: ignore isdecimal isdigit isidentifier islower isnumeric isprintable isspace
22
+ spell-checker: ignore istitle isupper item items iterable iteritems iterkeys itervalues
23
+ spell-checker: ignore jit_compile join keepends key keys kwargs ljust lower lstrip
24
+ spell-checker: ignore maketrans maxsplit mode name new old p package
25
25
  spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
26
26
  spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
27
27
  spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault