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

Add support for TypeAliasType #1214

Merged
merged 4 commits into from
Mar 30, 2024
Merged

Add support for TypeAliasType #1214

merged 4 commits into from
Mar 30, 2024

Conversation

igorgaming
Copy link
Contributor

Its a new way to defined type aliases added in Python 3.12

Previous way is deprecated:

from typing import TypeAlias, Literal
MyType: TypeAlias = Literal["primary", "secondary"]

New way is:

type MyType = Literal["primary", "secondary"]

where is MyType is instance of https://docs.python.org/3/library/typing.html#typing.TypeAliasType

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (06d3b47) to head (df1cd7e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1214   +/-   ##
=======================================
  Coverage   98.57%   98.57%           
=======================================
  Files          74       74           
  Lines        8843     8853   +10     
=======================================
+ Hits         8717     8727   +10     
  Misses        126      126           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tfranzel
Copy link
Owner

good stuff @igorgaming, however I would like to see this tested. probably here in TYPE_HINT_TEST_PARAMS

@igorgaming
Copy link
Contributor Author

@tfranzel Done

@tfranzel tfranzel merged commit 580bee1 into tfranzel:master Mar 30, 2024
33 checks passed
@tfranzel
Copy link
Owner

thx @igorgaming, also had to run it through exec because this is apparently the first breaking change in python wrt. parsing.

@igorgaming igorgaming deleted the patch-1 branch March 30, 2024 21:15
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