MCPcopy Index your code
hub / github.com/python/cpython / _Precedence

Class _Precedence

Lib/_ast_unparse.py:14–42  ·  view source on GitHub ↗

Precedence table that originated from python grammar.

Source from the content-addressed store, hash-verified

12
13@_simple_enum(IntEnum)
14class _Precedence:
15 """Precedence table that originated from python grammar."""
16
17 NAMED_EXPR = auto() # <target> := <expr1>
18 TUPLE = auto() # <expr1>, <expr2>
19 YIELD = auto() # 'yield', 'yield from'
20 TEST = auto() # 'if'-'else', 'lambda'
21 OR = auto() # 'or'
22 AND = auto() # 'and'
23 NOT = auto() # 'not'
24 CMP = auto() # '<', '>', '==', '>=', '<=', '!=',
25 # 'in', 'not in', 'is', 'is not'
26 EXPR = auto()
27 BOR = EXPR # '|'
28 BXOR = auto() # '^'
29 BAND = auto() # '&'
30 SHIFT = auto() # '<<', '>>'
31 ARITH = auto() # '+', '-'
32 TERM = auto() # '*', '@', '/', '%', '//'
33 FACTOR = auto() # unary '+', '-', '~'
34 POWER = auto() # '**'
35 AWAIT = auto() # 'await'
36 ATOM = auto()
37
38 def next(self):
39 try:
40 return self.__class__(self + 1)
41 except ValueError:
42 return self
43
44
45_SINGLE_QUOTES = ("'", '"')

Callers

nothing calls this directly

Calls 1

autoClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…