SmylerMC / litemapy

Litemapy's goal is to provide an easy to use way to read and edit Litematica's schematic file format
GNU General Public License v3.0
51 stars 5 forks source link

Add type hints #43

Closed Phil-hacker closed 7 months ago

Phil-hacker commented 8 months ago

this would probably need a bump to python 3.11 so typing.Self becomes available

SmylerMC commented 8 months ago

I agree that type annotations are a lot nicer than sphinx docstrings to provide type hints. Typing annotations support has improved quite a lot since I initially wrote the documentation two years ago.

I don't want to drop support for Python 3.9 just now, let alone 3.10. Statistics show they are still used quite a bit, and some popular LTS Linux distributions still ship them by default. Maybe typing_extensions would be a solution, but I don't know how well it is supported by IDEs and Sphinx, so that would have to be tested.

I don't want to mix-up two systems, so all Sphinx type hints in the existing code-base would have to be replaced with type annotations (Despite me already using annotations in the tests out of habit).

Overall, I would consider this to be a very low priority issue, since the current system works well. Now, if someone wants to take care of it, I would gladly accept a PR, as long as the previously mentioned problems are taken into account.