bugdown: Revert NamedTuple declarations to old style.

This reverts part of commit 8bcdf4ca97
(#15093), to work around a mypy caching bug:
https://github.com/python/mypy/issues/7281.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-05-28 16:11:49 -07:00 committed by Tim Abbott
parent 0288002b84
commit ba7906a3c6
1 changed files with 10 additions and 8 deletions

View File

@ -291,11 +291,12 @@ def walk_tree(root: Element,
return results
class ElementFamily(NamedTuple):
grandparent: Optional[Element]
parent: Element
child: Element
in_blockquote: bool
ElementFamily = NamedTuple('ElementFamily', [
('grandparent', Optional[Element]),
('parent', Element),
('child', Element),
('in_blockquote', bool),
])
T = TypeVar("T")
@ -1527,9 +1528,10 @@ class BugdownListPreprocessor(markdown.preprocessors.Preprocessor):
def run(self, lines: List[str]) -> List[str]:
""" Insert a newline between a paragraph and ulist if missing """
class Fence(NamedTuple):
fence_str: str
is_code: bool
Fence = NamedTuple('Fence', [
('fence_str', str),
('is_code', bool),
])
inserts = 0
in_code_fence: bool = False