Skip to content

Commit 29b70a9

Browse files
committed
fix: resolve mypy issues for python 3.8 and 3.9+
1 parent de680fb commit 29b70a9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/mistune/list_parser.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import re
66
from dataclasses import dataclass
7-
from typing import TYPE_CHECKING, Any, Iterable, Optional, Match, Pattern
7+
from typing import TYPE_CHECKING, Any, Iterable, Optional, Match, Pattern, cast
88
from .util import strip_end
99

1010
if TYPE_CHECKING:
@@ -96,10 +96,10 @@ def parse_list(block: "BlockParser", m: Match[str], state: "BlockState") -> int:
9696
while item_or_none:
9797
item_or_none = _parse_list_item(block, bullet, item_or_none, token, state, rules)
9898

99-
end_pos = token.pop("_end_pos", None)
99+
end_pos = cast(Optional[int], token.pop("_end_pos", None))
100100
_transform_tight_list(token)
101101
if end_pos:
102-
index = token.pop("_tok_index")
102+
index = cast(int, token.pop("_tok_index"))
103103
state.tokens.insert(index, token)
104104
return end_pos
105105

0 commit comments

Comments
 (0)