-
Notifications
You must be signed in to change notification settings - Fork 322
Open
Labels
maintenanceissues related to making the project usable or testableissues related to making the project usable or testable
Milestone
Description
Adding typehints would greatly improve usability.
Without type annotations, IDE support is very limited and I often have to search through the code to figure out the exact types of a given attribute. Also static typechecking is obviously not possible, which I think is also pretty important for consistent code quality.
If that's an effort that would be appreciated, I would start by type-hinting the modules I currently use the most.
Metadata
Metadata
Assignees
Labels
maintenanceissues related to making the project usable or testableissues related to making the project usable or testable
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
tomato42 commentedon Jun 1, 2024
Python 2.6 and 2.7 are still very much supported by this project, and will remain so for at least the next year or so.
As such, you'll need to add the type hints as comments, not inline. If that will help with your IDE: sure, go ahead. You can provide patches even on a function to function basis, as you work through them. Don't need to tackle the whole (public) API at once.
sumezulike commentedon Jun 1, 2024
Could type stubs then be a better solution? Those shouldn't interfere with the old pythons afaik.
tomato42 commentedon Jun 1, 2024
the issue is that you do have to remember to edit them and keep them updated... when type information is in a single file, then it's obvious and easy to do, when it's in separate file then it's easy to forget...
and if I do accept something into the repo, I generally intend to maintain it, can't realistically do it with this solution 🫤
sumezulike commentedon Jun 1, 2024
Yeah, understandable... I'm not a huge fan of type stubs either. I'll figure out how much type comments help!