Skip to content

remove broken remnants of Python 2 compatibility - #272

Merged
AlexVonB merged 1 commit into
matthewwithanm:developfrom
a-detiste:develop
Nov 11, 2026
Merged

AlexVonB merged 1 commit into
matthewwithanm:developfrom
a-detiste:develop

Conversation

@a-detiste

Copy link
Copy Markdown
Contributor

by using typing, which is a good thing,
this project cannot be Python2-compatible anymore;
this cleans this up

$ grep Union -r
markdownify/__init__.pyi:from typing import Callable, Union
markdownify/__init__.pyi:    code_language_callback: Union[Callable[[Incomplete], Union[str, None]], None] = ...,
markdownify/__init__.pyi:    convert: Union[list[str], None] = ...,
markdownify/__init__.pyi:    strip: Union[list[str], None] = ...,
markdownify/__init__.pyi:    strip_document: Union[str, None] = ...,
markdownify/__init__.pyi:    strip_pre: Union[str, None] = ...,
markdownify/__init__.pyi:    wrap_width: Union[int, None] = ...,
markdownify/__init__.pyi:        code_language_callback: Union[Callable[[Incomplete], Union[str, None]], None] = ...,
markdownify/__init__.pyi:        convert: Union[list[str], None] = ...,
markdownify/__init__.pyi:        strip: Union[list[str], None] = ...,
markdownify/__init__.pyi:        strip_document: Union[str, None] = ...,
markdownify/__init__.pyi:        strip_pre: Union[str, None] = ...,
markdownify/__init__.pyi:        wrap_width: Union[int, None] = ...,
tests/types.py:from typing import Union
tests/types.py:def callback(el: BeautifulSoup) -> Union[str, None]:

by using typing, which is a _good_ thing,
this project cannot be Python2-compatible anymor

$ grep Union -r
markdownify/__init__.pyi:from typing import Callable, Union
markdownify/__init__.pyi:    code_language_callback: Union[Callable[[Incomplete], Union[str, None]], None] = ...,
markdownify/__init__.pyi:    convert: Union[list[str], None] = ...,
markdownify/__init__.pyi:    strip: Union[list[str], None] = ...,
markdownify/__init__.pyi:    strip_document: Union[str, None] = ...,
markdownify/__init__.pyi:    strip_pre: Union[str, None] = ...,
markdownify/__init__.pyi:    wrap_width: Union[int, None] = ...,
markdownify/__init__.pyi:        code_language_callback: Union[Callable[[Incomplete], Union[str, None]], None] = ...,
markdownify/__init__.pyi:        convert: Union[list[str], None] = ...,
markdownify/__init__.pyi:        strip: Union[list[str], None] = ...,
markdownify/__init__.pyi:        strip_document: Union[str, None] = ...,
markdownify/__init__.pyi:        strip_pre: Union[str, None] = ...,
markdownify/__init__.pyi:        wrap_width: Union[int, None] = ...,
tests/types.py:from typing import Union
tests/types.py:def callback(el: BeautifulSoup) -> Union[str, None]:

@hugovk hugovk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

The codebase doesn't support Python 2 any more, so no need to pull in the six compatibility shim.

@AlexVonB
AlexVonB merged commit 1bcbde7 into matthewwithanm:develop Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants