Skip to content

Commit 6de94c1

Browse files
authored
Merge pull request fluentpython#32 from anancds/patch
fixed anomalous backslash in string
2 parents dd16448 + 9fb76ef commit 6de94c1

File tree

14 files changed

+17
-17
lines changed

14 files changed

+17
-17
lines changed

03-dict-set/index.py

+1-1
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/index0.py

+1-1
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

+1-1
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:

14-it-generator/sentence.py

+1-1
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_gen.py

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import re
99
import reprlib
1010

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

1313

1414
class Sentence:

18-asyncio-py3.7/charfinder/charfinder.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
import functools
6565
from collections import namedtuple
6666

67-
RE_WORD = re.compile('\w+')
67+
RE_WORD = re.compile(r'\w+')
6868
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
69-
RE_CODEPOINT = re.compile('U\+([0-9A-F]{4,6})')
69+
RE_CODEPOINT = re.compile(r'U\+([0-9A-F]{4,6})')
7070

7171
INDEX_NAME = 'charfinder_index.pickle'
7272
MINIMUM_SAVE_LEN = 10000

18-asyncio/charfinder/charfinder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
import functools
6565
from collections import namedtuple
6666

67-
RE_WORD = re.compile('\w+')
67+
RE_WORD = re.compile(r'\w+')
6868
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
6969
RE_CODEPOINT = re.compile('U\+([0-9A-F]{4,6})')
7070

attic/concurrency/charfinder/charfinder.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
import itertools
6464
from collections import namedtuple
6565

66-
RE_WORD = re.compile('\w+')
66+
RE_WORD = re.compile(r'\w+')
6767
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
68-
RE_CODEPOINT = re.compile('U\+([0-9A-F]{4,6})')
68+
RE_CODEPOINT = re.compile(r'U\+([0-9A-F]{4,6})')
6969

7070
INDEX_NAME = 'charfinder_index.pickle'
7171
MINIMUM_SAVE_LEN = 10000

attic/dicts/index_alex.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sys
99
import re
1010

11-
NONWORD_RE = re.compile('\W+')
11+
NONWORD_RE = re.compile(r'\W+')
1212

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

attic/sequences/sentence_slice.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import reprlib
77

88

9-
RE_TOKEN = re.compile('\w+|\s+|[^\w\s]+')
9+
RE_TOKEN = re.compile(r'\w+|\s+|[^\w\s]+')
1010
RE_WORD = re.compile('\w+')
11-
RE_PUNCTUATION = re.compile('[^\w\s]+')
11+
RE_PUNCTUATION = re.compile(r'[^\w\s]+')
1212

1313

1414
class SentenceSlice:

0 commit comments

Comments
 (0)