ch01-12: clean up by @eumiro
This commit is contained in:
@@ -15,7 +15,7 @@ with open(sys.argv[1], encoding='utf-8') as fp:
|
||||
for line_no, line in enumerate(fp, 1):
|
||||
for match in WORD_RE.finditer(line):
|
||||
word = match.group()
|
||||
column_no = match.start()+1
|
||||
column_no = match.start() + 1
|
||||
location = (line_no, column_no)
|
||||
# this is ugly; coded like this to make a point
|
||||
occurrences = index.get(word, []) # <1>
|
||||
|
||||
@@ -16,7 +16,7 @@ with open(sys.argv[1], encoding='utf-8') as fp:
|
||||
for line_no, line in enumerate(fp, 1):
|
||||
for match in WORD_RE.finditer(line):
|
||||
word = match.group()
|
||||
column_no = match.start() + 1
|
||||
column_no = match.start()+1
|
||||
location = (line_no, column_no)
|
||||
index[word].append(location) # <2>
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class TransformDict(MutableMapping):
|
||||
|
||||
@property
|
||||
def transform_func(self):
|
||||
"""This TransformDict's transformation function"""
|
||||
"""This is TransformDict's transformation function"""
|
||||
return self._transform
|
||||
|
||||
# Minimum set of methods required for MutableMapping
|
||||
|
||||
Reference in New Issue
Block a user