Skip to content

Commit 083f8b2

Browse files
committed
Remove unimplemented(): it's not worth it without *-imports.
1 parent 677274b commit 083f8b2

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

csp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""CSP (Constraint Satisfaction Problems) problems and solvers. (Chapter 6)."""
22

3-
from utils import count, first, argmin_random_tie
3+
from utils import argmin_random_tie, count, first
44
import search
55

66
from collections import defaultdict
@@ -320,11 +320,11 @@ def tree_csp_solver(csp):
320320

321321

322322
def topological_sort(xs, x):
323-
unimplemented()
323+
raise NotImplementedError
324324

325325

326326
def make_arc_consistent(Xj, Xk, csp):
327-
unimplemented()
327+
raise NotImplementedError
328328

329329
# ______________________________________________________________________________
330330
# Map-Coloring Problems

learning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,11 @@ def decision_list_learning(examples):
412412
def find_examples(examples):
413413
"""Find a set of examples that all have the same outcome under
414414
some test. Return a tuple of the test, outcome, and examples."""
415-
unimplemented()
415+
raise NotImplementedError
416416

417417
def passes(example, test):
418418
"Does the example pass the test?"
419-
unimplemented()
419+
raise NotImplementedError
420420

421421
def predict(example):
422422
"Predict the outcome for the first passing test."

logic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,11 +674,11 @@ class HybridWumpusAgent(agents.Agent):
674674
"An agent for the wumpus world that does logical inference. [Figure 7.20]"""
675675

676676
def __init__(self):
677-
unimplemented()
677+
raise NotImplementedError
678678

679679

680680
def plan_route(current, goals, allowed):
681-
unimplemented()
681+
raise NotImplementedError
682682

683683
# ______________________________________________________________________________
684684

@@ -844,7 +844,7 @@ def subst(s, x):
844844

845845

846846
def fol_fc_ask(KB, alpha):
847-
unimplemented()
847+
raise NotImplementedError
848848

849849

850850
def standardize_variables(sentence, dic=None):

utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,6 @@ def DataFile(name, mode='r'):
322322
return AIMAFile(['aima-data', name], mode)
323323

324324

325-
def unimplemented():
326-
"Use this as a stub for not-yet-implemented functions."
327-
raise NotImplementedError
328-
329-
330325
# ______________________________________________________________________________
331326
# Expressions
332327

0 commit comments

Comments
 (0)