Skip to content

Commit ecbd9ac

Browse files
committed
fine details
1 parent e49fb85 commit ecbd9ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/sage/doctest/parsing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def fake_RIFtol(*args):
9494
ansi_escape_sequence = re.compile(r'(\x1b[@-Z\\-~]|\x1b\[.*?[@-~]|\x9b.*?[@-~])')
9595

9696
special_optional_regex = 'arb216|arb218|py2|long time|not implemented|not tested|known bug'
97-
tag_with_explanation_regex = fr'((?:\w|[.])+)\s*(?:\((.*?)\))?'
97+
tag_with_explanation_regex = r'((?:\w|[.])+)\s*(?:\((.*?)\))?'
9898
optional_regex = re.compile(fr'(?P<cmd>{special_optional_regex})\s*(?:\((?P<cmd_explanation>.*?)\))?|'
9999
fr'[^ a-z]\s*(optional|needs)(?:\s|[:-])*(?P<tags>(?:(?:{tag_with_explanation_regex})\s*)*)',
100100
re.IGNORECASE)
@@ -470,7 +470,7 @@ def update_optional_tags(line, tags=None, *, add_tags=None, remove_tags=None, fo
470470
| V V V V V V v v v v
471471
| sage: # optional - magma, needs sage.symbolic
472472
"""
473-
if not (m := re.match('( *sage: *)(.*)', line)):
473+
if not re.match('( *sage: *)(.*)', line):
474474
raise ValueError(f'line must start with a sage: prompt, got: {line}')
475475

476476
current_tags, line_sans_tags, is_persistent = parse_optional_tags(line.rstrip(), return_string_sans_tags=True)
@@ -1141,7 +1141,7 @@ def update_tag_counts(optional_tags):
11411141
def check_and_clear_tag_counts():
11421142
if (num_examples := tag_count_within_block['']) >= 4:
11431143
if overused_tags := {tag for tag, count in tag_count_within_block.items()
1144-
if tag and count >= num_examples}:
1144+
if tag and count >= num_examples}:
11451145
overused_tags.update(persistent_optional_tags)
11461146
overused_tags.difference_update(self.file_optional_tags)
11471147
suggested = unparse_optional_tags(overused_tags, prefix='sage: # ')
@@ -1211,9 +1211,9 @@ def check_and_clear_tag_counts():
12111211

12121212
if self.optional_tags is not True:
12131213
extra = {tag
1214-
for tag in optional_tags
1215-
if (tag not in self.optional_tags
1216-
and tag not in available_software)}
1214+
for tag in optional_tags
1215+
if (tag not in self.optional_tags
1216+
and tag not in available_software)}
12171217
if extra:
12181218
if any(tag in external_software for tag in extra):
12191219
# never probe "external" software

0 commit comments

Comments
 (0)