mahmoud / boltons

🔩 Like builtins, but boltons. 250+ constructs, recipes, and snippets which extend (and rely on nothing but) the Python standard library. Nothing like Michael Bolton.
https://boltons.readthedocs.org
Other
6.53k stars 353 forks source link

Type hints #373

Open aucampia opened 4 months ago

aucampia commented 4 months ago

boltons have some nice functionality but it would be very handy if it also had type hints. From https://github.com/mahmoud/boltons/pull/318 it seems you are open to type hints, but I just want to confirm this, and check if you have any specific preferences for how they should be added.

From what I gather from the linked issue:

Is there any thing more I should consider before working on it?

mahmoud commented 4 months ago

Hey Iwan! Thanks for your interest and I'm glad you asked. Actually since going 3.7+, yes, I think the answer here has gotten a lot simpler: Type hints welcome, annotations preferred, no comments / .pyi necessary.

Other than that, I'd request smaller PRs preferred, starting with the functions/types that are least ambiguous to type or that you feel most comfortable typing. :) Also on the docket, if you're typing a signature that involves a **kwargs, feel free to convert it to * kw-only args. :)

Looking forward to seeing what you come up with!