Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Nov 1, 2023
1 parent fb2a74a commit d115aca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
1 change: 0 additions & 1 deletion markdown/extensions/def_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def run(self, parent: etree.Element, blocks: list[str]) -> bool | None:

if theRest:
blocks.insert(0, theRest)
return None


class DefListIndentProcessor(ListIndentProcessor):
Expand Down
3 changes: 1 addition & 2 deletions markdown/treeprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

if TYPE_CHECKING: # pragma: no cover
from markdown import Markdown
from typing import TypeGuard


def build_treeprocessors(md: Markdown, **kwargs: Any) -> util.Registry[Treeprocessor]:
Expand All @@ -46,7 +45,7 @@ def build_treeprocessors(md: Markdown, **kwargs: Any) -> util.Registry[Treeproce
return treeprocessors


def isString(s: object) -> TypeGuard[str]:
def isString(s: object) -> bool:
""" Return `True` if object is a string but not an [`AtomicString`][markdown.util.AtomicString]. """
if not isinstance(s, util.AtomicString):
return isinstance(s, str)
Expand Down
19 changes: 4 additions & 15 deletions markdown/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,6 @@ def deprecated_func(*args, **kwargs):
return wrapper


@overload
def parseBoolValue(value: str) -> bool:
... # pragma: no cover


@overload
def parseBoolValue(value: str | None, fail_on_errors: bool = True, preserve_none: bool = False) -> bool | None:
... # pragma: no cover


def parseBoolValue(value: str | None, fail_on_errors: bool = True, preserve_none: bool = False) -> bool | None:
"""Parses a string representing a boolean value. If parsing was successful,
returns `True` or `False`. If `preserve_none=True`, returns `True`, `False`,
Expand All @@ -162,7 +152,6 @@ def parseBoolValue(value: str | None, fail_on_errors: bool = True, preserve_none
return False
elif fail_on_errors:
raise ValueError('Cannot parse bool value: %r' % value)
return None


def code_escape(text: str) -> str:
Expand Down Expand Up @@ -337,12 +326,12 @@ def __iter__(self) -> Iterator[_T]:
return iter([self._data[k] for k, p in self._priority])

@overload
def __getitem__(self, key: str | int) -> _T:
... # pragma: no cover
def __getitem__(self, key: str | int) -> _T: # pragma: no cover
...

@overload
def __getitem__(self, key: slice) -> Registry[_T]:
... # pragma: no cover
def __getitem__(self, key: slice) -> Registry[_T]: # pragma: no cover
...

def __getitem__(self, key: str | int | slice) -> _T | Registry[_T]:
self._sort()
Expand Down

0 comments on commit d115aca

Please sign in to comment.