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

Adds support for typing.Literal in type stub generation #122

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

freider
Copy link
Contributor

@freider freider commented Jan 25, 2024

Previously it would evaluate the strings as potential Python types like with other nested annotations (e.g. list["str"] which means the same as list[str]). This is incorrect behavior for Literal specifically, which is fixed here.

Fixes MOD-2161

@freider freider requested a review from ekzhang January 25, 2024 18:23
Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

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

Auto-approved 👍. This diff qualified for automatic approval and doesn't need follow up review.

Copy link
Member

@ekzhang ekzhang left a comment

Choose a reason for hiding this comment

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

Wow awesome! Thanks, I'm learning

@freider freider merged commit f8aa8c9 into main Jan 26, 2024
9 checks passed
@freider freider deleted the freider/support-typing-literal branch January 26, 2024 08:06
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.

2 participants