-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add type/typing information/hinting to functions, classes, and methods #2996
Comments
In theory, I'd be in favor of this but I see two problems:
|
It can be progressive: |
My understanding could be incomplete, but I believe Python doesn't care too much about type annotations at runtime, and as such, I'm not sure that the CI chain would need to be altered in any way.
Adding type annotations would largely only affect function signatures, and lines where variables/members are defined. I've quickly inspected about 15 of the 23 PRs that are currently open, and none of them alter function signatures. A few of them do alter lines declaring empty collection structures, e.g. |
Yes, python doesn't care about annotations but if we are adding annotations we might as well add another CI check for typing using
Plus PRs that introduce functions but fair point. It might not be as problematic as I thought initially. |
Perhaps this will add some burden for those who enter new functions to pelican, but on the other hand you gain valuable code completions and that will be a huge benefit for new contributors. |
Feature Request
To improve the development experience when writing plugins or hacking at Pelican's internals, I'd like to add type declarations to the function signatures, class members, etc.
pelicanconf.py
itself?What this solves
Sometimes, the data types expected by various Pelican internals aren't immediately obvious without inspecting the underlying code (sometimes having to dig beyond the first or second level deep). Typing hints would enable IDEs such as Visual Studio Code to know what data types are acceptable and mark code that doesn't seem correct before running it.
The text was updated successfully, but these errors were encountered: