Precedence table that originated from python grammar.
| 12 | |
| 13 | @_simple_enum(IntEnum) |
| 14 | class _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 = ("'", '"') |
nothing calls this directly
no test coverage detected
searching dependent graphs…