Skip to content

Commit b32043b

Browse files
committed
Eval
1 parent d62453d commit b32043b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ Eval
10941094
### Detailed
10951095
```python
10961096
import ast
1097-
from ast import Num, BinOp, UnaryOp, parse
1097+
from ast import Num, BinOp, UnaryOp
10981098
import operator as op
10991099

11001100
operators = {ast.Add: op.add,
@@ -1106,7 +1106,7 @@ operators = {ast.Add: op.add,
11061106
ast.USub: op.neg}
11071107

11081108
def evaluate(expression):
1109-
root = parse(expression, mode='eval')
1109+
root = ast.parse(expression, mode='eval')
11101110
return eval_node(root.body)
11111111

11121112
def eval_node(node):

0 commit comments

Comments
 (0)