File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 10
10
PER_FILE_CACHES = []
11
11
12
12
13
- def _per_file_cache (func ):
13
+ def per_file_cache (func ):
14
14
memoized_func = lru_cache (maxsize = None )(func )
15
15
PER_FILE_CACHES .append (memoized_func )
16
16
return memoized_func
@@ -38,7 +38,7 @@ def _clean_heuristic(paragraph, regex):
38
38
paragraph = paragraph [: candidate .start ()] + paragraph [candidate .end () :]
39
39
40
40
41
- @_per_file_cache
41
+ @per_file_cache
42
42
def clean_paragraph (paragraph ):
43
43
"""Removes all good constructs, so detectors can focus on bad ones.
44
44
@@ -54,7 +54,7 @@ def clean_paragraph(paragraph):
54
54
return paragraph .replace ("\x00 " , "\\ " )
55
55
56
56
57
- @_per_file_cache
57
+ @per_file_cache
58
58
def escape2null (text ):
59
59
r"""Return a string with escape-backslashes converted to nulls.
60
60
@@ -88,7 +88,7 @@ def escape2null(text):
88
88
start = found + 2 # skip character after escape
89
89
90
90
91
- @_per_file_cache
91
+ @per_file_cache
92
92
def paragraphs (lines ):
93
93
"""Yield (paragraph_line_no, paragraph_text) pairs describing
94
94
paragraphs of the given lines.
@@ -216,7 +216,7 @@ def hide_non_rst_blocks(lines, hidden_block_cb=None):
216
216
_starts_with_substitution_definition = re .compile (r"\.\. \|[^\|]*\| " ).match
217
217
218
218
219
- @_per_file_cache
219
+ @per_file_cache
220
220
def type_of_explicit_markup (line ):
221
221
"""Tell apart various explicit markup blocks."""
222
222
line = line .lstrip ()
You can’t perform that action at this time.
0 commit comments