MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / customize_for_version35

Function customize_for_version35

uncompyle6/semantics/customize35.py:27–347  ·  view source on GitHub ↗
(self, version: tuple)

Source from the content-addressed store, hash-verified

25# Python 3.5+ Changes #
26#######################
27def customize_for_version35(self, version: tuple):
28 # fmt: off
29 self.TABLE_DIRECT.update(
30 {
31 # nested await expressions like:
32 # return await (await bar())
33 # need parenthesis.
34 "await_expr": ("await %p", (0, PRECEDENCE["await_expr"] - 1)),
35
36 "await_stmt": ("%|%c\n", 0),
37 "async_for_stmt": (
38 "%|async for %c in %c:\n%+%|%c%-\n\n",
39 (9, "store"),
40 (1, "expr"),
41 (25, ("for_block", "pass")),
42 ),
43 "async_forelse_stmt": (
44 "%|async for %c in %c:\n%+%c%-%|else:\n%+%c%-\n\n",
45 (9, "store"),
46 (1, "expr"),
47 (25, "for_block"),
48 (-2, "else_suite"),
49 ),
50 "async_with_stmt": (
51 "%|async with %c:\n%+%c%-",
52 (0, "expr"),
53 3
54 ),
55 "async_with_as_stmt": (
56 "%|async with %c as %c:\n%+%c%-",
57 (0, "expr"),
58 (2, "store"),
59 3,
60 ),
61 "dict_unpack": ("{**%C}", (0, -1, ", **")),
62 # "unmapexpr": ( "{**%c}", 0), # done by n_unmapexpr
63 }
64 )
65
66 # fmt: on
67
68 def async_call(node):
69 self.f.write("async ")
70 node.kind == "call"
71 p = self.prec
72 self.prec = 80
73 self.template_engine(("%c(%P)", 0, (1, -4, ", ", 100)), node)
74 self.prec = p
75 node.kind == "async_call"
76 self.prune()
77
78 self.n_async_call = async_call
79
80 def n_build_list_unpack(node):
81 """
82 prettyprint a list or tuple
83 """
84 p = self.prec

Callers 1

customize_for_version3Function · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected