ch17: update from book draft

This commit is contained in:
Luciano Ramalho
2020-02-18 23:45:05 -03:00
parent 70650841b3
commit aa868e8f75
35 changed files with 788 additions and 31 deletions

View File

@@ -2,7 +2,7 @@
Sentence: iterate over words using a generator expression
"""
# BEGIN SENTENCE_GENEXP
# tag::SENTENCE_GENEXP[]
import re
import reprlib
@@ -19,7 +19,7 @@ class Sentence:
def __iter__(self):
return (match.group() for match in RE_WORD.finditer(self.text))
# END SENTENCE_GENEXP
# end::SENTENCE_GENEXP[]
def main():