Skip to content

Conversation

@hukkin
Copy link

@hukkin hukkin commented May 8, 2020

typing.Literal was added in Python 3.8, so type checkers will fail trying to import it if python_version<3.8

This PR does the following:

  1. Imports Literal from typing_extensions if python_version<3.8.
  2. Adds typing_extensions as an install requirement if python_version<3.8.

Not sure if we want 2. though. One alternative would be to remove the one instance of Literal[False] that we have in the .pyi file.

@1st1
Copy link
Member

1st1 commented May 13, 2020

Not sure if we want 2. though. One alternative would be to remove the one instance of Literal[False] that we have in the .pyi file.

I'd remove the use of Literal if possible to simplify things.

@hukkin
Copy link
Author

hukkin commented May 13, 2020

👍 Removed use of Literal

@1st1 1st1 merged commit f2c4933 into MagicStack:master May 13, 2020
@hukkin hukkin deleted the typing-literal branch August 13, 2020 13:20
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