Skip to content
Snippets Groups Projects
Commit 94dc9c82 authored by Martin Mareš's avatar Martin Mareš
Browse files

NotImplemented -> NotImplementedError

Za Python modernější!
parent 92bc2be3
Branches
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
class Node: class Node:
def eval(self): def eval(self):
raise NotImplemented() raise NotImplementedError()
class NumNode(Node): class NumNode(Node):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
class Node: class Node:
def eval(self): def eval(self):
raise NotImplemented() raise NotImplementedError()
class NumNode(Node): class NumNode(Node):
......
...@@ -35,10 +35,10 @@ class Node: ...@@ -35,10 +35,10 @@ class Node:
return l * r return l * r
if op == '/': if op == '/':
return l // r return l // r
raise NotImplemented() raise NotImplementedError()
x = Node('+', Node('*', Node(3), Node(4)), Node('-', Node(5), Node(6))) x = Node('+', Node('*', Node(3), Node(4)), Node('-', Node(5), Node(6)))
# print(x) print(x)
x.print_tree() x.print_tree()
print(x.eval()) print(x.eval())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment