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

Make get_origin(Literal[...]) == Literal. #80

Merged
merged 1 commit into from Jun 19, 2022

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 5, 2021

@ilevkivskyi
Copy link
Owner

Hm, it looks like some tests failed. Could you please fix them before I can merge this?

@anntzer
Copy link
Contributor Author

anntzer commented Sep 5, 2021

Looks like(?) the failure now arises because of the confusion between typing.Literal (the backport of typing) and typing_extension.Literal. Not sure what the best approach is here...

@ilevkivskyi
Copy link
Owner

Hm that looks weird: the error messages are like typing_extensions.Literal != typing_extensions.Literal. As a blind guess maybe you can try something "smarter" like returning tp.__origin__ instead of a plain Literal?

@anntzer
Copy link
Contributor Author

anntzer commented Oct 25, 2021

I tried something along these lines (last commit), but no success...

@anntzer
Copy link
Contributor Author

anntzer commented Apr 10, 2022

Now fixed. There are some other failures, but they are unrelated to this PR (see e.g. #84).

@ilevkivskyi
Copy link
Owner

It looks like there are two other failures because new pytest doesn't support Python 3.5.0 and 3.5.1. Probably we can just stop testing those (so support will be best effort).

Could you please make a separate PR updating typing_extension requirement and test matrix for Python versions?

@ilevkivskyi
Copy link
Owner

Or actually you mean the issue is still present even on latest typing_extensions? If yes, we will need to investigate. (But you can still make a PR for not testing Python versions if you still have time for this.)

@anntzer
Copy link
Contributor Author

anntzer commented Jun 14, 2022

The failure of tests with Python 3.5.{0,1} is easy to fix so I did that at #85.
There's another test failure revolving around TypedDict with python 3.9.12, for which I don't have a quick fix (but which, I'd argue, should not block this PR as it is also completely unrelated).

@ilevkivskyi
Copy link
Owner

OK, I will merge this now, and will look at the remaining failure later.

@ilevkivskyi ilevkivskyi merged commit 768e931 into ilevkivskyi:master Jun 19, 2022
@anntzer anntzer deleted the ol branch June 19, 2022 15:41
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.

None yet

2 participants