Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add type hints to the standard libraries #5373

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

Open
robinmackaij opened this issue Mar 19, 2025 · 5 comments
Open

Add type hints to the standard libraries #5373

robinmackaij opened this issue Mar 19, 2025 · 5 comments

Comments

@robinmackaij
Copy link
Contributor

robinmackaij commented Mar 19, 2025

As discussed here.

This issue is the parent issue to track progress on all the standard libraries (sub-issues).

Overall implementation decisions can be discussed / recorded here.

The Python typing best practices can be found here:
https://typing.python.org/en/latest/reference/best_practices.html

@twbecker
Copy link

Came here looking for this. I'd been experimenting with custom argument converters and was disappointed to see that they aren't invoked for standard keywords because there are no type hints. Am I correct in assuming that this would correct that?

@pekkaklarck
Copy link
Member

@twbecker Standard libraries predate all automatic argument conversion support so they needed to implement their own argument conversion. All that custom code can be removed when we add type hints, but that probably doesn't bring any concrete benefits for normal users. Libdoc documentation getting better is nice, though.

@pekkaklarck
Copy link
Member

In order to get RF 7.3 out soon, I move this issue to RF 7.4 scope. It would still be possible to add type hints to some library or libraries in RF 7.3, though. My plan is to get RF 7.3 release candidate out early next week and that's a deadline for all code changes (which includes annotations). Are there any libraries you'd like to work on in that time frame @robinmackaij? If there are, please submit separate issues for each library and I can add them to RF 7.3 scope.

@pekkaklarck pekkaklarck modified the milestones: v7.3, v7.4 Apr 7, 2025
@robinmackaij
Copy link
Contributor Author

Are there any libraries you'd like to work on in that time frame @robinmackaij? If there are, please submit separate issues for each library and I can add them to RF 7.3 scope.

I need to work on training-related material at the moment and I also need to work towards an OpenApiTools release, so I have little time to work on this atm. It'd be good to get the sub-issues in the tracker when 7.3 is out, then it's easier to keep track and create the PRs (especially if there's others interested in contributing to this and we need to coordinate on the effort).

@pekkaklarck
Copy link
Member

Some keywords accepting configuration parameters as **config instead of named-only arguments makes adding type hints to them annoying. The reason to use **config is Python 2 support, so these keywords can be updated. I submitted #5412 about that and try to get it done still in RF 7.3 timeline.

@pekkaklarck pekkaklarck changed the title Add annotations / type hints to the standard libraries Add type hints to the standard libraries Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants