-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type hinting for the code #170
Comments
I'm enthusiastic about the type hints, but I don't know what minimum Python version that would end up causing Rtree to be limited to. Does support degrade smoothly back to Python 3.6? |
@hobu, I think yes, the compatibility with older versions will be dropped upon the creation of the hinting system. Maybe if the support of older python needed, the string hints can be written (which are compatible with type checkers such as mypy). |
Type hints were first added to Python 3.5. There have been a lot of improvements since then, but if you need to maintain support for Python 3.5 or 3.6, it shouldn't be hard to do. There are ways to support older versions of Python too by adding the type hints in comments. |
If someone wants to make a PR adding these, I would be happy to merge it. |
I'm very excited for type annotations for Rtree - thanks for all the work so far. Unfortunately I noticed that Mypy gave some warnings with the v1.0.0 Rtree. I just opened #243 as I think would fix that issue - @hobu @adamjstewart let me know what you think or if you have other thoughts on how to ensure Rtree type annotations work properly in user projects. Thanks! |
Hello!
I think it'll be useful to add type hints to the python code here to make it more self-documented and clearly expressed. If you think that this is a good idea, I can take the task and make this myself.
The text was updated successfully, but these errors were encountered: