1# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
2# For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE
3# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt
4
5OP_PRECEDENCE = {
6 op: precedence
7 for precedence, ops in enumerate(
8 [
9 ["Lambda"], # lambda x: x + 1
10 ["IfExp"], # 1 if True else 2
11 ["or"],
12 ["and"],
13 ["not"],
14 ["Compare"], # in, not in, is, is not, <, <=, >, >=, !=, ==
15 ["|"],
16 ["^"],
17 ["&"],
18 ["<<", ">>"],
19 ["+", "-"],
20 ["*", "@", "/", "//", "%"],
21 ["UnaryOp"], # +, -, ~
22 ["**"],
23 ["Await"],
24 ]
25 )
26 for op in ops
27}