Skip to content

Commit 26f5d15

Browse files
committed
bugdown: Revert NamedTuple declarations to old style.
This reverts part of commit 8bcdf4c (zulip#15093), to work around a mypy caching bug: python/mypy#7281. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 0288002 commit 26f5d15

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

zerver/lib/bugdown/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,12 @@ def walk_tree(root: Element,
291291

292292
return results
293293

294-
class ElementFamily(NamedTuple):
295-
grandparent: Optional[Element]
296-
parent: Element
297-
child: Element
298-
in_blockquote: bool
294+
ElementFamily = NamedTuple('ElementFamily', [
295+
('grandparent', Optional[Element]),
296+
('parent', Element),
297+
('child', Element),
298+
('in_blockquote', bool),
299+
])
299300

300301
T = TypeVar("T")
301302

@@ -1527,9 +1528,10 @@ class BugdownListPreprocessor(markdown.preprocessors.Preprocessor):
15271528

15281529
def run(self, lines: List[str]) -> List[str]:
15291530
""" Insert a newline between a paragraph and ulist if missing """
1530-
class Fence(NamedTuple):
1531-
fence_str: str
1532-
is_code: bool
1531+
Fence = NamedTuple('Fence', [
1532+
('fence_str', str),
1533+
('is_code', bool),
1534+
])
15331535

15341536
inserts = 0
15351537
in_code_fence: bool = False

0 commit comments

Comments
 (0)