Skip to content

fix: typing.Literal not working in python 3.7#355

Merged
hfudev merged 1 commit intomainfrom
fix/literal
Apr 22, 2025
Merged

fix: typing.Literal not working in python 3.7#355
hfudev merged 1 commit intomainfrom
fix/literal

Conversation

@hfudev
Copy link
Copy Markdown
Member

@hfudev hfudev commented Apr 17, 2025

No description provided.

@hfudev hfudev requested a review from Copilot April 17, 2025 09:46
@hfudev hfudev self-assigned this Apr 17, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue with typing.Literal on Python 3.7 by conditionally importing it from typing_extensions for older versions while using the built-in version for newer ones.

  • Introduces a version check using sys.version_info.
  • Adds a conditional import for Literal to support Python 3.7.
  • Updates the ValidTargets type definition to reference the correctly imported Literal.

@hfudev hfudev merged commit e334930 into main Apr 22, 2025
3 of 5 checks passed
@hfudev hfudev deleted the fix/literal branch April 22, 2025 12:28
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