const.py 724 B

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