summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2021-04-20 02:12:24 (GMT)
committerGitHub <noreply@github.com>2021-04-20 02:12:24 (GMT)
commit503cdc7c124cebbd777008bdf7bd9aa666b25f07 (patch)
treeed9e0d1622622b1c37940d312de7d6e679bc8db2 /Lib/test/test_ast.py
parentdbac8f40e81eb0a29dc833e6409a1abf47467da6 (diff)
downloadcpython-503cdc7c124cebbd777008bdf7bd9aa666b25f07.zip
cpython-503cdc7c124cebbd777008bdf7bd9aa666b25f07.tar.gz
cpython-503cdc7c124cebbd777008bdf7bd9aa666b25f07.tar.bz2
Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476)
This reverts commit dbac8f40e81eb0a29dc833e6409a1abf47467da6.
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 80d24e9..6824958 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -1,7 +1,6 @@
import ast
import builtins
import dis
-import enum
import os
import sys
import types
@@ -699,35 +698,6 @@ class AST_Tests(unittest.TestCase):
with self.assertRaisesRegex(ValueError, f"Name node can't be used with '{constant}' constant"):
compile(expr, "<test>", "eval")
- def test_precedence_enum(self):
- class _Precedence(enum.IntEnum):
- """Precedence table that originated from python grammar."""
- TUPLE = enum.auto()
- YIELD = enum.auto() # 'yield', 'yield from'
- TEST = enum.auto() # 'if'-'else', 'lambda'
- OR = enum.auto() # 'or'
- AND = enum.auto() # 'and'
- NOT = enum.auto() # 'not'
- CMP = enum.auto() # '<', '>', '==', '>=', '<=', '!=',
- # 'in', 'not in', 'is', 'is not'
- EXPR = enum.auto()
- BOR = EXPR # '|'
- BXOR = enum.auto() # '^'
- BAND = enum.auto() # '&'
- SHIFT = enum.auto() # '<<', '>>'
- ARITH = enum.auto() # '+', '-'
- TERM = enum.auto() # '*', '@', '/', '%', '//'
- FACTOR = enum.auto() # unary '+', '-', '~'
- POWER = enum.auto() # '**'
- AWAIT = enum.auto() # 'await'
- ATOM = enum.auto()
- def next(self):
- try:
- return self.__class__(self + 1)
- except ValueError:
- return self
- enum._test_simple_enum(_Precedence, ast._Precedence)
-
class ASTHelpers_Test(unittest.TestCase):
maxDiff = None