Merge branch 'fluentpython:master' into master · fluentpython/example-code@fdf9057 · GitHub
Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Commit fdf9057

Browse files
author
Diego Amicabile
authored
Merge branch 'fluentpython:master' into master
2 parents 932e548 + d5133ad commit fdf9057

22 files changed

Lines changed: 53 additions & 63 deletions

File tree

03-dict-set/index.py

Lines changed: 1 addition & 1 deletion

03-dict-set/index0.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sys
99
import re
1010

11-
WORD_RE = re.compile('\w+')
11+
WORD_RE = re.compile(r'\w+')
1212

1313
index = {}
1414
with open(sys.argv[1], encoding='utf-8') as fp:

03-dict-set/index_default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import re
1010
import collections
1111

12-
WORD_RE = re.compile('\w+')
12+
WORD_RE = re.compile(r'\w+')
1313

1414
index = collections.defaultdict(list) # <1>
1515
with open(sys.argv[1], encoding='utf-8') as fp:

11-iface-abc/lotto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def pick(self):
1717
try:
1818
position = random.randrange(len(self._balls)) # <2>
1919
except ValueError:
20-
raise LookupError('pick from empty BingoCage')
20+
raise LookupError('pick from empty LotteryBlower')
2121
return self._balls.pop(position) # <3>
2222

2323
def loaded(self): # <4>

14-it-generator/sentence.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
import reprlib
77

8-
RE_WORD = re.compile('\w+')
8+
RE_WORD = re.compile(r'\w+')
99

1010

1111
class Sentence:
@@ -17,7 +17,7 @@ def __init__(self, text):
1717
def __getitem__(self, index):
1818
return self.words[index] # <2>
1919

20-
def __len__(self, index): # <3>
20+
def __len__(self): # <3>
2121
return len(self.words)
2222

2323
def __repr__(self):

14-it-generator/sentence_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
import reprlib
77

8-
RE_WORD = re.compile('\w+')
8+
RE_WORD = re.compile(r'\w+')
99

1010

1111
class Sentence:

14-it-generator/sentence_gen2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
import reprlib
77

8-
RE_WORD = re.compile('\w+')
8+
RE_WORD = re.compile(r'\w+')
99

1010

1111
class Sentence:

14-it-generator/sentence_genexp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import re
77
import reprlib
88

9-
RE_WORD = re.compile('\w+')
9+
RE_WORD = re.compile(r'\w+')
1010

1111

1212
class Sentence:

14-it-generator/sentence_iter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import re
1010
import reprlib
1111

12-
RE_WORD = re.compile('\w+')
12+
RE_WORD = re.compile(r'\w+')
1313

1414

1515
class Sentence:

14-it-generator/sentence_iter2.py

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)