-
-
Notifications
You must be signed in to change notification settings - Fork 214
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 hints/stubs #352
Comments
Can you please give me an example of how type hints help the developers in using the library? I understand if they were contributing code but not very clear to me how it could improve the user experience.
Thanks,
Sep Dehpour
… On Sep 27, 2022, at 11:19 AM, Oussama ENNAFII ***@***.***> wrote:
It would be really helpful to have type hints or stubs for this package to help the developer in his experience using the library*.
I have found no alternative solution, for now.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
I think this article synthesizes very well the issue. |
Ok that article needs a subscription to "real Python". Since the type hints don't cause any performance improvement in cPython, we don't have it as a priority task. We can add the type hints to the new functions though. |
Type hints are extremely useful for discovering functions, arguments... and also for detecting regressions |
Type annotations are a very useful tool to improve code quality. It helps in describing the expected behavior and help the developers write more accurate code. Especially when paired with an IDE that analyse type annotations while coding. Many python projects requires type annotations these days. All type annotation-enabled projects using edit As I'm looking at deepdiff internals to create a typing stub for my own use of deepdiff, I see that the job of type annotating deepdiff is going to be a considerable undertaking. The types of the various objects used are rather amorphous, which makes typing harder. |
@rafrafek Is this a screenshot from your IDE? What IDE is that? |
@seperman Yes, it's from my IDE. It's VS Code with Python and Pylance extensions. I'm using Pylance static type checker in "strict" mode. Strict mode may be too strict for existing projects, but I can recommend it for new ones. Pylance uses Pyright under the hood. Pyright can be used as a CLI tool or with pre-commit. I'm using standard light theme with "sync with OS" option, so it switches to standard dark theme together with macOS after the sunset. I think most people use dark theme all the time so my IDE may look exotic even for VS Code users 😅 |
It would be really helpful to have type hints or stubs for this package to help the developer in his experience using the library*.
I have found no alternative solution, for now.
The text was updated successfully, but these errors were encountered: