From 8879858871db40ef75d443d936ff949495bda597 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Wed, 30 Sep 2020 14:34:24 -0700 Subject: [PATCH] markdown: improve preprocessors type (#4588) * markdown: improve preprocessors type https://github.com/Python-Markdown/markdown/blob/b701c34ebd7b2d0eb319517b9a275ddf0c89608d/markdown/preprocessors.py#L46 * Apply suggestions from code review --- third_party/2and3/markdown/preprocessors.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/third_party/2and3/markdown/preprocessors.pyi b/third_party/2and3/markdown/preprocessors.pyi index c29b6ab59..e3083cdf5 100644 --- a/third_party/2and3/markdown/preprocessors.pyi +++ b/third_party/2and3/markdown/preprocessors.pyi @@ -1,14 +1,14 @@ -from typing import Any, Pattern +from typing import Any, Iterable, List, Pattern from . import util def build_preprocessors(md, **kwargs): ... class Preprocessor(util.Processor): - def run(self, lines) -> None: ... + def run(self, lines: List[str]) -> List[str]: ... class NormalizeWhitespace(Preprocessor): - def run(self, lines): ... + def run(self, lines: Iterable[str]) -> List[str]: ... class HtmlBlockPreprocessor(Preprocessor): right_tag_patterns: Any @@ -17,10 +17,10 @@ class HtmlBlockPreprocessor(Preprocessor): attrs_re: Any left_tag_re: Any markdown_in_raw: bool = ... - def run(self, lines): ... + def run(self, lines: Iterable[str]) -> List[str]: ... class ReferencePreprocessor(Preprocessor): TITLE: str = ... RE: Pattern TITLE_RE: Pattern - def run(self, lines): ... + def run(self, lines: List[str]) -> List[str]: ...