(self, version: tuple)
| 26 | |
| 27 | ####################### |
| 28 | def customize_for_version37(self, version: tuple): |
| 29 | ######################## |
| 30 | # Python 3.7+ changes |
| 31 | ####################### |
| 32 | |
| 33 | # fmt: off |
| 34 | PRECEDENCE["attribute37"] = 2 |
| 35 | PRECEDENCE["call_ex"] = 1 |
| 36 | PRECEDENCE["call_ex_kw"] = 1 |
| 37 | PRECEDENCE["call_ex_kw2"] = 1 |
| 38 | PRECEDENCE["call_ex_kw3"] = 1 |
| 39 | PRECEDENCE["call_ex_kw4"] = 1 |
| 40 | PRECEDENCE["call_kw"] = 0 |
| 41 | PRECEDENCE["call_kw36"] = 1 |
| 42 | PRECEDENCE["formatted_value1"] = 38 # f"...". This has to be below "named_expr" to make |
| 43 | # f'{(x := 10)}' preserve parenthesis |
| 44 | PRECEDENCE["formatted_value2"] = 38 # See above |
| 45 | PRECEDENCE["if_exp_37a"] = 28 |
| 46 | PRECEDENCE["if_exp_37b"] = 28 |
| 47 | PRECEDENCE["dict_unpack"] = 0 # **{...} |
| 48 | |
| 49 | # fmt: on |
| 50 | self.TABLE_DIRECT.update( |
| 51 | { |
| 52 | "and_not": ("%c and not %c", (0, "expr"), (2, "expr")), |
| 53 | "ann_assign": ( |
| 54 | "%|%[2]{attr}: %c\n", |
| 55 | 0, |
| 56 | ), |
| 57 | "ann_assign_init": ( |
| 58 | "%|%[2]{attr}: %c = %c\n", |
| 59 | 0, |
| 60 | 1, |
| 61 | ), |
| 62 | "async_for_stmt": ( |
| 63 | "%|async for %c in %c:\n%+%c%-\n\n", |
| 64 | (7, "store"), |
| 65 | (1, "expr"), |
| 66 | (17, "for_block"), |
| 67 | ), |
| 68 | "async_for_stmt37": ( |
| 69 | "%|async for %c in %c:\n%+%c%-\n\n", |
| 70 | (8, "store"), |
| 71 | (1, "expr"), |
| 72 | (17, ("for_block", "pass")), |
| 73 | ), |
| 74 | "async_with_stmt": ("%|async with %c:\n%+%c%-", (0, "expr"), 3), |
| 75 | "async_with_as_stmt": ( |
| 76 | "%|async with %c as %c:\n%+%c%-", |
| 77 | (0, "expr"), |
| 78 | (2, "store"), |
| 79 | 3, |
| 80 | ), |
| 81 | "async_forelse_stmt": ( |
| 82 | "%|async for %c in %c:\n%+%c%-%|else:\n%+%c%-\n\n", |
| 83 | (8, "store"), |
| 84 | (1, "expr"), |
| 85 | (-10, "for_block"), |
no outgoing calls
no test coverage detected