Skip to content
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

[WIP] Add type hints to gramps.gen #1858

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DavidMStraub
Copy link
Member

This is work in progress adding type hints to gramps.gen and defining Gramps-specific types in the process.

@dsblank
Copy link
Member

dsblank commented Jan 22, 2025

@DavidMStraub, one complication is that when these methods are overloaded in a proxy (like LivingProxyDb, or PrivateProxyDb) then a method might return None. This is the number one issue in bugs throughout the code base: we don't check to see if the return value is None and then we end up with crashes.

I think with the correct type hints, we could catch such errors.

@DavidMStraub
Copy link
Member Author

Exactly! I have been bitten by this before. I suspect there are similar, more hidden cases.

@DavidMStraub DavidMStraub force-pushed the types_generic_get_from_handle branch from 2b130b1 to 2508db8 Compare January 26, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants