Uh oh!
There was an error while loading. Please reload this page.
Use Final instead of Literal in logging - #7259
Closed
srittau wants to merge 2 commits into
Closed
Conversation
srittau
commented
Feb 18, 2022
CollaboratorAuthor
Test for #7258 |
Akuli
commented
Feb 18, 2022
Collaborator
You need to import |
srittau
commented
Feb 18, 2022
CollaboratorAuthor
The flake8 error was expected, the pytype one not. |
This comment has been minimized.
This comment has been minimized.
AlexWaygood
commented
Feb 18, 2022
Member
An encouraging primer output, however |
Contributor
Diff from mypy_primer, showing the effect of this PR on open source code: pip (https://github.com/pypa/pip)
- src/pip/_internal/locations/__init__.py:68: error: Incompatible types in assignment (expression has type "Literal[10]", variable has type "Literal[30]")- src/pip/_internal/utils/logging.py:231: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[10]")- src/pip/_internal/utils/logging.py:233: error: Incompatible types in assignment (expression has type "Literal[30]", variable has type "Literal[10]")- src/pip/_internal/utils/logging.py:235: error: Incompatible types in assignment (expression has type "Literal[40]", variable has type "Literal[10]")- src/pip/_internal/utils/logging.py:237: error: Incompatible types in assignment (expression has type "Literal[50]", variable has type "Literal[10]")- src/pip/_internal/utils/logging.py:239: error: Incompatible types in assignment (expression has type "Literal[20]", variable has type "Literal[10]")- src/pip/_internal/utils/subprocess.py:125: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[20]")
streamlit (https://github.com/streamlit/streamlit)
- lib/streamlit/logger.py: note: In function "set_log_level":- lib/streamlit/logger.py:41:21: error: Incompatible types in assignment (expression has type "Literal[40]", variable has type "Literal[50]") [assignment]- lib/streamlit/logger.py:43:21: error: Incompatible types in assignment (expression has type "Literal[30]", variable has type "Literal[50]") [assignment]- lib/streamlit/logger.py:45:21: error: Incompatible types in assignment (expression has type "Literal[20]", variable has type "Literal[50]") [assignment]- lib/streamlit/logger.py:47:21: error: Incompatible types in assignment (expression has type "Literal[10]", variable has type "Literal[50]") [assignment]- lib/streamlit/logger.py:57:17: error: Incompatible types in assignment (expression has type "Literal[50]", variable has type "Literal[20]") [assignment] |
hauntsaninja
commented
Feb 18, 2022
Collaborator
mypy_primer did tell us this was going to be a problem in #6610 and we merged, acknowledging that we might want to revert later. Maybe this question isn't meaningful, but do we feel like "this is things going to plan: we tried a thing, it didn't work" or should we update in the direction of being less likely to merge past primer issues? |
CollaboratorAuthor
Closing due to the discussion in #7258. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.