lepture/mistune

Introduce and use typing

Closed this issue · 3 comments

Your project currently does not make use of typing: https://docs.python.org/3/library/typing.html

Everyone working with your library and / or implementing new plugins and renderers will have a hard time figuring out what you data structure looks like, what methods and parameters are expected, ...

In my experience using typing also vastly improves code quality and reduces mistakes.

Please consider to use typing for your v2 remake.

@lepture I found this comment of yours here:

please don't add type hint. Mistune is compatible with Python 2.7

I very much disagree with that.
Python 2 is no longer supported since 01.01.2020. That's now already one year. You are going to release a new major version of mistune. This is absolutely the right time to break python 2.7 support and only support python 3+.

Yeah, it is time to support typing now.

added in v3.