Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__cp311-cp311-win_amd64.whl

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

Potentially problematic release.


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

Files changed (304) hide show
  1. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
  2. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
  3. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
  4. nuitka/Builtins.py +31 -0
  5. nuitka/HardImportRegistry.py +8 -0
  6. nuitka/MainControl.py +9 -4
  7. nuitka/OptionParsing.py +108 -54
  8. nuitka/Options.py +69 -13
  9. nuitka/OutputDirectories.py +7 -2
  10. nuitka/PostProcessing.py +69 -38
  11. nuitka/Progress.py +16 -1
  12. nuitka/PythonVersions.py +2 -1
  13. nuitka/Serialization.py +4 -2
  14. nuitka/Tracing.py +69 -1
  15. nuitka/Version.py +2 -2
  16. nuitka/build/Backend.scons +45 -5
  17. nuitka/build/CCompilerVersion.scons +6 -0
  18. nuitka/build/Onefile.scons +6 -0
  19. nuitka/build/SconsCaching.py +4 -0
  20. nuitka/build/SconsCompilerSettings.py +14 -3
  21. nuitka/build/SconsInterface.py +3 -0
  22. nuitka/build/SconsUtils.py +5 -0
  23. nuitka/build/include/nuitka/allocator.h +124 -1
  24. nuitka/build/include/nuitka/calling.h +6 -6
  25. nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
  26. nuitka/build/include/nuitka/compiled_frame.h +2 -1
  27. nuitka/build/include/nuitka/constants.h +8 -0
  28. nuitka/build/include/nuitka/debug_settings.h +60 -0
  29. nuitka/build/include/nuitka/exceptions.h +264 -121
  30. nuitka/build/include/nuitka/helper/attributes.h +0 -4
  31. nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
  32. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  33. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  34. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  35. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  36. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  37. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  38. nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
  39. nuitka/build/include/nuitka/helper/ints.h +86 -37
  40. nuitka/build/include/nuitka/helper/iterators.h +82 -34
  41. nuitka/build/include/nuitka/helper/operations.h +3 -0
  42. nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
  43. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  44. nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
  45. nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
  46. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
  47. nuitka/build/include/nuitka/helper/raising.h +47 -28
  48. nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
  49. nuitka/build/include/nuitka/helper/tuples.h +12 -0
  50. nuitka/build/include/nuitka/helpers.h +12 -2
  51. nuitka/build/include/nuitka/prelude.h +36 -25
  52. nuitka/build/include/nuitka/printing.h +9 -7
  53. nuitka/build/include/nuitka/threading.h +15 -1
  54. nuitka/build/include/nuitka/type_aliases.h +3 -0
  55. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  56. nuitka/build/inline_copy/stubgen/six.py +998 -0
  57. nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
  58. nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
  59. nuitka/build/static_src/CompiledCellType.c +6 -4
  60. nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
  61. nuitka/build/static_src/CompiledCoroutineType.c +41 -31
  62. nuitka/build/static_src/CompiledFrameType.c +110 -79
  63. nuitka/build/static_src/CompiledFunctionType.c +173 -151
  64. nuitka/build/static_src/CompiledGeneratorType.c +51 -49
  65. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
  66. nuitka/build/static_src/CompiledMethodType.c +6 -12
  67. nuitka/build/static_src/HelpersAllocator.c +266 -28
  68. nuitka/build/static_src/HelpersAttributes.c +0 -21
  69. nuitka/build/static_src/HelpersBuiltin.c +23 -14
  70. nuitka/build/static_src/HelpersCalling.c +7 -7
  71. nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
  72. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  73. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  74. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  75. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  76. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  77. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  78. nuitka/build/static_src/HelpersComparisonEq.c +18 -4
  79. nuitka/build/static_src/HelpersComparisonGe.c +18 -4
  80. nuitka/build/static_src/HelpersComparisonGt.c +18 -4
  81. nuitka/build/static_src/HelpersComparisonLe.c +18 -4
  82. nuitka/build/static_src/HelpersComparisonLt.c +18 -4
  83. nuitka/build/static_src/HelpersComparisonNe.c +18 -4
  84. nuitka/build/static_src/HelpersConsole.c +34 -8
  85. nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
  86. nuitka/build/static_src/HelpersDeepcopy.c +1 -0
  87. nuitka/build/static_src/HelpersDictionaries.c +195 -36
  88. nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
  89. nuitka/build/static_src/HelpersExceptions.c +24 -50
  90. nuitka/build/static_src/HelpersFiles.c +79 -5
  91. nuitka/build/static_src/HelpersImport.c +13 -9
  92. nuitka/build/static_src/HelpersImportHard.c +23 -46
  93. nuitka/build/static_src/HelpersLists.c +98 -9
  94. nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
  95. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
  96. nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
  97. nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
  98. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
  99. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
  100. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  101. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
  102. nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
  103. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
  104. nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
  105. nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
  106. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
  107. nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
  108. nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
  109. nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
  110. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
  111. nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
  112. nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
  113. nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
  114. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
  115. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
  116. nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
  117. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
  118. nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
  119. nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
  120. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
  121. nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
  122. nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
  123. nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
  124. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
  125. nuitka/build/static_src/HelpersProfiling.c +1 -1
  126. nuitka/build/static_src/HelpersRaising.c +255 -310
  127. nuitka/build/static_src/HelpersStrings.c +1 -1
  128. nuitka/build/static_src/HelpersTuples.c +2 -2
  129. nuitka/build/static_src/HelpersTypes.c +98 -2
  130. nuitka/build/static_src/MainProgram.c +132 -28
  131. nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
  132. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
  133. nuitka/build/static_src/OnefileBootstrap.c +6 -1
  134. nuitka/code_generation/AsyncgenCodes.py +2 -6
  135. nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
  136. nuitka/code_generation/BuiltinCodes.py +9 -1
  137. nuitka/code_generation/CallCodes.py +16 -16
  138. nuitka/code_generation/CodeGeneration.py +14 -2
  139. nuitka/code_generation/CodeHelperSelection.py +1 -1
  140. nuitka/code_generation/CodeHelpers.py +4 -1
  141. nuitka/code_generation/CodeObjectCodes.py +2 -2
  142. nuitka/code_generation/ComparisonCodes.py +13 -2
  143. nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
  144. nuitka/code_generation/Contexts.py +28 -16
  145. nuitka/code_generation/CoroutineCodes.py +2 -6
  146. nuitka/code_generation/DictCodes.py +3 -3
  147. nuitka/code_generation/ErrorCodes.py +34 -50
  148. nuitka/code_generation/ExceptionCodes.py +165 -96
  149. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
  150. nuitka/code_generation/FrameCodes.py +4 -11
  151. nuitka/code_generation/FunctionCodes.py +2 -6
  152. nuitka/code_generation/GeneratorCodes.py +2 -6
  153. nuitka/code_generation/GlobalConstants.py +8 -2
  154. nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
  155. nuitka/code_generation/IteratorCodes.py +67 -54
  156. nuitka/code_generation/LineNumberCodes.py +1 -3
  157. nuitka/code_generation/ModuleCodes.py +28 -4
  158. nuitka/code_generation/OperationCodes.py +51 -20
  159. nuitka/code_generation/PackageResourceCodes.py +37 -0
  160. nuitka/code_generation/RaisingCodes.py +164 -90
  161. nuitka/code_generation/Reports.py +13 -5
  162. nuitka/code_generation/ReturnCodes.py +2 -16
  163. nuitka/code_generation/TryCodes.py +12 -24
  164. nuitka/code_generation/TypeAliasCodes.py +48 -0
  165. nuitka/code_generation/VariableCodes.py +99 -40
  166. nuitka/code_generation/VariableDeclarations.py +8 -8
  167. nuitka/code_generation/YieldCodes.py +1 -1
  168. nuitka/code_generation/c_types/CTypeBases.py +10 -2
  169. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
  170. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
  171. nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
  172. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
  173. nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
  174. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
  175. nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
  176. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
  177. nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
  178. nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
  179. nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
  180. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
  181. nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
  182. nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
  183. nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
  184. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
  185. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
  186. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
  187. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
  188. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
  189. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  190. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
  191. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  192. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
  193. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
  194. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
  195. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
  196. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
  197. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
  198. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
  199. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
  200. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
  201. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
  202. nuitka/containers/Namedtuples.py +6 -0
  203. nuitka/containers/OrderedSets.py +105 -5
  204. nuitka/distutils/Build.py +14 -0
  205. nuitka/distutils/DistutilCommands.py +50 -10
  206. nuitka/finalizations/Finalization.py +3 -3
  207. nuitka/finalizations/FinalizeMarkups.py +10 -14
  208. nuitka/freezer/DependsExe.py +5 -2
  209. nuitka/freezer/DllDependenciesMacOS.py +18 -1
  210. nuitka/freezer/DllDependenciesWin32.py +26 -12
  211. nuitka/freezer/ImportDetection.py +6 -0
  212. nuitka/freezer/IncludedDataFiles.py +37 -6
  213. nuitka/freezer/Onefile.py +1 -0
  214. nuitka/freezer/Standalone.py +72 -18
  215. nuitka/importing/Importing.py +33 -6
  216. nuitka/importing/Recursion.py +5 -2
  217. nuitka/importing/StandardLibrary.py +57 -59
  218. nuitka/nodes/AsyncgenNodes.py +3 -6
  219. nuitka/nodes/BuiltinIteratorNodes.py +2 -2
  220. nuitka/nodes/BuiltinRefNodes.py +14 -30
  221. nuitka/nodes/ChildrenHavingMixins.py +439 -46
  222. nuitka/nodes/ConditionalNodes.py +3 -2
  223. nuitka/nodes/CoroutineNodes.py +3 -6
  224. nuitka/nodes/DictionaryNodes.py +1 -1
  225. nuitka/nodes/ExceptionNodes.py +102 -26
  226. nuitka/nodes/ExpressionBasesGenerated.py +288 -4
  227. nuitka/nodes/FrameNodes.py +22 -11
  228. nuitka/nodes/FunctionNodes.py +3 -3
  229. nuitka/nodes/GeneratorNodes.py +3 -6
  230. nuitka/nodes/HardImportNodesGenerated.py +182 -0
  231. nuitka/nodes/ImportNodes.py +2 -2
  232. nuitka/nodes/NodeBases.py +28 -1
  233. nuitka/nodes/NodeMakingHelpers.py +71 -50
  234. nuitka/nodes/OperatorNodesUnary.py +128 -3
  235. nuitka/nodes/OsSysNodes.py +37 -6
  236. nuitka/nodes/OutlineNodes.py +2 -2
  237. nuitka/nodes/StatementBasesGenerated.py +0 -2
  238. nuitka/nodes/StatementNodes.py +8 -7
  239. nuitka/nodes/SubscriptNodes.py +1 -1
  240. nuitka/nodes/TypeNodes.py +28 -1
  241. nuitka/nodes/VariableAssignNodes.py +2 -1
  242. nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
  243. nuitka/nodes/shapes/IteratorShapes.py +71 -0
  244. nuitka/nodes/shapes/ShapeMixins.py +18 -0
  245. nuitka/nodes/shapes/StandardShapes.py +47 -44
  246. nuitka/optimizations/BytecodeDemotion.py +2 -1
  247. nuitka/plugins/PluginBase.py +64 -22
  248. nuitka/plugins/Plugins.py +16 -3
  249. nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
  250. nuitka/plugins/standard/DllFilesPlugin.py +78 -2
  251. nuitka/plugins/standard/ImplicitImports.py +5 -15
  252. nuitka/plugins/standard/KivyPlugin.py +3 -12
  253. nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
  254. nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
  255. nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
  256. nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
  257. nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
  258. nuitka/plugins/standard/TkinterPlugin.py +23 -3
  259. nuitka/plugins/standard/TransformersPlugin.py +70 -275
  260. nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
  261. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
  262. nuitka/reports/CompilationReportReader.py +12 -0
  263. nuitka/reports/Reports.py +11 -0
  264. nuitka/specs/BuiltinParameterSpecs.py +5 -1
  265. nuitka/specs/HardImportSpecs.py +7 -0
  266. nuitka/specs/ParameterSpecs.py +4 -4
  267. nuitka/tools/environments/Virtualenv.py +13 -5
  268. nuitka/tools/general/dll_report/__main__.py +10 -1
  269. nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
  270. nuitka/tools/podman/__main__.py +4 -2
  271. nuitka/tools/specialize/CTypeDescriptions.py +158 -9
  272. nuitka/tools/specialize/SpecializeC.py +218 -56
  273. nuitka/tools/testing/Common.py +69 -62
  274. nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
  275. nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
  276. nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
  277. nuitka/tools/watch/AutoStage.py +1 -0
  278. nuitka/tree/Building.py +10 -37
  279. nuitka/tree/ComplexCallHelperFunctions.py +4 -0
  280. nuitka/tree/ReformulationAssertStatements.py +31 -14
  281. nuitka/tree/ReformulationAssignmentStatements.py +5 -1
  282. nuitka/tree/ReformulationClasses3.py +94 -19
  283. nuitka/tree/ReformulationDictionaryCreation.py +1 -0
  284. nuitka/tree/ReformulationFunctionStatements.py +1 -1
  285. nuitka/tree/ReformulationMatchStatements.py +3 -1
  286. nuitka/tree/ReformulationYieldExpressions.py +23 -5
  287. nuitka/utils/CommandLineOptions.py +27 -3
  288. nuitka/utils/Download.py +2 -2
  289. nuitka/utils/Execution.py +36 -31
  290. nuitka/utils/FileOperations.py +18 -39
  291. nuitka/utils/Hashing.py +5 -1
  292. nuitka/utils/Importing.py +2 -14
  293. nuitka/utils/InlineCopies.py +52 -0
  294. nuitka/utils/InstalledPythons.py +9 -4
  295. nuitka/utils/Json.py +2 -2
  296. nuitka/utils/PackageResources.py +44 -0
  297. nuitka/utils/SharedLibraries.py +24 -0
  298. nuitka/utils/Signing.py +9 -1
  299. nuitka/utils/Utils.py +1 -0
  300. {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
  301. {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
  302. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
  303. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
  304. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
@@ -55,6 +55,7 @@ from nuitka.specs.HardImportSpecs import (
55
55
  importlib_resources_read_binary_spec,
56
56
  importlib_resources_read_text_spec,
57
57
  os_listdir_spec,
58
+ os_lstat_spec,
58
59
  os_path_abspath_spec,
59
60
  os_path_basename_spec,
60
61
  os_path_dirname_spec,
@@ -63,6 +64,7 @@ from nuitka.specs.HardImportSpecs import (
63
64
  os_path_isdir_spec,
64
65
  os_path_isfile_spec,
65
66
  os_path_normpath_spec,
67
+ os_stat_spec,
66
68
  os_uname_spec,
67
69
  pkg_resources_get_distribution_spec,
68
70
  pkg_resources_iter_entry_points_spec,
@@ -92,6 +94,8 @@ from .ChildrenHavingMixins import (
92
94
  ChildrenHavingPackageOrRequirementResourceNameMixin,
93
95
  ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin,
94
96
  ChildrenHavingPackageResourceMixin,
97
+ ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin,
98
+ ChildrenHavingPathOptionalDirFdOptionalMixin,
95
99
  )
96
100
  from .ExpressionBases import ExpressionBase
97
101
  from .ExpressionShapeMixins import (
@@ -1791,6 +1795,94 @@ class ExpressionOsListdirCallBase(ChildHavingPathOptionalMixin, ExpressionBase):
1791
1795
  return True
1792
1796
 
1793
1797
 
1798
+ class ExpressionOsLstatRef(ExpressionImportModuleNameHardExistsSpecificBase):
1799
+ """Function reference os.lstat"""
1800
+
1801
+ kind = "EXPRESSION_OS_LSTAT_REF"
1802
+
1803
+ def __init__(self, source_ref):
1804
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
1805
+ self,
1806
+ module_name="os",
1807
+ import_name="lstat",
1808
+ module_guaranteed=True,
1809
+ source_ref=source_ref,
1810
+ )
1811
+
1812
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
1813
+ # Anything may happen on call trace before this. On next pass, if
1814
+ # replaced, we might be better but not now.
1815
+ trace_collection.onExceptionRaiseExit(BaseException)
1816
+
1817
+ from .OsSysNodes import ExpressionOsLstatCall
1818
+
1819
+ result = extractBuiltinArgs(
1820
+ node=call_node,
1821
+ builtin_class=ExpressionOsLstatCall,
1822
+ builtin_spec=os_lstat_spec,
1823
+ )
1824
+
1825
+ return (
1826
+ result,
1827
+ "new_expression",
1828
+ "Call to 'os.lstat' recognized.",
1829
+ )
1830
+
1831
+
1832
+ hard_import_node_classes[ExpressionOsLstatRef] = os_lstat_spec
1833
+
1834
+
1835
+ class ExpressionOsLstatCallBase(
1836
+ ChildrenHavingPathOptionalDirFdOptionalMixin, ExpressionBase
1837
+ ):
1838
+ """Base class for OsLstatCall
1839
+
1840
+ Generated boiler plate code.
1841
+ """
1842
+
1843
+ named_children = (
1844
+ "path|optional",
1845
+ "dir_fd|optional",
1846
+ )
1847
+
1848
+ __slots__ = ("attempted",)
1849
+
1850
+ spec = os_lstat_spec
1851
+
1852
+ def __init__(self, path, dir_fd, source_ref):
1853
+
1854
+ ChildrenHavingPathOptionalDirFdOptionalMixin.__init__(
1855
+ self,
1856
+ path=path,
1857
+ dir_fd=dir_fd,
1858
+ )
1859
+
1860
+ ExpressionBase.__init__(self, source_ref)
1861
+
1862
+ self.attempted = False
1863
+
1864
+ def computeExpression(self, trace_collection):
1865
+ if self.attempted or not os_lstat_spec.isCompileTimeComputable(
1866
+ (self.subnode_path,)
1867
+ ):
1868
+ trace_collection.onExceptionRaiseExit(BaseException)
1869
+
1870
+ return self, None, None
1871
+
1872
+ try:
1873
+ return self.replaceWithCompileTimeValue(trace_collection)
1874
+ finally:
1875
+ self.attempted = True
1876
+
1877
+ @abstractmethod
1878
+ def replaceWithCompileTimeValue(self, trace_collection):
1879
+ pass
1880
+
1881
+ @staticmethod
1882
+ def mayRaiseExceptionOperation():
1883
+ return True
1884
+
1885
+
1794
1886
  class ExpressionOsPathAbspathRef(ExpressionImportModuleNameHardExistsSpecificBase):
1795
1887
  """Function reference os.path.abspath"""
1796
1888
 
@@ -2449,6 +2541,96 @@ class ExpressionOsPathNormpathCallBase(ChildHavingPathMixin, ExpressionBase):
2449
2541
  return True
2450
2542
 
2451
2543
 
2544
+ class ExpressionOsStatRef(ExpressionImportModuleNameHardExistsSpecificBase):
2545
+ """Function reference os.stat"""
2546
+
2547
+ kind = "EXPRESSION_OS_STAT_REF"
2548
+
2549
+ def __init__(self, source_ref):
2550
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
2551
+ self,
2552
+ module_name="os",
2553
+ import_name="stat",
2554
+ module_guaranteed=True,
2555
+ source_ref=source_ref,
2556
+ )
2557
+
2558
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
2559
+ # Anything may happen on call trace before this. On next pass, if
2560
+ # replaced, we might be better but not now.
2561
+ trace_collection.onExceptionRaiseExit(BaseException)
2562
+
2563
+ from .OsSysNodes import ExpressionOsStatCall
2564
+
2565
+ result = extractBuiltinArgs(
2566
+ node=call_node,
2567
+ builtin_class=ExpressionOsStatCall,
2568
+ builtin_spec=os_stat_spec,
2569
+ )
2570
+
2571
+ return (
2572
+ result,
2573
+ "new_expression",
2574
+ "Call to 'os.stat' recognized.",
2575
+ )
2576
+
2577
+
2578
+ hard_import_node_classes[ExpressionOsStatRef] = os_stat_spec
2579
+
2580
+
2581
+ class ExpressionOsStatCallBase(
2582
+ ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin, ExpressionBase
2583
+ ):
2584
+ """Base class for OsStatCall
2585
+
2586
+ Generated boiler plate code.
2587
+ """
2588
+
2589
+ named_children = (
2590
+ "path|optional",
2591
+ "dir_fd|optional",
2592
+ "follow_symlinks|optional",
2593
+ )
2594
+
2595
+ __slots__ = ("attempted",)
2596
+
2597
+ spec = os_stat_spec
2598
+
2599
+ def __init__(self, path, dir_fd, follow_symlinks, source_ref):
2600
+
2601
+ ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin.__init__(
2602
+ self,
2603
+ path=path,
2604
+ dir_fd=dir_fd,
2605
+ follow_symlinks=follow_symlinks,
2606
+ )
2607
+
2608
+ ExpressionBase.__init__(self, source_ref)
2609
+
2610
+ self.attempted = False
2611
+
2612
+ def computeExpression(self, trace_collection):
2613
+ if self.attempted or not os_stat_spec.isCompileTimeComputable(
2614
+ (self.subnode_path,)
2615
+ ):
2616
+ trace_collection.onExceptionRaiseExit(BaseException)
2617
+
2618
+ return self, None, None
2619
+
2620
+ try:
2621
+ return self.replaceWithCompileTimeValue(trace_collection)
2622
+ finally:
2623
+ self.attempted = True
2624
+
2625
+ @abstractmethod
2626
+ def replaceWithCompileTimeValue(self, trace_collection):
2627
+ pass
2628
+
2629
+ @staticmethod
2630
+ def mayRaiseExceptionOperation():
2631
+ return True
2632
+
2633
+
2452
2634
  class ExpressionOsUnameRef(ExpressionImportModuleNameHardExistsSpecificBase):
2453
2635
  """Function reference os.uname"""
2454
2636
 
@@ -454,9 +454,9 @@ class ExpressionImportModuleHard(
454
454
 
455
455
  @staticmethod
456
456
  def _getImportNameErrorString(module, module_name, name):
457
- if python_version < 0x340:
457
+ if python_version < 0x300:
458
458
  return "cannot import name %s" % name
459
- if python_version < 0x370:
459
+ elif python_version < 0x370:
460
460
  return "cannot import name %r" % name
461
461
  elif isStandaloneMode():
462
462
  return "cannot import name %r from %r" % (name, module_name)
nuitka/nodes/NodeBases.py CHANGED
@@ -185,6 +185,19 @@ class NodeBase(NodeMetaClassBase):
185
185
 
186
186
  return parent
187
187
 
188
+ def getContainingLoopNode(self):
189
+ """Return the parent that is module."""
190
+ parent = self.parent
191
+
192
+ while parent is not None and not parent.isExpressionFunctionBodyBase():
193
+
194
+ if parent.isStatementLoop():
195
+ return parent
196
+
197
+ parent = parent.getParent()
198
+
199
+ return parent
200
+
188
201
  def isParentVariableProvider(self):
189
202
  # Check if it's a closure giver, in which cases it can provide variables,
190
203
  return isinstance(self, ClosureGiverNodeMixin)
@@ -314,6 +327,10 @@ class NodeBase(NodeMetaClassBase):
314
327
  def isStatementsFrame():
315
328
  return False
316
329
 
330
+ @staticmethod
331
+ def isStatementsSequenceButNotFrame():
332
+ return False
333
+
317
334
  @staticmethod
318
335
  def isCompiledPythonModule():
319
336
  # For overload by module nodes
@@ -405,6 +422,11 @@ class NodeBase(NodeMetaClassBase):
405
422
  def getVisitableNodes():
406
423
  return ()
407
424
 
425
+ def checkChildren(self):
426
+ for c in self.getVisitableNodes():
427
+ assert c.parent is self, (c, "parent", self, "!=", c.parent)
428
+ c.checkChildren()
429
+
408
430
  @staticmethod
409
431
  def getVisitableNodesNamed():
410
432
  """Named children dictionary.
@@ -707,6 +729,11 @@ class StatementBase(NodeBase):
707
729
  expression = trace_collection.onExpression(expression)
708
730
 
709
731
  if expression.willRaiseAnyException():
732
+ # They probably have changed.
733
+ expressions = self.getVisitableNodes()
734
+
735
+ child_name = expression.getChildNameNice()
736
+
710
737
  wrapped_expression = makeStatementOnlyNodesFromExpressions(
711
738
  expressions[: count + 1]
712
739
  )
@@ -717,7 +744,7 @@ class StatementBase(NodeBase):
717
744
  wrapped_expression,
718
745
  "new_raise",
719
746
  lambda: "For %s the child expression '%s' will raise."
720
- % (self.getStatementNiceName(), expression.getChildNameNice()),
747
+ % (self.getStatementNiceName(), child_name),
721
748
  )
722
749
 
723
750
  return self, None, None
@@ -31,8 +31,10 @@ def makeConstantReplacementNode(constant, node, user_provided):
31
31
  def makeRaiseExceptionReplacementExpression(
32
32
  expression, exception_type, exception_value, no_warning=False
33
33
  ):
34
- from .BuiltinRefNodes import ExpressionBuiltinExceptionRef
35
- from .ExceptionNodes import ExpressionRaiseException
34
+ from .ExceptionNodes import (
35
+ ExpressionRaiseException,
36
+ makeBuiltinMakeExceptionNode,
37
+ )
36
38
 
37
39
  source_ref = expression.source_ref
38
40
 
@@ -48,12 +50,22 @@ def makeRaiseExceptionReplacementExpression(
48
50
  )
49
51
  )
50
52
 
53
+ if type(exception_value) is not tuple:
54
+ exception_value = (exception_value,)
55
+
56
+ args = tuple(
57
+ makeConstantReplacementNode(
58
+ constant=element, node=expression, user_provided=False
59
+ )
60
+ for element in exception_value
61
+ )
62
+
51
63
  result = ExpressionRaiseException(
52
- exception_type=ExpressionBuiltinExceptionRef(
53
- exception_name=exception_type, source_ref=source_ref
54
- ),
55
- exception_value=makeConstantReplacementNode(
56
- constant=exception_value, node=expression, user_provided=False
64
+ exception_type=makeBuiltinMakeExceptionNode(
65
+ exception_name=exception_type,
66
+ args=args,
67
+ for_raise=False,
68
+ source_ref=source_ref,
57
69
  ),
58
70
  source_ref=source_ref,
59
71
  )
@@ -61,15 +73,19 @@ def makeRaiseExceptionReplacementExpression(
61
73
  return result
62
74
 
63
75
 
64
- def makeRaiseExceptionReplacementStatement(statement, exception_type, exception_value):
65
- from .BuiltinRefNodes import ExpressionBuiltinExceptionRef
66
- from .ExceptionNodes import StatementRaiseExceptionImplicit
76
+ def makeRaiseExceptionReplacementStatement(
77
+ statement, exception_type, exception_value, no_warning=False
78
+ ):
79
+ from .ExceptionNodes import (
80
+ StatementRaiseException,
81
+ makeBuiltinMakeExceptionNode,
82
+ )
67
83
 
68
84
  source_ref = statement.getSourceReference()
69
85
 
70
86
  assert type(exception_type) is str
71
87
 
72
- if Options.shallWarnImplicitRaises():
88
+ if not no_warning and Options.shallWarnImplicitRaises():
73
89
  unusual_logger.warning(
74
90
  '%s: Will always raise exception: "%s(%s)"'
75
91
  % (
@@ -79,13 +95,18 @@ def makeRaiseExceptionReplacementStatement(statement, exception_type, exception_
79
95
  )
80
96
  )
81
97
 
82
- result = StatementRaiseExceptionImplicit(
83
- exception_type=ExpressionBuiltinExceptionRef(
84
- exception_name=exception_type, source_ref=source_ref
85
- ),
86
- exception_value=makeConstantReplacementNode(
87
- constant=exception_value, node=statement, user_provided=False
98
+ result = StatementRaiseException(
99
+ exception_type=makeBuiltinMakeExceptionNode(
100
+ exception_name=exception_type,
101
+ args=(
102
+ makeConstantReplacementNode(
103
+ constant=exception_value, node=statement, user_provided=False
104
+ ),
105
+ ),
106
+ for_raise=False,
107
+ source_ref=source_ref,
88
108
  ),
109
+ exception_value=None,
89
110
  exception_cause=None,
90
111
  exception_trace=None,
91
112
  source_ref=source_ref,
@@ -97,41 +118,35 @@ def makeRaiseExceptionReplacementStatement(statement, exception_type, exception_
97
118
  def makeRaiseExceptionReplacementExpressionFromInstance(expression, exception):
98
119
  assert isinstance(exception, Exception)
99
120
 
100
- args = exception.args
101
- if type(args) is tuple and len(args) == 1:
102
- value = args[0]
103
- else:
104
- assert type(args) is tuple
105
- value = args
106
-
107
121
  return makeRaiseExceptionReplacementExpression(
108
122
  expression=expression,
109
123
  exception_type=exception.__class__.__name__,
110
- exception_value=value,
124
+ exception_value=exception.args,
111
125
  )
112
126
 
113
127
 
114
128
  def makeRaiseExceptionStatementFromInstance(exception, source_ref):
115
129
  assert isinstance(exception, Exception)
116
130
 
117
- args = exception.args
118
- if type(args) is tuple and len(args) == 1:
119
- value = args[0]
120
- else:
121
- assert type(args) is tuple
122
- value = args
123
-
124
- from .BuiltinRefNodes import ExpressionBuiltinExceptionRef
125
131
  from .ConstantRefNodes import makeConstantRefNode
126
- from .ExceptionNodes import StatementRaiseExceptionImplicit
132
+ from .ExceptionNodes import (
133
+ StatementRaiseException,
134
+ makeBuiltinMakeExceptionNode,
135
+ )
127
136
 
128
- return StatementRaiseExceptionImplicit(
129
- exception_type=ExpressionBuiltinExceptionRef(
130
- exception_name=exception.__class__.__name__, source_ref=source_ref
131
- ),
132
- exception_value=makeConstantRefNode(
133
- constant=value, source_ref=source_ref, user_provided=False
137
+ args_value = tuple(
138
+ makeConstantRefNode(constant=arg, source_ref=source_ref, user_provided=False)
139
+ for arg in exception.args
140
+ )
141
+
142
+ return StatementRaiseException(
143
+ exception_type=makeBuiltinMakeExceptionNode(
144
+ exception_name=exception.__class__.__name__,
145
+ args=args_value,
146
+ for_raise=False,
147
+ source_ref=source_ref,
134
148
  ),
149
+ exception_value=None,
135
150
  exception_cause=None,
136
151
  exception_trace=None,
137
152
  source_ref=source_ref,
@@ -141,10 +156,12 @@ def makeRaiseExceptionStatementFromInstance(exception, source_ref):
141
156
  def makeRaiseExceptionExpressionFromTemplate(
142
157
  exception_type, template, template_args, source_ref
143
158
  ):
144
- from .BuiltinRefNodes import ExpressionBuiltinExceptionRef
145
159
  from .ConstantRefNodes import makeConstantRefNode
146
160
  from .ContainerMakingNodes import makeExpressionMakeTupleOrConstant
147
- from .ExceptionNodes import ExpressionRaiseException
161
+ from .ExceptionNodes import (
162
+ ExpressionRaiseException,
163
+ makeBuiltinMakeExceptionNode,
164
+ )
148
165
  from .OperatorNodes import makeBinaryOperationNode
149
166
 
150
167
  if type(template_args) is tuple:
@@ -153,15 +170,19 @@ def makeRaiseExceptionExpressionFromTemplate(
153
170
  )
154
171
 
155
172
  return ExpressionRaiseException(
156
- exception_type=ExpressionBuiltinExceptionRef(
157
- exception_name=exception_type, source_ref=source_ref
158
- ),
159
- exception_value=makeBinaryOperationNode(
160
- operator="Mod",
161
- left=makeConstantRefNode(
162
- constant=template, source_ref=source_ref, user_provided=True
173
+ exception_type=makeBuiltinMakeExceptionNode(
174
+ exception_name=exception_type,
175
+ args=(
176
+ makeBinaryOperationNode(
177
+ operator="Mod",
178
+ left=makeConstantRefNode(
179
+ constant=template, source_ref=source_ref, user_provided=True
180
+ ),
181
+ right=template_args,
182
+ source_ref=source_ref,
183
+ ),
163
184
  ),
164
- right=template_args,
185
+ for_raise=False,
165
186
  source_ref=source_ref,
166
187
  ),
167
188
  source_ref=source_ref,
@@ -7,6 +7,7 @@ Some of these come from built-ins, e.g. abs, some from syntax, and repr from bot
7
7
  """
8
8
 
9
9
  from nuitka import PythonOperators
10
+ from nuitka.Errors import NuitkaAssumptionError
10
11
 
11
12
  from .ChildrenHavingMixins import ChildHavingOperandMixin
12
13
  from .ConstantRefNodes import makeConstantRefNode
@@ -15,6 +16,11 @@ from .ExpressionShapeMixins import (
15
16
  ExpressionBoolShapeExactMixin,
16
17
  ExpressionStrOrUnicodeDerivedShapeMixin,
17
18
  )
19
+ from .NodeMakingHelpers import (
20
+ makeRaiseExceptionReplacementExpressionFromInstance,
21
+ wrapExpressionWithSideEffects,
22
+ )
23
+ from .shapes.StandardShapes import tshape_unknown
18
24
 
19
25
 
20
26
  class ExpressionOperationUnaryBase(ChildHavingOperandMixin, ExpressionBase):
@@ -31,10 +37,10 @@ class ExpressionOperationUnaryBase(ChildHavingOperandMixin, ExpressionBase):
31
37
  return self.operator
32
38
 
33
39
  def computeExpression(self, trace_collection):
34
- operator = self.getOperator()
35
40
  operand = self.subnode_operand
36
41
 
37
42
  if operand.isCompileTimeConstant():
43
+ operator = self.getOperator()
38
44
  operand_value = operand.getCompileTimeConstant()
39
45
 
40
46
  return trace_collection.getCompileTimeComputationResult(
@@ -61,6 +67,10 @@ class ExpressionOperationUnaryBase(ChildHavingOperandMixin, ExpressionBase):
61
67
  def isExpressionOperationUnary():
62
68
  return True
63
69
 
70
+ @staticmethod
71
+ def mayRaiseExceptionOperation():
72
+ return True
73
+
64
74
 
65
75
  class ExpressionOperationUnaryRepr( # TODO: Not exact
66
76
  ExpressionStrOrUnicodeDerivedShapeMixin, ExpressionOperationUnaryBase
@@ -104,7 +114,100 @@ class ExpressionOperationUnaryRepr( # TODO: Not exact
104
114
  return self.escape_desc is None or self.escape_desc.isControlFlowEscape()
105
115
 
106
116
 
107
- class ExpressionOperationUnarySub(ExpressionOperationUnaryBase):
117
+ # TODO: This should merge into base class.
118
+ class ExpressionOperationUnaryMixin(object):
119
+ # Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
120
+ __slots__ = ()
121
+
122
+ def mayRaiseExceptionOperation(self):
123
+ return self.escape_desc.getExceptionExit() is not None
124
+
125
+ def mayRaiseException(self, exception_type):
126
+ # TODO: Match getExceptionExit() more precisely against exception type given
127
+ return (
128
+ self.escape_desc is None
129
+ or self.escape_desc.getExceptionExit() is not None
130
+ or self.subnode_operand.mayRaiseException(exception_type)
131
+ )
132
+
133
+ def getTypeShape(self):
134
+ return self.type_shape
135
+
136
+ def createUnsupportedException(self, operand_shape):
137
+ typical_value = operand_shape.typical_value
138
+
139
+ try:
140
+ self.simulator(typical_value)
141
+ except TypeError as e:
142
+ return e
143
+ except Exception as e:
144
+ raise NuitkaAssumptionError(
145
+ "Unexpected exception type doing operation simulation",
146
+ self.operator,
147
+ self.simulator,
148
+ operand_shape,
149
+ e,
150
+ )
151
+ else:
152
+ raise NuitkaAssumptionError(
153
+ "Unexpected no-exception doing operation simulation",
154
+ self.operator,
155
+ self.simulator,
156
+ operand_shape,
157
+ )
158
+
159
+ def computeExpression(self, trace_collection):
160
+ operand = self.subnode_operand
161
+
162
+ if operand.isCompileTimeConstant():
163
+ operand_value = operand.getCompileTimeConstant()
164
+ operator = self.getOperator()
165
+
166
+ return trace_collection.getCompileTimeComputationResult(
167
+ node=self,
168
+ computation=lambda: self.simulator(operand_value),
169
+ description="Operator '%s' with constant argument." % operator,
170
+ )
171
+ else:
172
+ operand_shape = operand.getTypeShape()
173
+
174
+ self.type_shape, self.escape_desc = self._getOperationShape(operand_shape)
175
+
176
+ if self.escape_desc.isUnsupported():
177
+ result = wrapExpressionWithSideEffects(
178
+ new_node=makeRaiseExceptionReplacementExpressionFromInstance(
179
+ expression=self,
180
+ exception=self.createUnsupportedException(operand_shape),
181
+ ),
182
+ old_node=self,
183
+ side_effects=(operand,),
184
+ )
185
+
186
+ return (
187
+ result,
188
+ "new_raise",
189
+ "Replaced operator '%s' with %s arguments that cannot work."
190
+ % (self.operator, operand_shape),
191
+ )
192
+
193
+ exception_raise_exit = self.escape_desc.getExceptionExit()
194
+ if exception_raise_exit is not None:
195
+ trace_collection.onExceptionRaiseExit(exception_raise_exit)
196
+
197
+ if self.escape_desc.isValueEscaping():
198
+ # The value of these nodes escaped and could change its contents.
199
+ trace_collection.removeKnowledge(operand)
200
+
201
+ if self.escape_desc.isControlFlowEscape():
202
+ # Any code could be run, note that.
203
+ trace_collection.onControlFlowEscape(self)
204
+
205
+ return self, None, None
206
+
207
+
208
+ class ExpressionOperationUnarySub(
209
+ ExpressionOperationUnaryMixin, ExpressionOperationUnaryBase
210
+ ):
108
211
  """Python unary operator -"""
109
212
 
110
213
  kind = "EXPRESSION_OPERATION_UNARY_SUB"
@@ -112,13 +215,25 @@ class ExpressionOperationUnarySub(ExpressionOperationUnaryBase):
112
215
  operator = "USub"
113
216
  simulator = PythonOperators.unary_operator_functions[operator]
114
217
 
218
+ __slots__ = ("type_shape", "escape_desc")
219
+
115
220
  def __init__(self, operand, source_ref):
116
221
  ExpressionOperationUnaryBase.__init__(
117
222
  self, operand=operand, source_ref=source_ref
118
223
  )
119
224
 
225
+ self.type_shape = tshape_unknown
120
226
 
121
- class ExpressionOperationUnaryAdd(ExpressionOperationUnaryBase):
227
+ self.escape_desc = None
228
+
229
+ @staticmethod
230
+ def _getOperationShape(operand_shape):
231
+ return operand_shape.getOperationUnarySubShape()
232
+
233
+
234
+ class ExpressionOperationUnaryAdd(
235
+ ExpressionOperationUnaryMixin, ExpressionOperationUnaryBase
236
+ ):
122
237
  """Python unary operator +"""
123
238
 
124
239
  kind = "EXPRESSION_OPERATION_UNARY_ADD"
@@ -126,11 +241,21 @@ class ExpressionOperationUnaryAdd(ExpressionOperationUnaryBase):
126
241
  operator = "UAdd"
127
242
  simulator = PythonOperators.unary_operator_functions[operator]
128
243
 
244
+ __slots__ = ("type_shape", "escape_desc")
245
+
129
246
  def __init__(self, operand, source_ref):
130
247
  ExpressionOperationUnaryBase.__init__(
131
248
  self, operand=operand, source_ref=source_ref
132
249
  )
133
250
 
251
+ self.type_shape = tshape_unknown
252
+
253
+ self.escape_desc = None
254
+
255
+ @staticmethod
256
+ def _getOperationShape(operand_shape):
257
+ return operand_shape.getOperationUnaryAddShape()
258
+
134
259
 
135
260
  class ExpressionOperationUnaryInvert(ExpressionOperationUnaryBase):
136
261
  """Python unary operator ~"""