finished iterators chapter

This commit is contained in:
Mark Pilgrim
2009-04-22 23:11:54 -04:00
parent 845ecdea10
commit 4afb4d3e69
6 changed files with 325 additions and 275 deletions
+3 -1
View File
@@ -15,8 +15,10 @@ def build_match_and_apply_functions(pattern, search, replace):
return (matches_rule, apply_rule)
class LazyRules:
rules_f = 'plural6-rules.txt'
def __init__(self):
self.pattern_file = open('plural6-rules.txt')
self.pattern_file = open(self.rules_f)
self.cache = []
def __iter__(self):