-
Notifications
You must be signed in to change notification settings - Fork 828
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
Adding type hints to the function signatures #1062
Comments
@Vuizur thanks for the suggestion. Yes this has been on my radar and I hope to incorporate type annotations into OSMnx v2.0 (aiming for a 2024 release). The current plan is for v2.0 to support Python 3.9+ and drop support for Python 3.8. Reading the 3.9 release notes it looks like we should be able to avoid using |
Work in progress in the typing branch. |
Proposed resolution in #1107. Comments, feedback, and improvements welcome. |
Merged into the v2 branch and targeted for release in 2.0.0. |
The first pre-release OSMnx v2 beta has been released. Testers needed! See #1123 for details. |
Contributing guidelines
Documentation
Existing issues
What problem does your feature proposal solve?
The types of the parameters and the returned data of the functions is already very well documented. Currently the data is in docstrings, which unfortunately IDEs like VS Code cannot use. Putting them additionally directly in the function signatures would have several advantages:
What is your proposed solution?
One could simply copy the info out of the docstrings and put it in the function signatures. I think using
from __future__ import annotations
would be the best choice, as we could use modern constructs from Python 3.10+ and still have a runnable program on Python 3.8.What alternatives have you considered?
One could also create type stubs, but they would be harder to maintain and get out of date.
Additional context
The text was updated successfully, but these errors were encountered: