Skip to content

add type hints for properties #703

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

Merged
merged 8 commits into from
Apr 28, 2025
Merged

add type hints for properties #703

merged 8 commits into from
Apr 28, 2025

Conversation

Vipitis
Copy link
Contributor

@Vipitis Vipitis commented Apr 9, 2025

follow up to #697

goal is to add type annotations to properties in _classes.py via codegen.
A lot of properties resolve to simple int or str python types while others are enums.

Will look into expanding resolve_type where it's needed or find better workarounds for features/limits. I am not 100% sure how type hints get inherited from these stubs, as there have been changes every single python release.

@Vipitis Vipitis marked this pull request as ready for review April 20, 2025 21:50
@Vipitis Vipitis requested a review from Korijn as a code owner April 20, 2025 21:50
Copy link
Member

@almarklein almarklein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@Korijn Korijn merged commit 0763b1f into pygfx:main Apr 28, 2025
20 checks passed
@Vipitis Vipitis deleted the prop-types branch April 28, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants