mirror of
https://github.com/zulip/zulip.git
synced 2026-07-15 21:03:26 +08:00
bugdown: Fix ElementPair typing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
6aaeab75bc
commit
32f3fd1c77
@ -305,10 +305,13 @@ class ResultWithFamily(Generic[T]):
|
||||
self.family = family
|
||||
self.result = result
|
||||
|
||||
ElementPair = NamedTuple('ElementPair', [
|
||||
('parent', Optional[Any]), # Recursive types are not fully supported yet
|
||||
('value', Element)
|
||||
])
|
||||
class ElementPair:
|
||||
parent: Optional["ElementPair"]
|
||||
value: Element
|
||||
|
||||
def __init__(self, parent: Optional["ElementPair"], value: Element):
|
||||
self.parent = parent
|
||||
self.value = value
|
||||
|
||||
def walk_tree_with_family(root: Element,
|
||||
processor: Callable[[Element], Optional[_T]]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user